I need to resend messages from dead.letters

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Jan 13 04:18:49 PST 2004


On Tue, Jan 13, 2004 at 09:24:21AM +0000, Jez Hancock wrote:
> On Mon, Jan 12, 2004 at 07:23:20PM -0800, Doug Hardie wrote:
> > There was a problem last night with my mail server and a bunch of mail 
> > went into the dead.letters mailbox rather than being sent.  I have that 
> > mailbox and need a way to send all of those messages.  I split them out 
> > into individual files, but there are just too many to send by hand.  Is 
> > there a way to cause them all to be resent?

> Look at the -f option to the mail command - see the manpage for mail(1)
> for more info.

Hmmm.. I don't think that's quite what the OP wanted.

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

Nb. be careful when doing this sort of thing, or you'll spray e-mails
all over the place and make yourself quite unpopular.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040113/d01fed73/attachment.bin


More information about the freebsd-questions mailing list