-   Linux - Server (
-   -   How to deliver/forward a /var/spool/mail/user file (

digitaljunkie 05-30-2008 12:18 AM

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,

unSpawn 05-31-2008 09:16 AM

Have you looked at procmail?

digitaljunkie 06-01-2008 03:47 PM

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


formail -s procmail < mailfile

Thanks for the tip.


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

All times are GMT -5. The time now is 10:04 PM.