Debian – Postfix – Bad recipient address syntax – email starting with dash/hyphen

debianemailpostfix

I am trying to send an email to a recipient with an email address starting with a hyphen/dash, e.g. -localpart@example.com

The recipient claims the mail address is correct.

mail.log shows:

postfix/smtpd[26055]: warning: Illegal address syntax from ...[...] in RCPT command: <-localpart@example.com>

I am using Postfix 2.11.3

Any idea how I can send emails to such an address?

Best Answer

You can configure Postfix to accept such addresses with option allow_min_user = yes.

The postconf documentation also explains why the default is to reject such addresses:

Allow a sender or recipient address to have `-' as the first character. By default, this is not allowed, to avoid accidents with software that passes email addresses via the command line. Such software would not be able to distinguish a malicious address from a bona fide command-line option. Although this can be prevented by inserting a "--" option terminator into the command line, this is difficult to enforce consistently and globally.

As of Postfix version 2.5, this feature is implemented by trivial-rewrite(8). With earlier versions this feature was implemented by qmgr(8) and was limited to recipient addresses only.

Related Topic