Solved

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

Posted on 2004-09-06
6
1,761 Views
Last Modified: 2008-02-26
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
0
Comment
Question by:Razzie_
  • 4
  • 2
6 Comments
 
LVL 34

Accepted Solution

by:
PsiCop earned 100 total points
ID: 11992856
Simply put:

TO: != RCPT TO:

This took me awhile to figger out to.

RCPT TO: is an SMTP command that tells the MTA (Message Transfer Agent) to whom the E-Mail is destined. This is so it can perform lookups, determine if it accepts mail for this Domain and/or user, determine proper routing, etc. etc.

The TO: line in an E-Mail derives from the headers transmitted with the E-Mail itself. That is, your program must *explicitly* transmit a TO: header, during the DATA step, if you want the resultant E-Mail to have a TO: header. RCPT TO: is strictly for the MTA.

This is how things like BCC: are done. The recipients are listed in the RCPT TO: commands during the initial communication with the MTA, but the TO: header is omitted. TO: is mainly for us humans, (and any programs, like ProcMail, that may handle the E-Mail after the MTA has accepted it for delivery).
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 11992908
Whoops. That was my site.Config.m4 I gave you a link to above. Here is my annotated sendmail.mc

http://www.experts-exchange.com/Networking/Email_Groupware/Sendmail/Q_21116293.html
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 11992939
Fudge. Wrong Question. Ignore my last Comment.
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 8

Author Comment

by:Razzie_
ID: 11994610
Ok thanks PsiCop!
0
 
LVL 8

Author Comment

by:Razzie_
ID: 11994613
Btw, it's strange that all articles I read about SMTP do not cover this, I wonder why....
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 11996905
I dunno. I'll Ask Mr. Protocol if he can look into it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Outlook 2010 Rule to forward email doesn't work 7 395
Changing the color of categories on a shared mailbox - Outlook 2010 2 64
Junk folder 23 142
end-to-end encrypted email 16 72
Today, security is a big concern in an organization to prevent sensitive data leakage. In Outlook you can secure your Outlook items (emails, calendars, contacts and other stuff) using various techniques like by marking item as private, or you can pu…
I didn’t use eM Client for long when I decided to swap to Outlook 2016. The reason for the switch is that it started asking for payment to continue some of its services after one month.   The problems I faced when I didn’t pay were:   I was not …
The purpose of this video is to demonstrate how to set up a Mailchimp Template which will let the user create a uniform look for all of their campaigns. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mail…
The purpose of this video is to demonstrate how to set up Lists in Mailchimp. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchimp account. : Click on Lists. Click on Create List Button : Choose the desi…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now