[Avcheck] (un)quoted addresses again

Michael Tokarev mjt@tls.msk.ru
Wed, 07 Nov 2001 19:28:31 +0300


I discovered yet another variant of the same issue with
"special" address forms that needs to be quoted.  It
seems that we need to perform another iteration around
this, but I'm afraid I can't preserve compatibility
here (well, it can be preserved by adding an ugly workaround).

The problem comes from an older defect in postfix (now corrected).
Postfix's pipe(8) agent used to spawn avcheck was not able
to quote sender/recipient addresses into a form sutable for
postfix's sendmail command or for SMTP protocol.  Pipe agent
was only able to use "raw", or unquoted form of an address.
In avcheck I implemented a workaround for this, -- avcheck
was made to check and unconditionally quote non-rfc822 addresses.
Example is when local part contains space(s), double quotes or
backslashes -- proper quoted form is e.g. "Michael Tokarev"@corpit.ru,
but postfix used the same without quotes.

Now, avcheck is not able to work with other software such as
Sendmail, where all addresses are quoted first (well, in
Sendmail one can turn this quoting off but that's not the
default).  Even worse, when `infected' script will reinject
a mail using some other non-avcheck method, and the original
addresses was in raw form, it will unable to send a message
properly.  This last case can only happen when avcheck finds
an infected message destined to or sent from an address that
needs to be quoted and e.g. /usr/sbin/sendmail used for message
reinjection.

The proper way to work around this issue is to stop avcheck
from quoting all addresses and require an MTA to quote them
(flags=q for postfix's pipe(8) agent).  But in this case
compatibility will be broken (existing installations will
need to use new flags), and even infected handler may
need correction(s) in some very rare cases (I don't think
this will affect someone).

I plan to release new avcheck version without quoting code
(some little cleanups).  Objections, someone?
The only real change will be required is to add 'flags=q'
parameter into postfix's pipe(8) command line in master.cf
for postfix users.

Regards,
 Michael.