views:

326

answers:

1

Hello

I have following problem:

CRM system running on Linux computer is sending emails via sendmail.

I would like to change destination port from 25 to 587 using iptables but without modifing sendmail (not possible due to crm configuration).

I tried to use iptables but mine tries of redirecting packet on output chain to port 587 were unsuccessfull.

+1  A: 

You said you don't want to modify sendmail, so I'm assuming that sendmail has to run on port 25, but you want clients to be able to connect to it through port 587.

This incantation should do that for you:

$ iptables -t nat -A PREROUTING -p tcp --dport 587 -j REDIRECT --to-port 25
tgamblin