HOWTO resend messages from dead.letter with sendmail

Some days ago I had to challenge a 350MB dead.letter file. The problem was, howto resend all the messages from dead.letter file. I discovered a good solution on lists.freebsd.org.

One solution is to install the procmail port (ports: mail/procmail) which contains a stunningly useful utility called formail(1). Amongst formail’s many talents is the ability to split up a mbox format mailbox into individual messages and pipe each into a program.

So in order to resend all of the messages in your dead.letter you could try:

    $ formail -s /usr/sbin/sendmail -v -t -oiee < dead.letter

Or to split up the dead.letter mailbox into individual numbered messages:

    $ formail -s /bin/sh -c 'cat > msg.$FILENO' < dead.letter

and you can pipe each message into sendmail as above to re-send it:

    $ /usr/sbin/sendmail -v -t -oiee < msg.999

Schreib einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *