Postfix : BUG FIX : warning: Illegal address syntax ( Fix malformed emails )

Basically the sending email client is outlook and the existing contact email address in the address book contains an apostrophe this can cause the emails address to become invalid.


postfix 2.7 or later


Fix malformed emails that are surrounded in single quotes.



Run the following to create the /etc/postfix/command_filter.regex file

Add the following to your /etc/postfix/

Reload your postfix


2 replies
  1. Gonzalo
    Gonzalo says:

    Hi, good post, thanks a lot

    If you want to remove just single quotes, on an error like this one:

    warning: Illegal address syntax from xxx in RCPT command: <‘’>

    what is the right regex?

    Thanks again


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *