AIX

 View Only
  • 1.  how to disable mail services completely on AIX 7.x systems

    Posted Fri February 12, 2021 01:15 AM
    Can someone respond how to disable sendmail and mailx permanently on AIX  7.x server. 
    I do not see any entry for sendmail in inittab or statup script in /etc/rc.d , how do I disable both sendmail and mailx and it should not start upon reboot.

    --> lssrc -a|grep send
    sendmail mail 5177776 active

    Thank you very much
    Nag

    ------------------------------
    Nag N
    ------------------------------


  • 2.  RE: how to disable mail services completely on AIX 7.x systems

    Posted Fri February 12, 2021 01:44 AM
    I found a sendmail  entry in /etc/rc.tcpip  , I commented and rebooted the server . Then sendmail was "inoperative" .. Is this right way of disabling ?
    Also how to disable mailx permanently ?

    ------------------------------
    Nag N
    ------------------------------



  • 3.  RE: how to disable mail services completely on AIX 7.x systems

    Posted Fri February 12, 2021 02:07 AM
    > I found a sendmail entry in /etc/rc.tcpip , I commented and rebooted
    > the server . Then sendmail was "inoperative" .. Is this right way of
    > disabling ?

    That's fine. If lssrc shows it inoperative, excellent.

    > Also how to disable mailx permanently ?

    That you'd have to do via filesystem permissions, ie: chmod 000
    /usr/bin/mailx.

    AIX runs sendmail and accepts mail by default. I've found it
    advantageous at some customers to tell sendmail to bind port 25 to
    localhost only, and forward all mail to a SMTP relay. Then local mail
    commands can send mail normally to internal email addresses, and
    you'll pass network vulnerability scans because you aren't hosting an
    open sendmail port.




  • 4.  RE: how to disable mail services completely on AIX 7.x systems

    IBM Champion
    Posted Mon February 15, 2021 10:15 AM

    Hello all,
    I agree with Russell, complete disable mail is most of the times a bad idea.
    But have mail only send to a local mail server and not to outside is a better idea.
    Complete disable can be done by edit the line in /etc/rc.tcpip:
    #start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"

    but this wil not prevent sending the mail manually by ether the sendmail or mail command's
    This can be done by changing the right of those mailer programs, do not forget to do the same for the mailq command so in other word the set of files would be:
    /usr/sbin/sendmail
    /bin/mail
    /usr/sbin/mailx
    /usr/sbin/mailq

    In our case we prefer to send all the mail to an internal mail sever (relay server) this is very ease to do.
    just modify one line in either  /etc/mail/sendmail.cf or newer /etc/mail/submit.cf
    # "Smart" relay host (may be null)
    DSsmtp:[smtprelay.name.something]

    then you can keep the sendmail line in /etc/rc.tcpip disabled and run manual or via cron the sendmail command when you like, eg sendmail -q 
    Hopefully this is help full ?



    ------------------------------
    Christian Sonnemans
    ------------------------------



  • 5.  RE: how to disable mail services completely on AIX 7.x systems

    Posted Mon February 15, 2021 10:36 AM
    If you tell sendmail to only listen to localhost, you don't have to process the mailqueue separately or stop sendmail.

    In /etc/mail/sendmail.cf, change:

    O DaemonPortOptions=Name=MTA​


    to

    O DaemonPortOptions=NAME=NoMTA4, Family=inet, Addr=127.0.0.1


    The DS should be set to always use a smart relay, and you may have to configure DD to set the domain name properly.

    However his question was how to disable completely. Stopping the service and disabling access to the binaries should suffice to stop AIX's built in mail ability. Perl may be able to send mail, but requires scripting.



    ------------------------------
    Russell Adams
    ------------------------------



  • 6.  RE: how to disable mail services completely on AIX 7.x systems

    Posted Tue February 16, 2021 05:59 PM
    chrctcp -S -d sendmail   <- Stop/Disable Permanently to start Daemon
    chrctcp -S -a sendmail   <- Start/Enable Permanently

    Then chmod on the /usr/bin/mail* binary not to execute.


    ------------------------------
    Selvamurugan Kuppusamy
    ------------------------------