Fwd: Re: Fwd: [Mailman-Users] smtplib
This mail might help making Mailman more standards compliant. We all want that, right?
X-From_: mea@nic.funet.fi Wed Jun 2 15:15:26 1999 Subject: Re: Fwd: [Mailman-Users] smtplib From: Matti Aarnio mea@nic.funet.fi To: tomaz.borstnar@over.net (Tomaz Borstnar) Date: Wed, 2 Jun 1999 16:14:20 +0300 (EET DST)
Yes ?
If mailman really does that, then it is as bad as M$ WinCE, which does same incorrect SMTP address productionn, but I don't recall having seen that problem. (a bit of web-browsing -- to locate the Mailman homepages, etc..)
Ok, I pulled in the current Mailman 1.0rc1 source, and found following at it (Mailman/pythonlib/smtplib.py):
def mail(self,sender,options=[]): """SMTP 'mail' command -- begins mail xfer session.""" optionlist = '' if options and self.does_esmtp: optionlist = string.join(options, ' ') self.putcmd("mail", "FROM:%s %s" % (quoteaddr(sender) ,optionlist)) return self.getreply() def rcpt(self,recip,options=[]): """SMTP 'rcpt' command -- indicates 1 recipient for this mail.""" optionlist = '' if options and self.does_esmtp: optionlist = ' ' + string.join(options, ' ') self.putcmd("rcpt","TO:%s%s" % (quoteaddr(recip),optionlist)) return self.getreply()
Ok, the problem can be at how the quoteaddr() works, does it *always* yield addresses *with* "<...>" around them, or can it sometimes yield those without the wrappers ?
I would suggest it to always yield the target address *without* the "<..>" angle brackets, and then always to print those explicitely. That way there won't be some mystic cases where failures happen.
Another problem I have seen reports about are due to putcmd() function misbehaviour (belief that "all the world is Sendmail"):
def putcmd(self, cmd, args=""): """Send a command to the server.""" str = '%s %s%s' % (cmd, args, CRLF) self.send(str)
That FORCES extra space in case the 'args' does not exist for some command (e.g. "DATA"). It should not.
The more I read the mailman documents, the more I am convinced that its coders use 'sendmail' as standard for how the RFC-821 can be ignored/abused. You really should have somebody running e.g. ZMailer in 'strict' mode, which will quickly weed out any protocol non-compliance.
OTOH: For ZMailer there are also better ways to submit a message, than doing it thru SMTP port. Methods that are way faster, and easily codable in Python (I have a sample in PERL, and in C, of course.)
/Matti Aarnio matti.aarnio@sonera.fi
X-From_: mailman-users-admin@python.org Tue Jun 1 19:08:56 1999 Date: Tue, 1 Jun 1999 12:13:26 -0400 (EDT) From: Dave Sill ds-list-mailman@sws5.ctd.ornl.gov To: mailman-users@python.org Subject: [Mailman-Users] smtplib X-Mailer: VM 6.71 under 21.1 "20 Minutes to Nikko" XEmacs Lucid (patch 2) Organization: Oak Ridge National Lab, Oak Ridge, Tenn., USA X-Face: "p~Q]mg{;e*}YR|)&Q/&Q\*~5UWfZX34;5M
X-BeenThere: mailman-users@python.org It looks like Mailman does:
MAIL FROM:mailman-owner@sws1.ctd.ornl.gov
instead of:
MAIL FROM:<mailman-owner@sws1.ctd.ornl.gov>
I wonder what other SMTP corners were cut.
-Dave
Mailman-Users maillist - Mailman-Users@python.org http://www.python.org/mailman/listinfo/mailman-users
Tomaz Borstnar tomaz.borstnar@over.net "Love is the answer to the final question you ask" - Unknown
Tomaz Borstnar tomaz.borstnar@over.net "Love is the answer to the final question you ask" - Unknown
On Wed, 2 Jun 1999, Tomaz Borstnar wrote:
Ok, the problem can be at how the quoteaddr() works, does it *always* yield addresses *with* "<...>" around them, or can it sometimes yield those without the wrappers ?
it will yield a bare address with the <>'s added unless the
address cannot be parsed. It will pass the address verbatim _IF_ and _ONLY_ if rfc822.parseaddr() cannot parse it. this is the proper behavior, IMHO, as if the address cannot be parsed, it is probably syntacticly invalid, and thus the SMTP server will complain anyway. If rfc822.parseaddr() is cronking on a syntacticly valid address, the rfc822 module needs to be fixed.
I would suggest it to always yield the target address *without* the "<..>" angle brackets, and then always to print those explicitely. That way there won't be some mystic cases where failures happen.
Creating a syntactically valid path according to rfc821 is that
function's purpose is. According to the RFC the path includes the <>'s if the addressis bogus to begin with, then failure is the 'correcxt' thing to happen, because it means that something is pasing in mangled address, or that someone needs to submit a bug report on the rfc822 module.
Another problem I have seen reports about are due to putcmd() function misbehaviour (belief that "all the world is Sendmail"):
No, this is a bug. It will be fixed.
def putcmd(self, cmd, args=""): """Send a command to the server.""" str = '%s %s%s' % (cmd, args, CRLF) self.send(str)
That FORCES extra space in case the 'args' does not exist for some command (e.g. "DATA"). It should not.
OTOH: For ZMailer there are also better ways to submit a message, than doing it thru SMTP port. Methods that are way faster, and easily codable in Python (I have a sample in PERL, and in C, of course.)
True, but SMTP is the most portable way.
-The Dragon De Monsyne
participants (2)
-
The Dragon De Monsyne
-
Tomaz Borstnar