System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

sendmail configuration issue with non-standard SMTP port

Debbie Fleith
Regular Advisor

sendmail configuration issue with non-standard SMTP port

I need to get sendmail configured to send emails from a Linux server through a mail server running on Port 8080.

What changes would I need to make to sendmail.cf or other files to make this work?
4 REPLIES
Steven E. Protter
Exalted Contributor

Re: sendmail configuration issue with non-standard SMTP port

Shalom,

Inbound or outbound?

IF its outbound, you might just want to have iptables firewall do a bit of port forwarding.

Otherwise you need to change sendmail.mc and muse m4 to compile a new sendmail.cf

sendmail.cf is not human readable IMO, sendmail.mc is.

http://www.sendmail.org

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Debbie Fleith
Regular Advisor

Re: sendmail configuration issue with non-standard SMTP port

I need this for outbound email. What specific rule would I add to the firewall?
Ivan Ferreira
Honored Contributor

Re: sendmail configuration issue with non-standard SMTP port

Please see:

http://wiki.xdroop.com/space/sendmail/smart+host+ports

Normally, your firewall won't block outgoing packets.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Matti_Kurkela
Honored Contributor

Re: sendmail configuration issue with non-standard SMTP port

I guess SEP had something like this in mind:

iptables -t nat -A OUTPUT -p tcp -d mail.server.ip.addr --dport 25 --to-destination mail.server.ip.addr:8080 -j DNAT

This redirects any outgoing TCP connection to the mail server's port 25 to the port 8080 instead. Connection tracking is automatically invoked to ensure any returning packets are modified too, so the applications at either end can work just as usual.

In the viewpoint of any program on this host, including Sendmail, that particular mail server is now effectively running on port 25, not 8080.

Of course, this is just one of the many ways to skin this particular cat...

Note that this is a "nat" rule, not the usual "filter" rule, so a simple "iptables -L" won't display it. You'll need to use "iptables -t nat -L" to see it.

MK
MK