> So... Say I have a unresolvable hostname (e.g. host.mydomain.com)
> because of being inside an unaccessible intranet. The intranet has a
> smtp-server which relays mail for us inside the intranet. The problem
> is now that I want all the mail that is send from my machine which
> don't have a domain in the to-address to be rewritten so that it uses
> $myhostname instead of $myorigin. 
> 
> I can't set $myorigin to $myhostname as the smtp-servers outside the
> intranet will try to resolve the envelope-address (which would be
> host.mydomain.com) and fail, which mean that they'll reject the mail.
> And if I set $myorigin to $mydomain and change nothing else postfix
> will rewrite all the to-addresses that has no domain (e.g. "root") to
> <username>@$mydomain which will send the mails going from my daemons
> to the useraccount on our gateway (not something you want to do if you
> don't want to piss the admin off). So the best solution that I can
> think of is to make trivial-rewrite append $myhostname to the
> unqualified to-addresses instead of $myorigin, but I can't seem to
> find if and how this can be done... 
> Another choice I have is to make a virtual map with all the local
> addresses that should go to local addresses on my machine, but this
> seems risky as if I forget an address then those mails will go to the
> gateway... 

Address masquerading did what I needed. For those interested:
http://www.postfix.org/rewrite.html#masquerade

Patrick B�rjesson

-- 
Public key ID: 4C5AB0BF
Public key available at wwwkeys.pgp.net

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to