2

I've got a (possibly unusual) situation with using Postfix to relay mail to another Postfix mail server that then needs to send the email out. I've read plenty of tutorials and seen instructions for using Postfix as an email relay to send to an external provider like Google, etc. This is different though, in that I need to send to another Postfix server and have it act as the sender. The sender would always be the same (for both servers), but the end recipients could be anyone.

The problem is that I'm missing some critical information:

  • How do I tell mail.postfix2.com to accept relayed mail from postfix1.com?
  • How do I tell mail.postfix2.com to send the relayed mail on to the destination?
  • How do I change the port in which mail.postfix2.com accepts the relayed mail on?

Here are the basic configuration parameters:

Postfix Server 1:

main.cf:

myhostname = postfix1.com
relayhost = mail.postfix2.com
mydestination = postfix1.com, localhost.postfix1.com, localhost, mail.postfix2.com
inet_interfaces = all

Postfix Server 2:

main.cf:

myhostname = mail.postfix2.com
mydomain = postfix2.com
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relay_domains = $mydestination
inet_interfaces = all

When I try relaying to mail.postfix2.com I get:

Oct 21 11:04:28 ns3312015 postfix/error[2538]: C016F47E75B5: to=<user@example.com>, relay=none, delay=25, delays=1.4/24/0/0.1, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to mail.postfix2.com[123.123.123.123]:25: Connection timed out)

Although I've got port 25 open I suspect the host is somehow blocking it, so I tried instead to use this parameter in my postfix1.com main.cf:

relayhost = mail.postfix2.com:587

and on postfix2.com I un-commented this in master.cf:

submission inet n   -   n   -   -   smtpd 

The response back was:

Oct 21 09:56:03 ns3312015 postfix/smtp[16154]: B8BB347E71F0: to=<user@example.com>, relay=mail.postfix2.com[123.123.123.123]:587, delay=1.4, delays=0.68/0.02/0.25/0.5, dsn=4.7.1, status=deferred (host mail.postfix2.com[123.123.123.123] said: 454 4.7.1 <user@example.com>: Relay access denied (in reply to RCPT TO command))

What do I need to do for mail.postfix2.com to accept the postfix1.com mail and send it on?

  • 1
    possible duplicate of Postfix relay mails from a single domain and IP – neutrinus Oct 21 '14 at 10:41
  • 1
    No, they are NOT duplicates! He wants config on both sides, between two postfixes, the so-named "duplicate" wanted help only on the receiver! – user259412 Oct 21 '14 at 11:58
  • Yeah, but he already made the sender by relayhost = mail.postfix2.com – neutrinus Oct 21 '14 at 12:07
  • Where is server 1, exactly? – Michael Hampton Oct 21 '14 at 12:14
5

Just put postfix1.com in mynetworks on mail.postfix2.com.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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