Re: [ILUG] Postfix questions

From: Philip Reynolds (phil at domain redbrick.dcu.ie)
Date: Wed 09 May 2001 - 16:56:00 IST


Niall O Broin's [niall at domain linux.ie] 52 lines of wisdom included:
:>I like postfix and I use it on a couple of Internet connected boxes - in
:>fact, it'd take wild horses (or lots of money :-) ) to presuade me to use
:>sendmail again. However, I've still been using sendmail on my home box,
:>because I didn't know what to do with postfix. Anyway, I finally decided it
:>was time to eat my own dogfood and use postfix at home. Been there, done
:>that, works fine (apart from SuSE's magic startup system deciding to rewrite
:>the config file - stop laughing, Bedford !) but I've a couple of questions:
:>
:>1) I occasionally write something and change my mind and want to delete it
:>from the queue. Under sendmail, I simply
:>
:>cd /var/spool/mqueue
:>rm [dq]fXXXXXX
:>
:>where XXXXXX was the queue ID. How do I do the same thing under postfix ? Is
:>it ok simply to do
:>
:>rm `find /var/spool/postfix/defer* -type f -name XXXXXX`

New versions of postfix have the postsuper command.
Queue Id: ABCXYZ

postsuper -d ABCXYZ

that deletes the mail with queueid of ABCXYZ

postsuper -d -

also reads in from stdin, so that
postsuper -d - < filename
will read in the Id's from filename.

:>2) I have a little script I run to manually send and receive my mail -
:>essentially all it does is
:>
:>fetchmail -a
:>echo "Sending mail now . . . "
:>sendmail -q
:>
:>which was fine with sendmail, and also works with postfix BUT (isn't there
:>always a but ?) this script does a little more - if I'm not connected to the
:>net, it initiates a connection, waits until it can see the net, processes
:>the mail as above, and then shuts down the connection. This behaviour was
:>fine under sendmail, but sendmail -q with postfix is asynchronous - it just
:>kicks the qmgr daemon, from under whose feet I then proceed to kick the
:>net connection :-(. Can anyone suggest a nice way of dealing with that ? My
:>immediate thought is something like
:>
:>while [ "$(mailq)" != "Mail queue is empty" ] ;
:>do
:> sleep 1
:>done

---------------
#!/bin/sh

# Start deliveries.
/usr/sbin/sendmail -q

# Allow deliveries to start.
sleep 10

# Loop until all messages have been tried at least once.
while mailq | grep '^[^ ]*\*' >/dev/null
do
        sleep 10
done

----------------

Surely you can stick "sendmail -q" in your internet/dialup scripts?
Apart from that,
defer_transports = smtp
should be defined in main.cf

Phil.



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:10:15 GMT