Regarding Mail sending smtplib Module

Sion Arrowsmith siona at chiark.greenend.org.uk
Wed May 11 10:53:31 EDT 2005


praba kar  <prabapython at yahoo.co.in> wrote:
>Here I want to avoid this line "Received: from unknown
>(HELO prabahar.enmail.com)     (59.92.13.47)  by
>mailserver with SMTP; 11 May 2005 10:09:11 -0000 " How
>can I do this? . Why python give this line? . Mail
>sending Module in php will not give this type line.

To quote http://docs.python.org/lib/SMTP-objects.html :
"The SMTP[sic] does not modify the message headers in any way."
The Received: header is being added by your SMTP server. Goodness
knows how PHP avoids it -- direct use of sendmail maybe?

>Here I have another doubt Php mail sending module give
>MessageId automatically
>but python doesn't set that. why?

Because "The SMTP[sic] does not modify the message headers in
any way." Or, to look at it another way, there are obvious
advantages to having message ids created by the client app
rather than the library. (OTOH, the library author is more
likely to write better id-producing code than the average
client app author, but IMHO this is outweighed by the greater
utility of having the app do it and the consistency of not
having SMTP touch the headers.) If PHP mail adds a message id,
that would be consistent with it using sendmail rather than
talking directly to the SMTP server.

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list