smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

Chris Angelico rosuav at gmail.com
Wed Dec 17 17:00:50 EST 2014


On Thu, Dec 18, 2014 at 7:59 AM, Michael Ströder <michael at stroeder.com> wrote:
> You should really think about why these chars were excluded in the
> configuration: The reason is that those they are special in shells.
>
> And many SMTP deployments have pretty naive (shell) scripts or software with
> shell exits. So allowing those chars can cause more or less big security
> risks. For this reason it's likely that you will end in spam filters / black
> lists etc. because systems may assume you want to do some harm.
>
> So I would really rethink the requirements.
>
> Your mileage may vary. But you have been warned.

It's worth noting that the SMTP spec never says that every server must
accept all characters. I could create a perfectly compliant mail
server in which recipient names may not include the letter 'e', for
instance. It would be a bug if smtplib rejected those, but since the
rejection is coming from the server, that's fairly legit.

ChrisA



More information about the Python-list mailing list