Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Postfix: Send /var/mail back to mail queue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
scubed
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2003
Posts: 122

PostPosted: Fri Dec 31, 2010 8:29 pm    Post subject: [SOLVED] Postfix: Send /var/mail back to mail queue Reply with quote

There was an NFS hiccup causing my .forward file
to be temporarily missing. In that time, I got a bunch
of e-mail. The machine is running postfix.
The "mail" command shows the accumulated e-mail.
I have restored my ~/.forward (dot forward) file
and tested that it works.
So, now I want all of the e-mail in /var/mail/$USER
to be returned to the mail queue as shown by "mailq"
so it can be delivered to my real e-mail address.

Is there an easy way to do that?


Last edited by scubed on Fri Dec 31, 2010 9:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
scubed
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2003
Posts: 122

PostPosted: Fri Dec 31, 2010 9:50 pm    Post subject: Reply with quote

I just ended up doing something like this:

Code:
(for ((i=1;i<$NUMMSG;i++)); { echo "| $i sendmail $DESTADDR"; }; echo "x") | mail


So, it just put the messages back. Note that I used the DESTADDR
from my .forward file, not $USER, because that just triggers
a forward-loop detection mechanism, since the e-mail was
already sent to me.
Also note that I use sendmail instead of mail since plain mail
doesn't let you set headers directly.

The "x" at the end is to keep mail from moving any of the messages around
until I confirmed that they were forwarded properly.
(Fortunately, they were.)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum