LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-07-2008, 02:47 PM   #1
tklima
LQ Newbie
 
Registered: Jan 2005
Posts: 16

Rep: Reputation: 0
preventing postfix from listening on port 25


Hi,

how can I prevent postfix from listening on port 25? I want postfix to be used for sending mails from the local system only, not as a mail server.

I am running Debian (2.6.18-5)

Thanks for you help.
 
Old 01-07-2008, 02:54 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
it will always need to listen on 25 locally, but you can stop it listening externally by using the inet_interfaces option, e.g. "inet_interfaces=localhost" in your main.cf
 
1 members found this post helpful.
Old 01-07-2008, 04:12 PM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Or just use iptables to block all incoming or outside port 25 requests outside of your local network. Allow outgoing though.
 
Old 01-07-2008, 05:04 PM   #4
zoranp
Member
 
Registered: Nov 2007
Location: Belgrade, RS
Distribution: Mandriva 2009.0 X86_64
Posts: 44

Rep: Reputation: 15
Or just do not run postfix in daemon mode.
 
Old 08-30-2010, 11:55 AM   #5
Eduardo Nunes
LQ Newbie
 
Registered: Aug 2010
Location: /root/SouthAmerica/Brazil/SaoPaulo/SP
Distribution: Slackware
Posts: 24

Rep: Reputation: 2
Post

Quote:
Originally Posted by tklima View Post
Hi,

how can I prevent postfix from listening on port 25? I want postfix to be used for sending mails from the local system only, not as a mail server.

I am running Debian (2.6.18-5)

Thanks for you help.
If you want to use the "sendmail" command to send emails, you may comment out the smtp inet n - n - 1000 smtpd line at master.cf

You can also block out the port 25 for incoming connections with iptables.

# iptables -I INPUT -p tcp --dport 25 -j DROP
 
Old 08-30-2010, 12:06 PM   #6
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
You might consider putting this in main.cf:
Code:
inet_interfaces = loopback-only
This causes the postfix smtpd to listen only on the loopback interface, making connections from external hosts impossible. You should read the STANDARD_CONFIGURATION_README and its prerequisites.
[edit]i see acid_kewpie already gave the same advice. just add my vote to his reponse.[/edit]

Last edited by Berhanie; 08-30-2010 at 12:10 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto do Secured ssh from port https or port80(standard) to ssh d listening port 22 ? Xeratul Linux - General 4 11-23-2006 06:09 AM
listening on port 80, why ekdya Debian 5 09-27-2006 06:50 PM
postfix listening port wardjame Linux - Software 4 08-02-2006 11:08 AM
Listening on a serial port calebsg Linux - General 2 10-13-2004 10:45 AM
Postfix running but not listening on 25 pnh73 Linux - Networking 1 05-27-2004 12:07 AM


All times are GMT -5. The time now is 08:49 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration