Sven Bartscher:
Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
> Greetings,
>
> recently I stumbled across a log line like this:
>
> Oct 25 10:34:59 hostname postfix/smtpd[12345]: NOQUEUE: reject: RCPT
> from client.example[1.2.3.4]: 554 5.7.1 <[email protected]; [email protected]>: Relay access
> denied; from=<[email protected]> to=<[email protected]; [email protected]> proto=ESMTP
> helo=<client.example>
>
> The important part is the "to=<[email protected]; [email protected]>". Parsing this to find
> out which part is the local-part and which is the domain isn't exactly
> trivial, both for me as a human or for a machine automatically parsing
> the log. As it turns out, the original address was "[email protected]; c"@d.com,
> but it could have been "[email protected]; [email protected]" (i.e. local-part only, without
> a domain) just as well. There is no way to know for sure from the log alone.
Agreed. One would have to know that Postfix logs the 'internal'
form.
Why does Postfix use the internal form(*)? Because there can be
multiple original forms for the same address, for example using
quotes or backslashes. And having multiple forms for the same thing
is bad if one wants to implement, for example, SMTP access policies.
Why does Postfix not log the original form in addition to the
internal form? That would require code changes to everything code
that logs an envelope sender or recipient. It would have to log
both the original form and the form that Postfix uses for table
lookup, otherwise table lookups would be difficult to debug.
I would just configure Postfix to reject the garbage instead of
doing a lot of work to log the garbage unambiguously.
Wietse
(*) As an aside, Postfix is in a transition from using internal
address forms in lookup tables to using external forms, so that the
tables can handle addresses with whitespace. But it still uses the
unquoted form internally, instead of the original form, to avoid
ambiguity due to quotes or backslashes.