I use qmail-qfilter to deliver spam-filtered mail, like this:
#!/bin/bash
exec /var/qmail/bin/qmail-qfilter \
/opt/csw/bin/spamc -- \
/var/qmail/bin/new-inject -n
I would like to give the "-u USERNAME" parameter to spamc so it can
use per-user configurations, but that information is not in the
environment (I checked with `env`) and the script above is run by user
qmaild. When qmail-local is called the information is in the
environment, but it's too late then. I need to know the way to obtain
the recipient username or e-mail address for spamc in the above chain,
please. Just the RCPT destination address given to qmail-smtpd would
be fine.
I considered some trickery with tee and Perl, but I would like to
avoid that for simplicity.
Thank you
Ted