stan
stan

Reputation: 19

iptables port redirection

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.

Upvotes: 1

Views: 3858

Answers (1)

Todd Gamblin
Todd Gamblin

Reputation: 59807

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

Upvotes: 2

Related Questions