On Friday 03 October 2003 10:35, Michelle Konzack wrote:
The problem is, that my Dial-Out Box and courier-mta are two different
machines in my Network...
I have two Dial-Out-Boxes: one is a CISCO-Router and the other is a
Linux-Box.
To get your suggestion working, I can not use Dial-In-On-Demand...
Thats realy bad.
Sorry, I missed that part. I thought we were talking about the same machine.
So you want all the mail to sit there until your cron job triggers courier to
send it and which time your demand dialing will kick in and mail will get
sent out?
I think you're going to have to resort to a script hack to make that work with
courier. Anand's idea of changing the MAXDELS variable, restarting courier
and then flushing the queue would work. In that case nothing would get sent
until you ran the script. Then you'd have to reset the variable to 0 when
you were done sending.
I think I would use an iptables rule to stop courier sending out until the I
wanted it to. So something like this:
======================================
#!/bin/sh
/sbin/iptables -D OUTPUT -p tcp -m tcp -o eth0 --dport 25 -j REJECT
/usr/lib/courier/sbin/courier flush
while (`sleep 60`); do
PS=`/bin/ps -axww | egrep -c "courieresmtp [0123456789]" `
if [ $PS == 0 ]; then
break
fi
done
/sbin/iptables -I OUTPUT -p tcp -m tcp -o eth0 --dport 25 -j REJECT
======================================
(You'll have to put in your own network interface if it's not eth0.)
This will delete the iptables rule which blocks outbound smtp, run courier
flush, then watch the processes until there are no more courieresmtp
processes sending, and then reinstate the rule to block outbound smtp.
But you're right. There's no configurable way in courier to not send any mail
but then easily flush the queue.