Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfix, on two different ports at the same time?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
JackDog
Apprentice
Apprentice


Joined: 09 Sep 2004
Posts: 297
Location: St. Louis, Missoura

PostPosted: Wed Jan 19, 2005 6:31 pm    Post subject: postfix, on two different ports at the same time? Reply with quote

(PLEASE NOTE THIS HAS NOTHING TO DO WITH RUNNING A MAIL SERVER ON A DSL MODEM)

Some genius with our local ISP tried to block port 25 (incoming) to all DSL subscribers which is fine. Unfortunately, the genius also blocked the outgoing for them. So none of my users can send mail via port 25 from their homes to anyone. My server is fine because it is on a business class network so it has been unaffected. I can access port 25 from anywhere, except a DSL user's home in my area.

A simple solution would be to enable postfix to run on an alternate port. But I dont want to have two config files or worry about tls,sasl separately. Is there a way to mirror postfix through its configs? So it would listen on two ports instead of just one?
_________________
Are you intolerant of intolerant people? Tired of being PC yet?
Back to top
View user's profile Send private message
kaidon
n00b
n00b


Joined: 01 Nov 2003
Posts: 72

PostPosted: Wed Jan 26, 2005 10:00 pm    Post subject: Reply with quote

Just put something like:

<your.ip.address.here>:1025 inet n - n - - smtpd

in your /etc/postfix/master.cf and restart postfix.
You then have a second instance of postfix's smtp-daemon listening on port 1025 which shares the config with the default daemon (port 25).
Back to top
View user's profile Send private message
JackDog
Apprentice
Apprentice


Joined: 09 Sep 2004
Posts: 297
Location: St. Louis, Missoura

PostPosted: Wed Jan 26, 2005 10:08 pm    Post subject: works great Reply with quote

That is perfect. Thank you for the help!
_________________
Are you intolerant of intolerant people? Tired of being PC yet?
Back to top
View user's profile Send private message
forbjok
Apprentice
Apprentice


Joined: 21 May 2004
Posts: 207
Location: Hordaland, Norge

PostPosted: Wed Jan 26, 2005 10:16 pm    Post subject: Reply with quote

I'd go with
Code:
# iptables -t nat -A PREROUTING -p TCP --dport 1025 -j REDIRECT --to-ports 25

on the server, where 1025 is the port number to redirect to 25. You can have as many of those as you wish, replacing the 1025 with whatever port(s) you want. That should redirect any incoming connections on the specified port to the local port 25.
Back to top
View user's profile Send private message
JackDog
Apprentice
Apprentice


Joined: 09 Sep 2004
Posts: 297
Location: St. Louis, Missoura

PostPosted: Wed Jan 26, 2005 10:45 pm    Post subject: Reply with quote

I think for most services using iptables is the way to go, but since postfix has the ability to easily configure itself to listen on two ports I will probably just use that for now. Since its an application level configuration issue, its probably best to keep it there in case I need to restore the machine from backup. Keeps it little more portable.

Thanks though!
_________________
Are you intolerant of intolerant people? Tired of being PC yet?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum