On Thu, Apr 08, 2010 at 09:59:54PM +1000, James Lever wrote: > > On 25/03/2010, at 11:43 AM, James Lever wrote: > > > This still doesn?t solve the issue of local destination mail - mail sent > > via ?mail user? or ?mail u...@$myhostname? from the local system still gets > > delivered to the mail spool. This is the key part that I?m still trying to > > solve. > > > For anybody else that comes along, I discovered 2 methods to easily do what I > wanted. > > Method 1: > > Enable envelope_sender masquerading (non-default behaviour). > > edit masquerade_classes to include envelope_recipient, for example: > > masquerade_classes = envelope_sender, envelope_recipient, header_sender, > header_recipient > > along with > > masquerade_domains = $mydomain > masquerade_exceptions = root, mailer-daemon, logwatch
Seems to me that $myorigin = $mydomain achieves the result more cleanly. Mail for root can be handled via virtual(5) and generic(5). > Method 2: > > This method can provide significantly greater flexibility, but bypasses all > local delivery attempts including alias expansion, so any aliases need to be > defined in /etc/postfix/virtual and the regexp needs to exclude it (from my > minimal testing of this method) > > local_transport = virtual > virtual_alias_maps = regexp:/etc/postfix/virtual > > in /etc/postfix/virtual have an entry similar to this > > /(.*)@/ $...@somedomain.com > > > Hopefully that?s the right way to do the second one. This looks fragile. -- Viktor. P.S. Morgan Stanley is looking for a New York City based, Senior Unix system/email administrator to architect and sustain our perimeter email environment. If you are interested, please drop me a note.