Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-07-2008, 02:47 PM
|
#1
|
LQ Newbie
Registered: Jan 2005
Posts: 16
Rep:
|
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.
|
|
|
01-07-2008, 02:54 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
01-07-2008, 04:12 PM
|
#3
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
Or just use iptables to block all incoming or outside port 25 requests outside of your local network. Allow outgoing though.
|
|
|
01-07-2008, 05:04 PM
|
#4
|
Member
Registered: Nov 2007
Location: Belgrade, RS
Distribution: Mandriva 2009.0 X86_64
Posts: 44
Rep:
|
Or just do not run postfix in daemon mode.
|
|
|
08-30-2010, 11:55 AM
|
#5
|
LQ Newbie
Registered: Aug 2010
Location: /root/SouthAmerica/Brazil/SaoPaulo/SP
Distribution: Slackware
Posts: 24
Rep:
|
Quote:
Originally Posted by tklima
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
|
|
|
08-30-2010, 12:06 PM
|
#6
|
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 04:08 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|