View previous topic :: View next topic |
Author |
Message |
scubed Tux's lil' helper
Joined: 06 Jun 2003 Posts: 122
|
Posted: Fri Dec 31, 2010 8:29 pm Post subject: [SOLVED] Postfix: Send /var/mail back to mail queue |
|
|
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 |
|
|
scubed Tux's lil' helper
Joined: 06 Jun 2003 Posts: 122
|
Posted: Fri Dec 31, 2010 9:50 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|