We help IT Professionals succeed at work.

What port does sendmail send mail on?

Medium Priority
1,413 Views
Last Modified: 2013-12-18
Hi,

I would like to completely firewall my linux box's internet interface. I want to block all incoming packets and accept only outgoing packets from sendmail, as this is the only service that should need internet access. Does sendmail use port 25 for outgoing packets? Do I need any other ports open?

Also, when setting an iptables rule for OUTPUT packets, do I refer to the source port instead of the destination port?

Thanks
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2014
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
The server will only be sending mail, not accepting it. Would I need to accept INPUT packets to established or related connections? Also, do I need to accept ping requests?

Essentially I want to do this:

# only let sendmail out
iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT
iptables -P OUTPUT DROP
# let nothing in
iptables -P INPUT DROP

But will I need to keep any other source ports open for OUTPUT packets?

Thanks
Kerem ERSOYPresident
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Kerem ERSOYPresident
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
If sendmail is using a random source port then I should probably accept all OUTPUT packets... are there any security ramifications to this?
Kerem ERSOYPresident
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2014
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.