1829640 Members
1621 Online
109992 Solutions
New Discussion

Re: SMTP DISABLE

 
SOLVED
Go to solution
gigiz
Valued Contributor

SMTP DISABLE

Hi Guys,
How i can disable SMTP ?
16 REPLIES 16
Geoff Wild
Honored Contributor

Re: SMTP DISABLE

/sbin/init.d/sendmail stop

Set
SENDMAIL_SERVER=0
in /etc/rc.config.d/mailservs

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
gigiz
Valued Contributor

Re: SMTP DISABLE

I want disable a service SMTP, not sendmail.
Help me many point at all
Torsten.
Acclaimed Contributor

Re: SMTP DISABLE

SMTP = simple mail transfer protocol

see
# grep smtp /etc/services
/etc/services:smtp 25/tcp # Simple Mail Transfer Protocol


Who is listen on port 25?

# ps -ef|grep sendmail
root 3377 1 0 Jun 25 ? 62:04 sendmail: accepting connections on port 25

So why not disable sendmail?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Geoff Wild
Honored Contributor

Re: SMTP DISABLE

Sendmail uses SMTP (should be the only thing).

Shutting down sendmail will disable SMTP.

Unless you are running another mail transport - like Qmail...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: SMTP DISABLE

Example:

# netstat -an |grep 25 |grep LISTEN
tcp 0 0 127.0.0.1.25 *.* LISTEN

# /sbin/init.d/sendmail stop
Shutting down sendmail [Done]
Shutting down sm-client [Done]

# netstat -an |grep 25 |grep LISTEN


Returns nothing.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Torsten.
Acclaimed Contributor

Re: SMTP DISABLE

and another:

# lsof -i TCP:25

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sendmail 3377 root 5u IPv4 0x34b2cc0 0t0 TCP *:smtp (LISTEN)



Or do you have SNMP in mind by chance?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
gigiz
Valued Contributor

Re: SMTP DISABLE

Ok i already disable sendmail but i want know if exist a procedure to disable SMTP service !!!
Torsten.
Acclaimed Contributor

Re: SMTP DISABLE

I really don't know how to say this more clearly...

The process listen on port 25 *IS* your mail service - most likely this is sendmail.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Tim Nelson
Honored Contributor

Re: SMTP DISABLE

If you wish to disable outgoing mail then you will remove permissions or rename the sendmail binary. ( maybe even mailx as well, although it probably calls sendmail ).

Geoff Wild
Honored Contributor

Re: SMTP DISABLE

How are you testing if smtp is open?

try

telnet yourserver 25

If you get:

Trying...
telnet: Unable to connect to remote host: Connection refused

then it is disabled...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
whiteknight
Honored Contributor

Re: SMTP DISABLE

Gigiz,

To disable SMTP permanently

vi /etc/services

##commentted out
#smtp 25/tcp # Simple Mail Transfer Protocol

#inetd -c

WK
Problem never ends, you must know how to fix it
gigiz
Valued Contributor

Re: SMTP DISABLE

No WK,
you are mistaking if you comment the /etc/service however SMTP work.
whiteknight
Honored Contributor

Re: SMTP DISABLE

Gigiz,


# lsof -i TCP:25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sendmail 1142 root 5u IPv4 0x4d13b4c0 0t0 TCP *:25 (LISTEN)

# cd /sbin/init.d
# ./sendmail stop
Shutting down sendmail ..... [ OK ]
Shutting down sm-client [ OK ]

# lsof -i TCP:25
# telnet nickel2 25
Trying...
telnet: Unable to connect to remote host: Connection refused
#

WK
Problem never ends, you must know how to fix it
whiteknight
Honored Contributor

Re: SMTP DISABLE

Gigiz,


# lsof -i TCP:25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sendmail 1142 root 5u IPv4 0x4d13b4c0 0t0 TCP *:25 (LISTEN)

# cd /sbin/init.d
# ./sendmail stop
Shutting down sendmail ..... [ OK ]
Shutting down sm-client [ OK ]

# lsof -i TCP:25
# telnet pluto 25
Trying...
telnet: Unable to connect to remote host: Connection refused
#

WK
Problem never ends, you must know how to fix it
Ludovic Derlyn
Esteemed Contributor
Solution

Re: SMTP DISABLE

hi,

i have found this in my result of shc

Stop the sendmail daemon:
/sbin/init.d/sendmail stop
Deactivate server mode:
/usr/sbin/ch_rc -a -p SENDMAIL_SERVER=0
Disallow all SMTP status queries, add
O PrivacyOptions=goaway
to the /etc/mail/sendmail.cf file
add cronjob to process mail:
0,15,30,45 * * * * /usr/sbin/sendmail -q

Regards
L-DERLYN
gigiz
Valued Contributor

Re: SMTP DISABLE

ok