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

Michael Ströder michael at stroeder.com
Wed Dec 17 15:59:02 EST 2014


Radomir Wojcik wrote:
> No need to do more troubleshooting, need to update the config. Found that exim default config denies these so nothing to do with smptlib indeed:
> 
> What this statement is doing is to accept unconditionally all recipients in messages that are submitted by SMTP from local processes using the standard input and output (that is, not using TCP/IP). A number of MUAs operate in this manner.
> 
> deny    message       = Restricted characters in address
>         domains       = +local_domains
>         local_parts   = ^[.] : ^.*[@%!/|]
> 
> deny    message       = Restricted characters in address
>         domains       = !+local_domains
>         local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
> These statements are concerned with local parts that contain any of the characters "@", "%", "!", "/", "|", or dots in unusual places. Although these characters are entirely legal in local parts (in the case of "@" and leading dots, only if correctly quoted), they do not commonly occur in Internet mail addresses.
> 
> http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_default_configuration_file.html

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.

Ciao, Michael.




More information about the Python-list mailing list