Mailing Lists:
> I have accidentally learned that a postfix server has accepted and
> attempted to deliver an email with the envelope sender containing 8 bit
> ascii codes (it looks like this T\?\?m...@domain.tld - that's a backslash and
> then ascii extended code 177). the imap backend - an old cyrus lmtp service
> - has refused the delivery.

That looks like UTF-8 text. Postfix 3.0 supports SMTPUTF8 by default
(smtputf8_enable = yes) which allows UTF-8 in header values and
email addresses.

> what rfc defines this? I am trying to 1) understand if postfix in cause
> (2.9.6 on debian wheezy) did the right thing to accept that email and 2)
> how to refuse such emails until I can upgrade the cyrus backend to permit
> such sender addresses.

Postfix before 3.0 by default permits non-ASCII content in headers
and addresses.  With Postfix before 3.0 you can disallow non-ASCII
header values by setting "strict_7bit_headers = yes". There is no
built-in equivalent to block non-ASCII email addresses. You'd have
to use a regexp:

Untested code:

/etc/postfix/main.cf:
    smtpd_sender_restrictions =
        check_sender_access regexp:/etc/postfix/isprint.regexp

/etc/postfix/isprint.regexp:
    /^[[:print:]]+$/  OK
    /./  REJECT 5.7.1 Non-ASCII or non-printable address

(this assumes that import_environment contains among others LANG=C
which is the default).

        Wietse

> Note that I am only _guessing_ that the original message was sent using
> rfc822 format, as I can't find original nowhere in the queues; by looking
> at the bounce sitting in the queue (it was probably a spam) and seeing this
> header: X-Postfix-Sender: rfc822; "T\?\?..."@domain.tld

Reply via email to