Re: [Twisted-Python] "local" semantics soughtin twisted.protocols.smtp.sendmail

JP, Glad that I was able to help out. Any guess as to what the original author meant by "local"? By using \n to delimit new lines, isn't that essentially saying the same thing as the oringal author? Perhaps of interest, the way I arrived at this nuance in the documentation is that a project I'm working on requires a node running an SMTP server to receive mail and then parse the contents of each mail message I'm sending with my Twisted application. Each line in the body of a mail message I'm sending contains API key, value pairs that are parsed by software on the node. I originally used the built-in Python smtplib.server.sendmail() method, and in order for it to work with the parsing software on the remote node, I had to end each line with a carriage return and a line feed as in: key=value\r\n key2=value2\r\n However, what I found different is that the node's parsing software didn't like it when I'd send mail as in the above example (with carriage return and line feed) via the Twisted SMTP module equivalent. To remedy this, I just had to remove the carriage returns, so its no big deal. But I am still curious as to why Python's sendmail eats the /r/n and why not with the Twisted equivalent. Perhaps just a silly nit pick but perhaps there is a deeper logical reasoning to this (I.e., could Twisted be making an improvement on the Python smtplib)? Thanks for any further insight. -Serg
_________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

Sergio Trejo wrote:
The original author of the doc strings seems to have been either Andrew Bennetts or Brian Warner. Perhaps one of them can shed some light on the reasoning behind the original phrasing. The wording indicated to me that the platform's native newline convention should be used, e.g., \r\n on Windows, \r on MacOS (pre-X), and \n on POSIX. Twisted's SMTP code only expects and only handles correctly \n. Jp

Sergio Trejo wrote:
The original author of the doc strings seems to have been either Andrew Bennetts or Brian Warner. Perhaps one of them can shed some light on the reasoning behind the original phrasing. The wording indicated to me that the platform's native newline convention should be used, e.g., \r\n on Windows, \r on MacOS (pre-X), and \n on POSIX. Twisted's SMTP code only expects and only handles correctly \n. Jp
participants (2)
-
Jp Calderone
-
Sergio Trejo