Results 1 to 14 of 14
  1. #1

    How to disable sendmail completely?

    Is there any way to have sendmail completely disabled on my server?
    I tried:
    service sendmail stop

    but my maillog keeps filling up with a lot of messages like these:

    stat=Deferred: Connection refused by [127.0.0.1]

    How can I stop the maillog from filling up?

  2. #2
    Join Date
    Aug 2002
    Location
    Canada!
    Posts
    159
    You can try:
    rpm -e sendmail

    or

    yum remove sendmail

  3. #3
    Join Date
    Jul 2005
    Location
    New Jersey, US
    Posts
    1,507
    What control panel are you using? If you are using cpanel, then sendmail is really just exim, so you can just remove the sendmail file to disable it
    PlatinumServerManagement (also known as PSM)
    The OLDEST and LARGEST and MOST TRUSTED server management provider in the USA, with 15+ employees and growing!
    Providing quality support for OVER 18 years! Currently supporting over 3,000+ servers monthly!

    www.PlatinumServerManagement.com Proud member of the NJ BBB & Chamber of Commerce & Authorized cPanel Partner.

  4. #4
    The log message itself says that sendmail is stopped and disabled. System logs the activities with syslogd daemon so you may have to disable mailing logs from syslog.conf file.
    www.24x7servermanagement.com
    Server Management, Server Security, Server Monitoring.
    India's Leading Managed Service Provider !! Skype: techs24x7

  5. #5
    Join Date
    Jul 2009
    Location
    SLASH ROOT
    Posts
    26
    Try this : which sendmail

    This should give you the "sendmail" binary's path. Change the permissions to "0000" and the ownership to "root".
    ----------------------------
    chmod 0000 <path_to_sendmail>
    chown root.root <path_to_sendmail>
    ----------------------------

    That should disable sendmail. This way there should not be any dependency issues later on. Just keep in mind the current permissions and ownerships.

    ---------------------------
    Systems Engineer
    WHRSS
    We grow by helping you grow.

  6. #6
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853

  7. #7
    Join Date
    Jan 2006
    Location
    Ontario, Canada
    Posts
    324
    First of all, which OS are you using?
    For CentOS do chkconfig sendmail off; service sendmail stop
    For other operating systems the commands would be different.
    Shared Hosting / Reseller Hosting / Email Hosting
    Dedicated Servers / Unmetered Servers / Linux & Windows VPS
    DME Hosting, LLC [http://www.dmehosting.com]

  8. #8
    I'm on CentOS and not using a cpanel.

    Quote Originally Posted by Srv24x7 View Post
    The log message itself says that sendmail is stopped and disabled. System logs the activities with syslogd daemon so you may have to disable mailing logs from syslog.conf file.
    Thanks, I've disabled it and stopped it from appearing in /var/log/maillog

    but in /var/log/httpd/error_log I still get these messages:

    "sh: /usr/sbin/sendmail: No such file or directory"

    What can I do so that it stops logging to the httpd errorlog?

  9. #9
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853

  10. #10
    Quote Originally Posted by whrss View Post
    Seems like some codes (html/php) are still seeking sendmail to send mails via 'http'.

    Can you paste the full apache logs?
    I don't want to post the logs due to privacy issues (with domain names), but I know there are many Wordpress blogs installed. Would it be something to do with Wordpress?

  11. #11
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853
    If your WP domains has a mailing URL, then that may be configured to use sendmail SMTP since you are getting those errors in Apache error logs.

    I asked for logs to see if we can get the full path of the file using it. If you still can't figure it out, hire a Server Admin for further help.

  12. #12
    Just remove or disable sendmail from startup in /etc/init.d.

  13. #13
    Join Date
    Jun 2009
    Location
    Lima - Peru
    Posts
    26
    rpm -e sendmail
    and try to remove log of sendmail.

  14. #14
    Join Date
    Mar 2003
    Location
    California USA
    Posts
    13,290
    This thread made me cry so I am posting my input.


    Quote Originally Posted by Ogg View Post
    You can try:
    rpm -e sendmail

    or

    yum remove sendmail
    Someone who actually has a clue. That will work if its a centos based machine. Keep in mind if you rpm -e sendmail you may get dependencies. Yum remove will remove the dependencies but redhat enterprise usually does not have yum. If its debian you will need to use dpkg and if its freebsd you will have to disable it in rc.conf


    Quote Originally Posted by ServerManagement View Post
    What control panel are you using? If you are using cpanel, then sendmail is really just exim, so you can just remove the sendmail file to disable it
    If you actually read the error message you would have seen it is NOT exim, and it is actually sendmail.

    Quote Originally Posted by Srv24x7 View Post
    The log message itself says that sendmail is stopped and disabled. System logs the activities with syslogd daemon so you may have to disable mailing logs from syslog.conf file.
    Wrong.

    Quote Originally Posted by whrss2 View Post
    Try this : which sendmail

    This should give you the "sendmail" binary's path. Change the permissions to "0000" and the ownership to "root".
    ----------------------------
    chmod 0000 <path_to_sendmail>
    chown root.root <path_to_sendmail>
    ----------------------------

    That should disable sendmail. This way there should not be any dependency issues later on. Just keep in mind the current permissions and ownerships.

    ---------------------------
    Systems Engineer
    WHRSS
    We grow by helping you grow.
    Horrible advice. That is a hack to disable it. You will likely end up with other errors in the system when crons and what not try to access the binary and it gets a permissions error.

    Quote Originally Posted by whrss View Post
    If you are having Cpanel, then its using Exim's binary as PSM said.

    If you don't have a CP, check if sendmail is a StandAlone server or not. If it isn't then it will be running under 'xinetd'.

    Paste the result of "netstat -plan| grep :25" so that I can confirm.
    Sigh

    Quote Originally Posted by nexbyte View Post
    First of all, which OS are you using?
    For CentOS do chkconfig sendmail off; service sendmail stop
    For other operating systems the commands would be different.
    Good advice.

    Quote Originally Posted by revax View Post
    I'm on CentOS and not using a cpanel.



    Thanks, I've disabled it and stopped it from appearing in /var/log/maillog

    but in /var/log/httpd/error_log I still get these messages:

    "sh: /usr/sbin/sendmail: No such file or directory"

    What can I do so that it stops logging to the httpd errorlog?
    you have a script somewhere that is trying send mail. Likely a php script trying to use the mail() function. Now that you have removed sendmail php is no longer able to access the binary which it thinks is there.

    php -i |grep -i sendmail

    will show the sendmail path.

    You can try to symlink sendmail to the true binary to get the error to go away but it is not the correct fix. The correct fix would be to compile php without mail() features.

    ln -s /bin/true /usr/sbin/sendmail




    Quote Originally Posted by whrss View Post
    If your WP domains has a mailing URL, then that may be configured to use sendmail SMTP since you are getting those errors in Apache error logs.

    I asked for logs to see if we can get the full path of the file using it. If you still can't figure it out, hire a Server Admin for further help.
    depending on how the system is configured it could be in a number of logs.

    Quote Originally Posted by cartguy View Post
    Just remove or disable sendmail from startup in /etc/init.d.
    Decent answer

    Quote Originally Posted by InternetPeru View Post
    rpm -e sendmail
    and try to remove log of sendmail.
    Decent answer.
    Steven Ciaburri | Industry's Best Server Management - Rack911.com
    Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
    Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
    FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance

Similar Threads

  1. HELP: Sendmail process for users that does not have sendmail process...
    By reamark in forum Hosting Security and Technology
    Replies: 2
    Last Post: 05-16-2006, 08:46 AM
  2. Replies: 4
    Last Post: 01-08-2004, 04:40 AM
  3. Completely new
    By TetsuoAkira in forum Running a Web Hosting Business
    Replies: 4
    Last Post: 10-08-2002, 04:13 PM
  4. sendmail/etc/mail/sendmail.cf: WARNING: dangerous write permissions
    By Andrew Pakula in forum Dedicated Server
    Replies: 5
    Last Post: 07-28-2002, 10:28 PM
  5. And now for something completely different!
    By cbaker17 in forum Web Hosting Lounge
    Replies: 8
    Last Post: 02-16-2002, 08:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •