2015-09-01 9:13 GMT+02:00 Gilles Chehade <[email protected]>: > Sorry, I'll explain more clearly. > > The sender appears in two places: > > - the protocol, where it is used in the MAIL FROM command; > - the DATA. where it is used in headers; > > Both do not have to match, this is actually a feature of SMTP. > > The decision to accept mail for delivery or relaying is based on the > protocol solely, it takes place before client event sends headers so > by the time a header has been received the route was already chosen. > > A ruleset can therefore only match a protocol-level sender and it is > not possible to match a sender in headers. If a client uses the same > header for protocol and headers, it will work, otherwise it will not > and you can't do much about it. > > Now what you want to do is still possible, but it requires more than > just a ruleset: > > - you need to add tagged listeners: > > listen on [...] port $port1 tag ROUTE_A > listen on [...] port $port2 tag ROUTE_B > listen on all > > > - you need to add rules that match these tagged listeners: > > accept tagged ROUTE_A from local [...] relay via host1 > accept tagged ROUTE_B from local [...] relay via host2 > > > - on your general listener you need to have a rule that passes the > message to a script of yours: > > accept from any for domain [....] deliver to mda [...]
OK, thank you very much for the very detailed explanation. However I have no idea what "for domain" I'm supposed to use here. The messages which have to go through $host1 or $host2 will have any possible recipient domain: gmail, yahoo, and several hundreds possible domains. I do not own the domains which will go through my script. If I put "for any", then I have this issue: http://paste.robbast.nl/9a34307c > - then you need this script to parse headers, extract senders and > resubmit the message to the listener that has the tag that > matches the route you want to take. > > > This is the same approach as used with dkimproxy and the like. Thanks, but I think I'll just give up. I'll put two OpenSMTPD instances on two isolated hosts, this just sounds way simpler. Thanks everyone. -- You received this mail because you are subscribed to [email protected] To unsubscribe, send a mail to: [email protected]
