LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 05-29-2008, 11:18 PM   #1
digitaljunkie
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
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
 
Old 05-31-2008, 08:16 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,165
Blog Entries: 54

Rep: Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806Reputation: 2806
Have you looked at procmail?
 
Old 06-01-2008, 02:47 PM   #3
digitaljunkie
LQ Newbie
 
Registered: May 2008
Posts: 2

Original Poster
Rep: Reputation: 0
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 View Post
Have you looked at procmail?
 
  


Reply

Tags
mail, sendmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open mail spool file /var/mail/root cccc Debian 4 09-14-2006 01:31 PM
How to forward/deliver mail thats already in spool slackbat Linux - Networking 1 08-21-2006 04:00 PM
spam_buttons move from /var/spool/mail/user to $HOME/mail/Junk paul_mat Linux - Software 0 05-25-2006 02:07 AM
Individual user's mail file in /var/spool/mail Swakoo Linux - General 1 09-07-2005 06:33 AM
Mail going to /var/spool/mail/user and not to Thunderbird pracslipkerm Linux - Newbie 4 06-21-2005 05:58 AM


All times are GMT -5. The time now is 11:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration