Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'd like to setup a postfix host (using RHEL 5.4's default postfix, which is version 2.3) with the following characteristics:

  • an SMTP listener listens on 10.0.0.1:25 and relays all e-mails to 10.0.0.1:2525
  • an SMTP listener listens on 10.0.0.1:2525 and relays all e-mails to 10.0.0.2:25

Basically the challenge here is to use two different relayhosts for the different SMTP listeners.

Is it possible? Is there a better solution to achieve similar behavior?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Define the listeners in master.cf with the relay host as a content filter:

10.1.0.1:25 inet n - - - - smtpd -o content_filter=smtp:[10.0.0.1]:2525

10.1.0.1:2525 inet n - - - - smtpd -o content_filter=smtp:[10.0.0.2]:25

I had fun figuring this out!

share|improve this answer
    
Well, I'm not entirely happy with this solution but that's what I figured out myself as well. Thanks. –  Zizzencs Mar 5 '10 at 12:51
    
What's your objection to it? –  quadruplebucky Mar 7 '10 at 21:35
    
It's not a content filter that I send the mails to... :-) –  Zizzencs Mar 9 '10 at 10:00
    
...sure it is....it's a content filter that does nothing but connect to a particular IP/port –  quadruplebucky Mar 9 '10 at 11:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.