Operating System - HP-UX
1837737 Members
3791 Online
110118 Solutions
New Discussion

Re: STOP INCOMING MAIL (SENDMAIL)

 
SOLVED
Go to solution
uspfoms
Regular Advisor

STOP INCOMING MAIL (SENDMAIL)

HI

How can I stop all incoming mail while still allowing sendmail to send outgoing only ?

Thanks
10 REPLIES 10
Michael Schulte zur Sur
Honored Contributor

Re: STOP INCOMING MAIL (SENDMAIL)

Hi,

correct me if I'm wrong, but isn't it enough to stop the sendmail daemon?

Michael
Hoefnix
Honored Contributor

Re: STOP INCOMING MAIL (SENDMAIL)

If you want to block incomming mail before it hits the sendmail process I would suggest to install a firewall in front of it that block's all incomming mail trafic from all ip's. Configure te firewall to allow only outgoing mail from your sendmail server.

Regards,

Peter
Patrick Wallek
Honored Contributor
Solution

Re: STOP INCOMING MAIL (SENDMAIL)

You don't need sendmail running to send mail out of a system.

If you don't want mail coming in, just stop sendmail. Don't forget to edit /etc/rc.config.d/mailservs and set the appropriate variable to 0 so that sendmail will not start next time you reboot.
Sridhar Bhaskarla
Honored Contributor

Re: STOP INCOMING MAIL (SENDMAIL)

Hi,

Patrick is right on it. You don't need sendmail running on the system to send mails out.

/sbin/init.d/sendmail stop
Edit /etc/rc.config.d/mailsrvs and make SEND_MAIL=0.

However, sendmail will be invoked as a client when it is to send mail out.

Make sure you have proper MX records setup in your DNS or have a smart relay host defined in your /etc/mail/sendmail.cf that can deal with sending mails out.

Also have a cronjob setup that run once in every 5 mins or so to run 'sendmail -q' to clean the queues. So, in case if the mail is undelivered for any reason, sendmail in cron will try to clear it every 5 mins.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

Re: STOP INCOMING MAIL (SENDMAIL)

Common misconception is that you need the sendmail daemon to get mail off of a system.

Not so. Setting the sendmail daemon setting to 1 as noted in the prior post will easily accomplish your goal.

Do take note of the fact that you are still running sendmail to get mailx and other traffic off the box and you need to keep up to date on security issues.

You never know when you need to actually accept mail again.

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
Marc Roger
Advisor

Re: STOP INCOMING MAIL (SENDMAIL)

You can disable sendmail completely as a daemon if you do not need incoming e-mail.

However, you should not neglect to run sendmail to process the run queue from time to time (for instance "sendmail -q" run every hour from cron) This is because when you send e-mail and the destination server is down, the message is queued locally in /var/spool/mqueue, the sendmail daemon processes this queue at regular interval (-q parameter)
Andrew Cowan
Honored Contributor

Re: STOP INCOMING MAIL (SENDMAIL)

There may also be an issue as to where the mail is coming from? All the messages should time-out, and eventually, be returned to the sender as undelivered?

I think you should consider prevention as well as cure. Is this mail spam, or is it coming from badly configured local hosts/ rogue apps?

If your looking at the latter, I would consider receiving the mail for a while, and analysing the source(s). There maybe ways of getting your ISP to stem the flow, or of reconfiguring systems so that they don't generate it in the first place.
donne007
Regular Advisor

Re: STOP INCOMING MAIL (SENDMAIL)

Hi,
As Sridhar rightly pointed out, I would like to add.
If you are using sendmail version 8.11.1 all you got to do is edit the file - /etc/rc.config.d/mailservs file and set the SENDMAIL_SENDONLY flag is set to 1,

then sendmail performs "send only" function. In other words, users are not allowed to receive mails in this domain.

Hope this helps !

Thanks
Asif


uspfoms
Regular Advisor

Re: STOP INCOMING MAIL (SENDMAIL)

Thanks all

Version is 8.9.3.1, Getting Flak from my
Network security folks. That's why I'm trying to close incoming mail, This Server is not used for mail but I have a few shells
That send mail with files attached to our Exchange mail system.
Tom Smith_9
Frequent Advisor

Re: STOP INCOMING MAIL (SENDMAIL)

You could also keep Sendmail running and retrict relay to just your system, that way no one can relay off you.

Just add the servers IP to /etc/mail/relay-domains.

That should keep the Network Sec guys happy.