×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to send all mail to files instead of relaying

How to send all mail to files instead of relaying

How to send all mail to files instead of relaying

(OP)
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

RE: How to send all mail to files instead of relaying

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.

http://www.stegatrops.co.uk/mail/preprocessmail

i call it with a "delivermail" function:

http://www.stegatrops.co.uk/mail/delivermail

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

hope some of this makes sense.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close