From Harvey.West at bskyb.com Thu Nov 29 14:03:15 2007 From: Harvey.West at bskyb.com (West, Harvey) Date: Thu, 29 Nov 2007 13:03:15 -0000 Subject: [Email-SIG] Certain charaters in the body stop mail from arriving. Why? Message-ID: <1CB3316B4E8AC044BEA28649F3916FF70174E5F5@OSTEXCH03.bskyb.com> Hello Sending mail with certain characters in the body causes mail never to arrive. Why? e.g if body text has a fullstop "." mail never arrives. I'm using python 4.2 on windows. Harv import smtplib from email.MIMEText import MIMEText def mail(serverURL=None, sender='', to='', subject='', text=''): COMMASPACE = ', ' to = COMMASPACE.join(to) msg = MIMEText(text) msg['Subject'] = subject msg['From'] = sender msg['To'] = to mailServer = smtplib.SMTP(serverURL, 25) mailServer.sendmail(sender, to, msg.as_string()) mailServer.quit() print msg.as_string() Output ---- Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: "Information from ost-cs-emma" From: test at bskybb.com To: test at bskybb.com Some text Some more text in body ________________________________________________________________________ ___________ Harvey West | Technical support - BSkyB Sky Creative | ph 020 7805 8591 | http://www.sky.com ----------------------------------------- Information in this email including any attachments may be privileged, confidential and is intended exclusively for the addressee. The views expressed may not be official policy, but the personal views of the originator. If you have received it in error, please notify the sender by return e-mail and delete it from your system. You should not reproduce, distribute, store, retransmit, use or disclose its contents to anyone. Please note we reserve the right to monitor all e-mail communication through our internal and external networks. SKY and the SKY marks are trade marks of British Sky Broadcasting Group plc and are used under licence. British Sky Broadcasting Limited (Registration No. 2906991), Sky Interactive Limited (Registration No. 3554332), Sky-In-Home Service Limited (Registration No. 2067075) and Sky Subscribers Services Limited (Registration No. 2340150) are direct or indirect subsidiaries of British Sky Broadcasting Group plc (Registration No. 2247735). All of the companies mentioned in this paragraph are incorporated in England and Wales and share the same registered office at Grant Way, Isleworth, Middlesex TW7 5QD. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/email-sig/attachments/20071129/02d209f3/attachment.htm From mark at msapiro.net Thu Nov 29 16:46:15 2007 From: mark at msapiro.net (Mark Sapiro) Date: Thu, 29 Nov 2007 07:46:15 -0800 Subject: [Email-SIG] Certain charaters in the body stop mail from arriving. Why? In-Reply-To: <1CB3316B4E8AC044BEA28649F3916FF70174E5F5@OSTEXCH03.bskyb.com> References: <1CB3316B4E8AC044BEA28649F3916FF70174E5F5@OSTEXCH03.bskyb.com> Message-ID: <474EDEC7.80207@msapiro.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 West, Harvey wrote: > > Sending mail with certain characters in the body causes mail never to > arrive. Why? > e.g if body text has a fullstop "." mail never arrives. > > I'm using python 4.2 on windows. WFM - Python 2.4.2 - Windows XP mailit.py-------------------------------------------------------------- import smtplib from email.MIMEText import MIMEText def mail(serverURL=None, sender='', to='', subject='', text=''): COMMASPACE = ', ' to = COMMASPACE.join(to) msg = MIMEText(text) msg['Subject'] = subject msg['From'] = sender msg['To'] = to mailServer = smtplib.SMTP(serverURL, 25) mailServer.sendmail(sender, to, msg.as_string()) mailServer.quit() print msg.as_string() sender = 'msapiro at msapiro.net' to = ['msapiro at value.net'] subject = 'Test Message' text = """This is the message body. It contains full stop. And other punctuation,/'- and some more text. """ server = 'localhost' mail(server, sender, to, subject, text) - ---------------------------------------------------------------------- Test------------------------------------------------------------------ C:\Documents and Settings\Owner\Desktop>python mailit.py Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Test Message From: msapiro at msapiro.net To: msapiro at value.net This is the message body. It contains full stop. And other punctuation,/'- and some more text. C:\Documents and Settings\Owner\Desktop> - ------------------------------------------------------------------------ Received mail----------------------------------------------------------- Received: from localhost ([127.0.0.1] helo=[192.168.0.4]) by msapiro.net with esmtp (Exim 4.62) (envelope-from ) id JS9XHD-0001A4-MX for msapiro at value.net; Thu, 29 Nov 2007 07:24:49 -0800 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Test Message From: msapiro at msapiro.net To: msapiro at value.net Message-Id: <20071129082455.SM02600 at psmtp.com> Date: Thu, 29 Nov 2007 08:24:51 -0700 X-GPC-MailScanner: Found to be clean X-GPC-MailScanner-From: msapiro at msapiro.net X-Spam-Status: No This is the message body. It contains full stop. And other punctuation,/'- and some more text. - ------------------------------------------------------------------------ - -- Mark Sapiro The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFHTt7HVVuXXpU7hpMRAgNXAJ44SAQmMm3usiPbI7+cvMrkrZDgoACg+E3D 8NQ8cLkVDsx9dPiSdp81rf4= =ThwX -----END PGP SIGNATURE-----