Link to home
Start Free TrialLog in
Avatar of tomp_gl
tomp_gl

asked on

What port does sendmail send mail on?

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
SOLUTION
Avatar of dekkar
dekkar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of giltjr
giltjr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tomp_gl
tomp_gl

ASKER

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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tomp_gl

ASKER

If sendmail is using a random source port then I should probably accept all OUTPUT packets... are there any security ramifications to this?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial