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.


Jun 22 08:25:14 mx-a postfix/smtpd[15460]: warning: Illegal address syntax from[] in RCPT command: <"Brian (">


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

cat > /etc/postfix/command_filter.regex <<EOF

# Fix Illegal address syntax, malformed emails that are surrounded in single quotes
/^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/ RCPT TO:<\$1>\$2


Add the following to your /etc/postfix/

# Fix for Illegal address syntax
smtpd_command_filter = pcre:/etc/postfix/command_filter.regex

Reload your postfix

service postfix reload


You may also like...