On Sunday, January 04, 2009 at 21:36 CET, Nigel Gilbert <n.gilb...@surrey.ac.uk> wrote:
> On 04/01/2009 20:11, "mouss" <mo...@ml.netoyen.net> wrote: > > > the question is whether some users may be rejected by the second > > server. if so, they must also be rejected by the first one. > > > > if this is ok, then simply declare the domain as a relay domain and > > use virtual_alias_maps to deliver some users locally. > > May I ask for one more level of detail about how to do this? I am new > to postfix. > > " simply declare the domain as a relay domain" > > I add > relay_domains = surrey.ac.uk > to main.cf. Correct? Yes, if you don't already have a relay_domains line. In that case add surrey.ac.uk to that line. If a variable is specified multiple times the last assignment wins. > "use virtual_alias_maps to deliver some users locally" > > I add > virtual_alias_maps = hash:/etc/postfix/virtual > to main.cf > > In the file hash:/etc/postfix/virtual I put: > > known.local.us...@soc.surrey.ac.uk known.local.user > Etc. > > And then run postmap /etc/postfix/virtual > > Is that right? Yes, but beware that the right-hand side of the virtual alias table doesn't necessarily denote a local user. If the address isn't fully qualified it will be qualified with @$myorigin, and $myorigin isn't necessarily a local domain. It's good practice to explicitly state the domain and choose a domain that's always local (i.e. listed in mydestination). "localhost" is a typical choice. known.local.us...@soc.surrey.ac.uk known.local.u...@localhost > When the mail for an unknown user is relayed to surrey.ac.uk, will > it appear to be addressed to unknown.u...@surrey.ac.uk (although > originally sent to unknown.u...@soc.surrey.ac.uk)? It needs to be, > because otherwise surrey.ac.uk will just send it back to > soc.surrey.ac.uk! When acting as a relay Postfix will not alter any recipient addresses. If you want to rewrite soc.surrey.ac.uk to surrey.ac.uk use the virtual alias table. @soc.surrey.ac.uk @surrey.ac.uk -- Magnus Bäck mag...@dsek.lth.se