Operating System - HP-UX
1752473 Members
7320 Online
108788 Solutions
New Discussion юеВ

Sendmail Configuration Help

 
SOLVED
Go to solution
Aziz Zouagui
Frequent Advisor

Sendmail Configuration Help

Greetings,

I have some questions about sendmail, first this is our configuration:

A user in the system, Oracle, within HP-UX 11.00 sends messages to the users within the company like some_user@ourdomain.com. These are just alerts of job completions. These are straight shell scripts with mailx syntax used inside like:

mailx -s "Job Complete" some_user@ourdomain.com

I don't want to receive any messages back to the Oracle user, root or anybody else, all the system does is send, don't care if the user exists or doesn't in the domain, I just don't want to generate undeliverable email traffic, since no one is going to look at the messages.

Is there anything specific in the sendmail.cf file that needs to be changed or added ?

Since our email is handled by outside windows exchange servers and our smtp server was responsible for receiving email, I went and added this line to the sendmail.cf to relay all outbound messages to the smtpout.ourdomain.com, which is a valid smtp server.

DSsmtpout.ourdomain.com
(Is this the right use of this directive ?)

The directives below were already in the file:

CL root
DMourdomain.com

Is our configuration of the sendmail.cf file enough, do we need to change something else to meet the specific requirements I have outlined above ?


Many thanks in advance to all who contribute to this message.

Aziz.
8 REPLIES 8
Patrick Wallek
Honored Contributor
Solution

Re: Sendmail Configuration Help

If you don't want to receive e-mail on this machine all you have to do is turn sendmail off. First run '/sbin/init.d/sendmail stop' and then check the file /etc/rc.config.d/mailservs (I think that's right) and set the variable START_SENDMAIL (again, I think that's right, I can't login to a box at the moment) to 0.

That way the sendmail daemon can not receive. The sendmail agent will start when it needs to send something, but will shutdown again immediately after.

In this scenario you should also schedule 'sendmail -q' every 30 minutes or so to flush the sendmail queue.

This is a standard setup on all my machines.
Steven E. Protter
Exalted Contributor

Re: Sendmail Configuration Help

Structurally what you are doing will work.

We have special outlook mailboxes for system emails and direct all email from Unix servers to those the same way you do. I think this is a good idea. WE have them set up as special folders and operations and the dba are supposeded to check them day by day.

If you implement Patrick's suggestion, you may need to run sendmail -q periodically to get mail off of your server.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Aziz Zouagui
Frequent Advisor

Re: Sendmail Configuration Help

Thank you both for responding so quickly, though I don't want to disable sendmail process. if an email is generated and needs to be sent, it has to go within 30 seconds. Waiting for 30 minutes to invoke the sendmail defeats the pourpose of generating these emails. But that is a good suggestion.

Unfortunately, I have to keep it up and running.

Keep your suggestions coming, thank you all.

Aziz
Patrick Wallek
Honored Contributor

Re: Sendmail Configuration Help

No, you really don't. The mail *will* be sent immediately. The only reason you have the 'sendmail -q' running is if there happens to be a problem somewhere and the mail can't be sent. Only then will the mail queue up.

If you have a test system, try this: Have a couple of sessions open. Stop sendmail. Do a 'tail -f /var/adm/syslog/mail.log' in one window. Now send an email with mailx or sendmail in another window and watch the mail.log file. You should see the message go out within a few seconds.
Aziz Zouagui
Frequent Advisor

Re: Sendmail Configuration Help

Patrick,

Please correct me if I am wrong:
Sendmail can be disabled and the mail still can be sent, so the job of the sendmail is only to receive email not for outgoing.

How does mailx then know what the relay host is and all the other configurations in the sendmail.cf file ?

Many thanks

Aziz.
Patrick Wallek
Honored Contributor

Re: Sendmail Configuration Help

Sendmail is used for both sending and receiving. BUT when you issue mailx, a sendmail daemon is spawned, the mail is sent, and sendmail daemon is killed. You still need to have your correct relay host configured in your sendmail.cf file and your aliases file needs to be up to date but you don't have to have the daemon running all the time.

The reason behind having a sendmail daemon running all the time is so you can receive mail. If you are not going to be, you don't need to run it.
Aziz Zouagui
Frequent Advisor

Re: Sendmail Configuration Help

Patrick,

Well put, I didn't know that could be done, this is why I like this forum.

Thank you.
Steven E. Protter
Exalted Contributor

Re: Sendmail Configuration Help

If your server does not need to accept any mail, its safe to shut down the sendmail daemon.

All outgoing mailx mail will go through, just like Patrick says.

If this server is on the public Internet, you may want to look at this thead. If you are plahying with sendmail anyway you might want to configure it to stop abuse.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=424086

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com