We help IT Professionals succeed at work.

How to Disable SMTP on Sendmail???????

aLTeReGo
aLTeReGo asked
on
Medium Priority
3,591 Views
Last Modified: 2013-12-17
I am currently running sendmail on my AIX machine to "send mail" for automated processes. I do not need to receive mail on this machine as it is not a full mail server. I only need sendmail's client capabilities for my process. How do I disable the SMTP server on my AIX computer?

Due to the scripting requirements on this machine, not using sendmail isn't an option.
Comment
Watch Question

Commented:
SMTP server starts as a deamon sendmail -d so i don't know on aix but you can see in /etc/rc.d and do grep sendmail * and see in witch file the senamil starts... The stupid solution is on start do killall sendmail but this is not the solution. So search in startup files for sendmail entry and delete or hash it..!

Author

Commented:
  The service needs to be running in order to sendmail. I have found that I need to run sendmail in "nullclient" mode to acomplish what I need. I do not have any documentation on what to change in the sendmail config files to make it function as a "NullClient".

Top Expert 2005

Commented:
If you have a machine that you'd like the AIX machine to use as a mailhub you can use an mc file something like:

divert(0)dnl
VERSIONID(`$Id: nullclient.mc')

OSTYPE(aix?)
FEATURE(nullclient, mailhub.my-dom.tld)

replacing aix? with the correct type (aix2, aix3, aix4, aix5) and mailhub.my-dom.tld with the FQDN of your mail hub. Then build a cf file from that. Any all email sent out by the AIX box will then be forwarded to your mailhub. The box will still listen on port 25, but any mail addressed to the AIX box will be relayed to your mailhub for further delivery.

If you want the AIX box to send mail normally but not to recieve mail at all you can include:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')

in yuor mc file (assuming an 8.11.x version of sendmail). That binds sendmail to listen on the loopback address. Again, you have to build a new cf file from the mc file.

Author

Commented:
Ok, I guess the purpose of this exercise is to get port 25 shutdown. The AIX box in question is a web server. This web server uses sendmail via pearl scripts to email people on certain web actions such as requesting information etc. The server needs only to send mail for this solution. There is no reason to have port 25 open, so I want to shut it down. In browsing newsgroups I learned I can have sendmail function in a NullClient mode that would shutdown port 25. The startup switches for the sendmail daemon would change. "I.E. I would remove the
 -bd. But I have little knowledge of AIX and even less knowledge on sendmail. If you could tell me exactly what files to modify, the file names, and where they are usually located. Also an example of the changes I would need to make to the file, including addition lines, line removals and option changes. For the purposes of this exercise lets say the AIX box is AIX.MYDOMAIN.COM and my SMTP Gateway is SMTP.MYDOMAIN.COM.

     I have found an excellent resources that have given me direction but I need more assistance.

Sendmail command line reference
http://nim.cit.cornell.edu/usr/share/man/info/en_US/a_doc_lib/cmds/aixcmds5/sendmail.htm#A135C11eb


Setup Sendmail in NullClient Mode  (A how-to Guide)
http://archive.ncsa.uiuc.edu/General/CC/email/sendmail-setup.html
     The only problem with this site is that it makes references to files that I don?t have, that they must have created. If I could see what these configuration files look like I am sure I could make it work in my environment.


I apologize for needing such specific information but this is my first time dealing with sendmail ever.
     

Author

Commented:
Ok, I guess the purpose of this exercise is to get port 25 shutdown. The AIX box in question is a web server. This web server uses sendmail via pearl scripts to email people on certain web actions such as requesting information etc. The server needs only to send mail for this solution. There is no reason to have port 25 open, so I want to shut it down. In browsing newsgroups I learned I can have sendmail function in a NullClient mode that would shutdown port 25. The startup switches for the sendmail daemon would change. "I.E. I would remove the
 -bd. But I have little knowledge of AIX and even less knowledge on sendmail. If you could tell me exactly what files to modify, the file names, and where they are usually located. Also an example of the changes I would need to make to the file, including addition lines, line removals and option changes. For the purposes of this exercise lets say the AIX box is AIX.MYDOMAIN.COM and my SMTP Gateway is SMTP.MYDOMAIN.COM.

     I have found an excellent resources that have given me direction but I need more assistance.

Sendmail command line reference
http://nim.cit.cornell.edu/usr/share/man/info/en_US/a_doc_lib/cmds/aixcmds5/sendmail.htm#A135C11eb


Setup Sendmail in NullClient Mode  (A how-to Guide)
http://archive.ncsa.uiuc.edu/General/CC/email/sendmail-setup.html
     The only problem with this site is that it makes references to files that I don?t have, that they must have created. If I could see what these configuration files look like I am sure I could make it work in my environment.


I apologize for needing such specific information but this is my first time dealing with sendmail ever.
     
Top Expert 2005
Commented:
I don't know if AIX includes the sendmail cf hierarchy in the normal installation, which is necessary to modify the sendmail configuration to set up a null client or disable inbound SMTP connections. The cf hierarchy can be extracted from the sendmail source distribution, but to do that you'd need to determine what version of sendmail is installed on your AIX box. That can be done by opening a telnet session to the SMTP port and checking the version string (e.g. 'telnet aix.mydomain.com 25').

Typically a vendor supplied cf package has a structure similar to what is in the sendmail source distribution. At the top level you'll usually see:

cf/      feature/  m4/         ostype/  sh/
domain/  hack/        mailer/  README   siteconfig/

To generate a null client sendmail.cf file you need to create a file (say nullclient.mc) in the cf dir containing:

divert(0)dnl
VERSIONID(`$Id: nullclient.mc')

OSTYPE(aix?)
FEATURE(nullclient, smtp.mydomain.com)

replacing 'aix?' with the name appropriate for your version of AIX (e.g,., aix2, aix3, aix4, aix5) and replacing smtp.mydomain.com with the actual name of your mail server.

Then, while in the cf dir, execute:

# m4 ../m4/cf.m4 nullclient.mc >sendmail.cf

Save your existing sendmail.cf file, and copy the one just created to where your sendmail.cf normally lives (typically /etc/sendmail.cf or /etc/mail/sendmail.cf). Stop and restart sendmail to have it use the new cf file.

Commented:
you could always use IPChains to drop inbound packets to TCP port 25...