----- Message from Simon Wilson <[email protected]> ---------
    Date: Wed, 24 Mar 2021 09:57:37 +1000
    From: Simon Wilson <[email protected]>
Reply-To: [email protected]
 Subject: Re: Setting up virtual alias domains and maps - failing to deliver
      To: [email protected]


----- Message from Noel Jones <[email protected]> ---------
    Date: Tue, 23 Mar 2021 12:46:29 -0500
    From: Noel Jones <[email protected]>
Reply-To: [email protected]
 Subject: Re: Setting up virtual alias domains and maps - failing to deliver
      To: [email protected]

On 3/23/2021 6:31 AM, Simon Wilson wrote:


Changes:

mydestination - removed, left as default

Don't do that. Set it to something specific maybe "localhost.local"

virtual_alias_domains = simonandkate.lan, simonandkate.net, etc...
virtual_alias_maps = hash:/etc/postfix/virtual (and postmapped)
Removed all virtual alias domain entries from aliases and run newaliases

The domain alias appears valid:
[root@emp87 postfix]# postmap -q [email protected] hash:/etc/postfix/virtual
katie

virtual aliases should always use a fully qualified email address, such as [email protected]

 -- Noel Jones

Combining postconf -d/-n, naming is:

  mydestination = $myhostname, localhost.$mydomain, localhost  (i.e. default)
myhostname = mail.simonandkate.net (specified in main.cf)
  mydomain = simonandkate.lan                                  (i.e. default)
  myorigin = $myhostname                                       (i.e default)

...that pans out to:

mydestination = mail.simonandkate.net, localhost.simonandkate.lan, localhost
  myhostname = mail.simonandkate.net
  mydomain = simonandkate.lan
  myorigin = mail.simonandkate.net

On your second point, 'virtual' is written like this:

   #                simonandkate.net
   [email protected]      simon

...which I will correct, note questions later.

I think the combination of naming and 'not-FQ aliases' is contributing to the following in pflogsumm reporting (extract for clarity):

Recipients by message count
---------------------------
    519   [email protected]
     40   [email protected]
     98   [email protected]
      2   [email protected]

Mail is getting delivered but with address variation to the final destination. Note also the example at the bottom of this email, where [email protected] is getting changed to [email protected]

Questions:
1. in virtual, do alias addresses always map out to $mydestination-resolvable addresses? I.e. does it need to be [email protected] --> simon@something-in-$mydestination? 2. Is there a way to keep the address as the original recipient (as it was when the domains were under mydestination) for things like pflogsumm reporting? 3. Are there better options for my mydestination, myhostname, mydomain, myorigin which will assist?

Thanks so much for the help Noel, Viktor, Matus.
Simon


Example:

Mar 24 09:29:49 emp87 postfix/lmtp[413570]: BDED91819ED: to=<[email protected]>, orig_to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.4, delays=1.2/0.01/0/4.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as BF46F1819EE) Mar 24 09:29:50 emp87 postfix/lmtp[413577]: BF46F1819EE: to=<[email protected]>, relay=mail.simonandkate.net[/run/cyrus/socket/lmtp], delay=0.28, delays=0.01/0/0.01/0.26, dsn=2.1.5, status=sent (250 2.1.5 Ok SESSIONID=<cyrus-413438-1616542189-2-830271575779132882>)


----- End message from Simon Wilson <[email protected]> -----

It all makes sense now after (re-)reading all about address rewriting, aliases, myorigin, etc. Thanks Noel, Viktor and Matus for your patience. I now understand the reason having myorigin set to a virtual alias listed domain like simonandkate.net broke delivery. It did so *because my aliases were not FQ*. I.e. for the alias "[email protected] simon", Postfix appended myorigin (append_at_myorigin (default: yes)), so it became [email protected] and went nowhere.

I now have it fully functioning, with virtual alias domains, etc., and I understand WHY it works...

mydestination is now set to the default ($myhostname, localhost.$mydomain, localhost) PLUS a new one, mail.local:
  mydestination = $myhostname, localhost.$mydomain, localhost, mail.local

virtual_alias_domains contains all the domain names to check for aliases
  virtual_alias_domains =  simonandkate.lan,
                           simonandkate.net,
                           etc

virtual_alias_maps is defined for containing all of the aliases:
  virtual_alias_maps = hash:/etc/postfix/virtual

Aliases in /etc/postfix/virtual are now all in the form:
  [email protected]   [email protected]

myhostname is per my externally visible resolvable MX and expected HELO:
  myhostname = mail.simonandkate.net

mydomain is the default myhostname minus first component, so is effectively:
  mydomain = simonandkate.net

myorigin is left at default ($myhostname) which resolves to be:
  myorigin = mail.simonandkate.net
...which means any non-domain-addressed mail FROM local sources become (e.g.) root.emp87 --> [email protected], which I masquerade to [email protected], so that is all good too.

I'm now assuming that end of day reporting will show number of deliveries to @mail.local end points, which makes sense from a delivery point of view. Would be interesting to see if I can get information on addressed recipients, i.e. pre-aliasing?

Last thing to do is look at what is in /etc/aliases for local aliasing, and per previous advice look at bringing it all together.

Simon.


--
Simon Wilson
M: 0400 12 11 16

Reply via email to