Answer: Find the qmail-send process and give it a HUP signal. Alternatively, if qmail is supervised:
svc -h /service/qmail
You can instead restart qmail. qmail-send will read the new files when it starts up.
Answer: Find the qmail-send process and give it a TERM signal. It will shut down cleanly after current deliveries stop. Wait for ``exiting'' to show up in the log. To restart qmail, run /var/qmail/rc the same way it is run from your system boot scripts, with the proper PATH, resource limits, etc.
Alternatively, if qmail is supervised:
svc -t /service/qmailThe supervise process will kill qmail, wait for it to stop, and restart it. Use -d instead of -t if you don't want qmail to restart automatically; to restart it, use -u.
Answer: Find the qmail-send process and give it an ALRM signal. Alternatively, if qmail is supervised:
svc -a /service/qmailYou may want to run qmail-tcpok first, to guarantee that qmail-remote will try all addresses. Normally, if an address fails repeatedly, qmail-remote leaves it alone for an hour.
Answer: Install daemontools version 0.60 or above. Make sure that supervise is in the system startup PATH. Create a /service/qmail directory:
mkdir /service/qmail ln -s /var/qmail/rc /service/qmail/runChange
/var/qmail/rcto
supervise /service/qmailin your boot scripts. Now you can use svc to stop or restart qmail, and svstat to check whether qmail is running.
Answer: Install daemontools 0.60 or above. Make a /var/log/qmail directory, owned by qmaill, mode 2700. Replace
splogger qmailin /var/qmail/rc with
multilog t /var/log/qmailMake sure that multilog is in the system startup PATH.
By default, multilog keeps 10 automatically rotated log files, each containing up to 100KB of log data. To keep 20 files with 1MB each, use multilog t s1000000 n20 /var/log/qmail.
If you are logging tcpserver connections, make a /var/log/smtpd directory, and use multilog /var/log/smtpd for tcpserver. Don't run two simultaneous multilog processes with the same log directory.
Answer: Simply touch /var/qmail/queue/info/15/26902.
This is the only form of queue modification that is safe while qmail is running.
Answer: Set QUEUE_EXTRA to "Tlog\0" and QUEUE_EXTRALEN to 5 in extra.h. Recompile qmail. Put ./msg-log into ~alias/.qmail-log.
You can also use QUEUE_EXTRA to, e.g., record the Message-ID of every message: run
| awk '/^$/ { exit } /^[mM][eE][sS][sS][aA][gG][eE]-/ { print }'from ~alias/.qmail-log.