How to deliver/forward a /var/spool/mail/user file
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.
Have you looked at procmail?
Didn't really consider it. I thought it was only used to process incoming email :b
formail -s procmail < mailfile
Thanks for the tip.
|All times are GMT -5. The time now is 04:57 PM.|