Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send all mail to files instead of relaying

Status
Not open for further replies.

mglenney

IS-IT--Management
Jun 9, 2009
1
US
I had a wierd request from one of our guys. We are running on RedHat EL5. He asked that all mail originating from 3 servers he owns be sent to files instead of being sent out. My first thought is to set "Smart" relay host in sendmail.cf on each of the 3 servers so all messages are sent to a 4th server. On the 4th server setup a smtp server to archive all the messages.

I probably won't go this route because ALL messages, including emails SA's may have coming out of cron jobs or scripts, will not get delivered properly. But, I'm working on a way to just send the messages coming out of his app to the "blackhole" smtp server. If I can do that:

1) Do you know of a way to setup a smtp server so that it stores all incoming messages in files (queue?) but doesn't ever relay them?
2) Any better solutions? I could just send them to files local to each of the 3 servers and then consolidate them some other way but I don't know how to send them all to a file locally either.

Thanks,

MG
 
let me get this straight ... you want to archive all the files, but not send them?

is that right?

if that is so modify your sendmail startup script so that it doesn't have '-q15m' or '-q' anything in it's arguments.

this will stop sendmail from actually delivering the mail, and cause it to hold on to it.

you can then run a parser script (if that is what you want) or backup script to archive the files from /var/spool/mqueue

if you then want to send the mail you need to run 'sendmail -oQ<queue directory> -q -v'

if you are sending mail from /var/spool/mqueue (the default) then all you need to type is 'sendmail -q -v'

attached is a 'preprocessmail' script i used to use to fix "fetchmail" issues.


i call it with a "delivermail" function:


(post.demon.co.uk was our old smart host)

hope some of this makes sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top