Mailing List Archive

Questions about bounce messages and qmail-queue
Are bounce messages inserted into the queue via qmail-queue, or are they added some other way? If qmail-queue is used, and the QMAILQUEUE patch is installed, does the bounce process use the qmail-queue program specified by QMAILQUEUE, or is it hardcoded to use qmail-queue?

My reason for asking:

I am using a qmail-queue replacement to sign outbound messages with DKIM. Most of the outbound mail from my server is either from ezmlm, or from mail clients submitting through SMTP. I am successfully signing those messages by using QMAILQUEUE in the ezmlm .qmail files and the smptd script. But bounce messages are not being signed, and I would like to sign them. (Actually, I would prefer not to send bounce messages at all, but the ezmlm architecture uses bounces to send error messages).

I have tried setting the QMAILQUEUE environment variable in the qmail/rc script that starts qmail, but apparently either that is not getting passed to whatever process generates bounces, or it is being ignored. If possible, I would like bounces to be processed through a replacement program that signs them and passes them to the "real" qmail-queue, just like all other outbound messages.

I know I have a couple of other alternatives if I can't make this work. One alternative would be to sign the messages in a qmail-remote wrapper instead of qmail-queue. But since I've gotten the qmail-queue signing process working, I'm reluctant to re-engineer the process. Another possibility would be to rename qmail-queue to something else, and replace qmail-queue with the signing program which would then call the actual qmail-queue via its new name. But that will only work if the bounce messages are being sent through qmail-queue with the program name hard-coded.

--
Matt Simpson
Tatertown, KY
Re: Questions about bounce messages and qmail-queue [ In reply to ]
On Tue, Mar 19, 2013 at 10:41 PM, Matt Simpson <qmlist@news.jmatt.net>wrote:

> Are bounce messages inserted into the queue via qmail-queue, or are they
> added some other way? If qmail-queue is used, and the QMAILQUEUE patch is
> installed, does the bounce process use the qmail-queue program specified by
> QMAILQUEUE, or is it hardcoded to use qmail-queue?
>
>
The QMAILQUEUE patch is applied to the function qmail_open() in qmail.c.
qmail_open() is called in qmail-send.c. So if QMAILQUEUE environment
variable is available to qmail-send, it should work. I am not sure how your
rc script looks like. Is it setting the QMAILQUEUE variable for the
qmail-start process also?


--
Regards Manvendra - http://www.indimail.org
Re: Questions about bounce messages and qmail-queue [ In reply to ]
On Mar 19, 2013, at 2:22 PM, Manvendra Bhangui <mbhangui@gmail.com> wrote:

> So if QMAILQUEUE environment
> variable is available to qmail-send, it should work. I am not sure how your
> rc script looks like. Is it setting the QMAILQUEUE variable for the
> qmail-start process also?

Here's the start script:

case "$1" in
start)
exec 2>&1
exec env - PATH="/var/qmail/bin:$PATH" \
QMAILQUEUE="/var/qmail/bin/dkimsign" \
qmail-start `cat /var/qmail/control/defaultdelivery`
exit 0
;;
stop)
exec killall qmail-send
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac

--
Matt Simpson
Tatertown, KY
Re: Questions about bounce messages and qmail-queue [ In reply to ]
I think I figured out my problem. The dkimsign wrapper that signs the message uses the return address from the message envelope, not the From: header in the message body. And, on a bounce message, the return address is empty. It's possible that my script is actually getting called, but it has no address to use for the signature.

--
Matt Simpson
Tatertown, KY