Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Oct 09, 2014 4:53 pm 
Offline
Newbie

Joined: Thu Oct 09, 2014 4:32 pm
Posts: 3
Hi,

I have two linodes, one for my personal use (domain1.com) the does web and email for me and a few friends, and one for an organization I help out (domain2.com). I've followed the postfix/dovecot/mysql tutorial (which was very good), my setup is exactly that on domain1.com but with a commercially-signed certificate. Domain2.com only receives email for domain2 (and forwards it to individual email addresses elsewhere), and only sends server-side email like forgotten password links from web-apps.

I would like avoid user-email on domain 2, which means that to send as domain2.com (with reverse DNS, SPF etc) I'd like to relay from domain1.com to domain2.com, but only when sending as me@domain2.com. Everything else should be sending as normal, with DNS lookup/routing etc.

I did a little diagram to help:
Image

I'm struggling to work out what settings I need on each server, can anyone help, or provide keywords to assist my googling? "relay" isn't really working very well!

Also, if it's easier, it would be ok to use the username as the switch for whether to use domain2.com for SMTP, rather than sender address.


Top
   
PostPosted: Thu Oct 09, 2014 7:24 pm 
Offline
Newbie

Joined: Thu Oct 09, 2014 4:32 pm
Posts: 3
I think I've worked this out, in the mail.cf for postfix on domain1 add:
Code:
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_dependent_relayhost_maps


The sender_dependent_relayhost_maps file includes lines such as:
Code:
me@domain2.com     [domain2.com]:25


You then hash that file:
Code:
#postmap sender_dependent_relayhost_maps

And reload postfix.

Then on domain2.com's main.cf add the IP address of domain1.com to the mynetworks setting, e.g.
Code:
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128, 123.123.123.123


And reload postfix.

Does that seem right? It works, have I opened up any issues?


Top
   
PostPosted: Sun Oct 12, 2014 12:38 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
The concern that comes to mind is that because domain2.com trusts mail from domain1.com, whether someone can trick domain1.com into routing spam through domain2.com.

I'm not deeply familiar with this corner of Postfix but it looks like this shouldn't be a problem unless you have changed allow_untrusted_routing to yes. Old standards (and even older practice) allowed the sender to specify the route a message would take through multiple mailservers. This is now deprecated, but these things have a way of hanging on. It seems like the allow_untrusted_routing setting in Postfix will prevent this.


Top
   
PostPosted: Sun Oct 12, 2014 3:35 pm 
Offline
Newbie

Joined: Thu Oct 09, 2014 4:32 pm
Posts: 3
The allow_untrusted_routing defaults to no, and it doesn't feature in my main.cf.

I think the relevant bit for who can send is:

Code:
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination


Thanks for thinking about it.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group