On Friday, December 8 at 09:17 AM, quoth Olivier Mueller:
For cpu load reason, I'd like to generate some special mails during
the night, but send them "outside" only during the day. Is there a
way to stop remote delivery for some time, while having the other
qmail functions up & running (smtpd & local delivery) ? (dedicated
server).
Yes, but chances are it's more of a pain than it's worth. I'd be
surprised, though, if remote email delivery would use more than 1% of
CPU power.
Otherwise what seems to work is to simply stop qmail completely
(lwq's qmailctl stop), and then send mails via the php mail()
function. Qmail is stopped, but the mails seems to be stored
correctely in the todo/ part of the queue, and are delivered when
qmail is started again. I don't know if it's the "good way" to do
it, but at least it seems to work... any comment? :-)
Yup, that's a perfectly legitimate method. Now, qmailctl stop also
stops the smtpd server, which you may not want. Doing:
svc -d /service/qmail-send
... is sufficient to stop all delivery without stopping all accepting.
Probably the easiest way to stop remote delivery while still allowing
local delivery is to simply set concurrencyremote to 0 and then
restart qmail-send. That will put remote deliveries on hold until you
set concurrencyremote to something else (remove the file for the
default) and restart qmail-send again.
Other way I'm thinking about: create my own mail queue (simply a
directory, with one file per mail), and qmail-inject them when
ready...
That works too.
~Kyle
--
You can not establish sound security, on borrowed money. You can not
keep out of trouble, by spending more than you earn.
-- Abraham Lincoln
pgpVn0HnUDzcp.pgp
Description: PGP signature
|