LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to deliver/forward a /var/spool/mail/user file (https://www.linuxquestions.org/questions/linux-server-73/how-to-deliver-forward-a-var-spool-mail-user-file-645744/)

digitaljunkie 05-29-2008 11:18 PM

How to deliver/forward a /var/spool/mail/user file
 
Hi all,

Okay, I will just ask the question first, then explain the background after.

How do I send each email message in a /var/spool/mail/username file to a specific email address?

I host web sites and email for companies. Obviously, sometimes companies switch hosting providers. When all the DNS changes have propagated, the users are getting their email from the new hosting provider. But, many times, users ask about email which landed on my server.

So, I would like to write a script (Perl, CSH, Bash, whatever) which parses the mailfile, and individually resend each message to the user.

Obviously, I would need to make sure my servers DNS server, and my local sendmail configuration knows it is no longer answering for the domain name.

I have tried writing macros/scripts using mailx and mutt, to no avail.

Any input would be helpful.

Thank you,
Steve

unSpawn 05-31-2008 08:16 AM

Have you looked at procmail?

digitaljunkie 06-01-2008 02:47 PM

Didn't really consider it. I thought it was only used to process incoming email :b

Ah...

http://www.panix.com/panix/help/filterfaq.html

formail -s procmail < mailfile

Thanks for the tip.

Quote:

Originally Posted by unSpawn (Post 3170284)
Have you looked at procmail?



All times are GMT -5. The time now is 01:14 AM.