• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Relaying with Linux Postfix 1.1.7 - please help

BaDaBooM

Golden Member
We have Postfix 1.1.7 running on a Red Hat 7.1 box with 1 NIC. We would like to get it to relay email to another server on a non-standard port (not 25). So it needs to accept mail from anyone on port 25 for a couple domains names and relay it to another server (not on the internal network) over a different port. Anybody know how to do this? We also have IPtables installed for the firewall and webmin as a web configuration tool, if that helps.
 
You might be able to use IPTables to redirect the connection, but I havn't done that so I can't explain how to go about it.
 
Yea, we messed around with IP tables, but haven't got it working yet. I would prefer for it to act more like a smart host so there is a buffer. I'll take help on either though.
 
Set them up in the relay_domains lines in your main.cf to let it relay for them. Maybe you can use the rewrite stuff with postfix to redirect to a different post but I've never done it. Otherwise I'd just use iptables to redirect all traffic for the ip address of your host you're relaying to (say 10.10.10.200) So all traffic destined to 10.10.10.200 port 25 will be redirected to 10.10.10.200 port 8000 Perhaps somone else can help out with the iptables stuff, but relay_domains should take care of half of it.

Why isn't the other mail server listening on port 25?
 
Does it matter if the computer that is to be forwarded to is not on the internal network? Normally you set this up with 2 nics and have one as the external and one as the internal that can forward to an internal computer. However in my case it only has one nic, is using a private address behind a different firewall (which I can forward ports to internal address), and needs to forward to a public address outside of the internal address. Will that complicate things?
 
I don't see why, all postfix knows is that is allowed to relay mail for that domain. As long as it has a route to the destination, it shouldn't matter how it gets there or where it is.
 
Hmm, ok.... so how do I tell Postfix to use a different port when it relays instead of port 25? If I redirect it from IP tables that will send everything that would be on port 25 to the other port but I just want it to use a different port when it is relaying.
 
I'm still trying to wrap my head around what you're going for here, but the outbound connection as it relays to another server wouldn't be coming from 25 destination, thats just what its destination would be I think.......
 
Hmm... so how exactly would you make postfix use a different port when it is relaying emails to the second server?
 
I don't think I'm following what you're trying to make it to do, you might want to post/search to the postfix users mailing list, you'll get a quick answer.
 
I think I may have found what I am looking for. There is a feature for post fix called transport mapping, though I'm not sure how to configure it. If anybody knows how to configure it for relaying to another server that uses a non-standard port, please let me know.
 
Back
Top