Board index » delphi » SMTP 'RCPT TO' difficulty

SMTP 'RCPT TO' difficulty

I am a bit confused on my reading of RFC 821 (not unusual, I guess). I
am
writing a relay program that reads in a POP3 message, then sends it on
again to an SMTP server.

I am using Indy, but this question does relate directly to those tools.

So - what I have been doing in the past is

1. read in POP3 message.
2. Look at POP3 header 'To:'
3. Setup TIdMessage with the POP3 message
4. Set the SMTP RCPT: to
RCPT TO:<new_Address, original address>

ie

RCPT TO:<k...@simcomcity.com, f...@simcomcity.com>

So even though the email was originally sent to 'fred', it is now sent
to
'kn'. The reason I need the original address on this line is at the
final
destination, the user will have a filter setup for 'fred'. If that
address
is left out, then there is no way to determine who the message was
originally sent to.

This used to work just fine when I was using sakEmail as the SMTP tool.
It
does not work with Indy.

Indy give me an error message to the effect that this forward-path is an
invalid address.

My reading of the RFC is

"the <forward-path>?can contain more than just a mailbox. The
<forward-path>?is a source routing list of hosts and the destination
mailbox. The first host in the <forward-path>?should be the host
receiving
this command"

To my mind, this indicates that

k...@simcomcity.com, f...@simcomcity.com

is a valid address (or <forward-path>).

ie
Msg.Recipients.EMailAddresses :=stSendTo+' , ' +
Msg.Recipients.EMailAddresses;

should work just fine. It does not.

You can do

Msg.Recipients.Add(stSendTo);
Msg.Recipients.Add(stOriginal);

But this is the same thing as

RCPT TO:<k...@simcomcity.com>
RCPT TO:<f...@simcomcity.com>

This is not the same thing (or is it?). My reading of the RFC means that
the message will be sent to both addresses, which is not what I require.

Can someone with a bit more knowledge than I in this area clarify this
for
me??

 

Re:SMTP 'RCPT TO' difficulty


kneighb...@simcomcity.com (Kerry Neighbour) wrote in <39D9D37A.CD2861A9
@simcomcity.com>:

Quote
>I am a bit confused on my reading of RFC 821 (not unusual, I guess). I
>writing a relay program that reads in a POP3 message, then sends it on
>again to an SMTP server.

Since we saw the copy of this on the Indy 8.100 list, we've followed it up
there.

--
Chad Z. Hower (Kudzu) - Church Hill, TN - Team Indy
      "Programming is an art form that fights back"
Forget the Y2K problem, Lets fix the W2K problem.
http://www.pbe.com/Kudzu/ - Free Delphi/CBuilder components and articles

Re:SMTP 'RCPT TO' difficulty


Quote
> >I am a bit confused on my reading of RFC 821 (not unusual, I guess). I
> >writing a relay program that reads in a POP3 message, then sends it on
> >again to an SMTP server.

> Since we saw the copy of this on the Indy 8.100 list, we've followed it up
> there.

Yes Hadi and I are discussing the matter. But since it is not
particularly an Indy issue, I thought I would see if anyone else had any
information on this.

Other Threads