Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IdSMTPServer and SMTP Relay

1 view
Skip to first unread message

Starikov Alexander

unread,
Nov 28, 2002, 4:27:36 AM11/28/02
to
Hello, All!

I'm writing simple smtp server with relay function, but i can't understand
how to deliver message for several recipients (To: adress1, adress2, ... ,
adressN).
I do this (in common words):
IdSMTPServer->OnReceiveMessageParsed(TIdCommand *ASender, TIdMessage *&AMsg,
TIdEMailAddressList *RCPT, AnsiString &CustomError)
{

IdDNSResolver -> Resolve MX records for domain of first recipient

IdSMTP -> Send ( AMsg ) over this mx records and got error "relaying to
<adress2, ... adressN> prohibited by administrator :((
}

Is it possible to send such messages and save original "TO" header?

Can someone give an exaple?

P.S. Indy 9.0.11


Alex Brainman

unread,
Dec 1, 2002, 5:49:08 PM12/1/02
to
Alexander,

" <high...@mailru.com> wrote in message
news:3de7...@newsgroups.borland.com...
> ...
> And how to send this command correctly?
> I tryed this:
> ...
> ...
> and got the same error... what's wroth this way?

Following is a transcript of my SMTP conversation with mxs.mail.ru who
is MX for mail.ru domain.

2625 *
2625 * CLIENT CONNECTED (127.0.0.1:2625) ...
2625 *
2625 *
2625 * SERVER CONNECTED (127.0.0.1:2625->194.67.57.100:25) ...
2625 *
2625 | 220 ESMTP MAIL.RU Mon, 02 Dec 2002 01:41:13 +0300
2625 - HELO w091
2625 | 250 mx6.mail.ru Hello w091 [203.100.243.162]
2625 - RSET
2625 | 250 Reset OK
2625 - MAIL FROM: <high...@mailru.com>
2625 | 250 <high...@mailru.com> is syntactically correct
2625 - RCPT TO: <high...@mail.ru>
2625 | 250 <high...@mail.ru> verified
2625 - DATA
2625 | 354 Enter message, ending with "." on a line by itself
2625 - From: "high...@mailru.com" <high...@mailru.com>
2625 - To: "high...@mail.ru" <high...@mail.ru>
2625 - Subject: test
2625 - Date: Mon, 2 Dec 2002 09:36:38 +1100
2625 -
2625 - test
2625 -
2625 - .
2625 | 250 OK id=18Icm3-000IQy-00
2625 - QUIT
2625 | 221 mx6.mail.ru closing connection
2625 *
2625 * DISCONECTED BY CLIENT (127.0.0.1:2625->194.67.57.100:25)
2625 *

The message is sent OK. What seems to be your problem ? Can you trace
your SMTP conversation so that you see excactly the dialogue between
your computers ?


Alex


Starikov Alexander

unread,
Dec 2, 2002, 10:47:04 AM12/2/02
to
Hello, Alex!
You wrote:

AB> The message is sent OK. What seems to be your problem ? Can you trace

Is it works with several recipients?
(RCPT TO: <high...@mail.ru>
...
To: <high...@mail.ru>, <high...@mailru.com>)

AB> your SMTP conversation so that you see excactly the dialogue between
AB> your computers ?

Sorry, i can't :((


Alex Brainman

unread,
Dec 2, 2002, 5:33:04 PM12/2/02
to
Alexander,


> Is it works with several recipients?

Give me the list and I'll try.

> AB> your SMTP conversation so that you see excactly the dialogue
between
> AB> your computers ?
>
> Sorry, i can't :((
>

If you're interested, I can send you some tools to do just that.


Alex


Alex Brainman

unread,
Dec 3, 2002, 5:52:18 PM12/3/02
to
Alexander,


> And is it possible to organize smth like this:
>

I doubt, it's a right way to go, but I'm no expert on Indy, in fact, I
haven't used it myself. See if someone from Indy team can help you.


Alex


Starikov Alexander

unread,
Dec 4, 2002, 8:28:20 AM12/4/02
to
Hello, Alex!
You wrote:

AB> I doubt, it's a right way to go, but I'm no expert on Indy, in fact, I
AB> haven't used it myself. See if someone from Indy team can help you.

I resolved this problem!!!
It was quite simple:

TStringsList *M = new TSringsList();
M->Add("From: "high...@mailru.com" <high...@mailru.com>");
M->Add("To: "high...@mail.ru" <high...@mail.ru>");
M->Add("Subject: test");
M->Add("Date: Mon, 2 Dec 2002 09:36:38 +1100");
M->Add("");
M->Add("test");
M->Add(".");
Send commands... (Rset, Mail from, rcpt to, data)
SMTP->SendCmd("DATA", 354);
for (int i = 0; i < M->Count; i++)
{
SMTP->WriteLn(M->Strings[i]); // <<<< Change
// progress bar redrawing
}


Thanks for all!!!


0 new messages