Link to home
Start Free TrialLog in
Avatar of Razzie_
Razzie_

asked on

SMTP: RCPT TO: always empty, instead DATA TO: ?

Hey guys,

While programming an application using SMTP, I found this very confusing thing.

Every article, manual, document, you name it, covering SMTP tells me that recipients are added using the RCPT TO: <address@domain.tld> command. However, when I manually send an email using telnet, when I look in my mail root directory (eg. inetpub/mailroot/queue), the email I just sent always lists the 'To:' field as empty, for example when I load the email in Outlook.

After much messing around with it and asking a friend of mine, it seems that the only way to get the 'To:' field to contain addresses, is by setting it in the DATA field. For example:

EHLO
MAIL FROM: me@mydomain.net
RCPT TO: you@yourdomain.net
DATA
Test email
.

If I load this email in Outlook (or edit in a texteditor) it clearly shows that the mail is from me@mydomain.net, with no subject, body 'Test email', but no recipient! However if I do this:

EHLO
MAIL FROM: me@mydomain.net
RCPT TO: you@yourdomain.net
DATA
TO: you@yourotherdomain.net
Test email 2
.

it will show the email to come from me@mydomain.net, no subject, body 'Test email 2' but with recipient you@yourotherdomain.net?!

This confuses me, especially since I can't seem to find an article covering this. Also, what is the point of the RCPT TO: field when somehow it won't accept this for me? Oh and I tried this on 2 different SMTP servers, using remote connections or local connections, so I don't think there can be the problem.

I hope someone can explain this to me! Thanks!

Razzie
ASKER CERTIFIED SOLUTION
Avatar of PsiCop
PsiCop
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Whoops. That was my site.Config.m4 I gave you a link to above. Here is my annotated sendmail.mc

https://www.experts-exchange.com/questions/21116293/Relay-mail-to-specific-addresses-ONLY-from-a-specific-domain.html
Fudge. Wrong Question. Ignore my last Comment.
Avatar of Razzie_
Razzie_

ASKER

Ok thanks PsiCop!
Avatar of Razzie_

ASKER

Btw, it's strange that all articles I read about SMTP do not cover this, I wonder why....
I dunno. I'll Ask Mr. Protocol if he can look into it.