On Sunday, January 04, 2009 at 21:36 CET,
Nigel Gilbert <[email protected]> wrote:
> On 04/01/2009 20:11, "mouss" <[email protected]> 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:
>
> [email protected] 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.
[email protected] known.local.u...@localhost
> When the mail for an unknown user is relayed to surrey.ac.uk, will
> it appear to be addressed to [email protected] (although
> originally sent to [email protected])? 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
[email protected]