Yes, thanks for your suggestion. I tried it and it works. I kept on thinking that it would work if I just set:
mydestination = postfix-server.mydomain.com $myhostname would work (I have set myhostname=postfix-server.mydomain.com). It turns out that I also need to set myorigin, and also need to specifically set "mydestination = $myorigin ....". Now, both \username and |/usr/bin/vacation work as expected! Thanks! Dominic On 28/8/2020 11:47 am, Viktor Dukhovni wrote: > On Fri, Aug 28, 2020 at 03:42:20AM +0000, Dominic Lai wrote: > >> Aug 28 10:11:36 postfix-server postfix/local[3915542]: 2D8F33028D88: >> to=<usern...@postfix-server.mydomain.com>, relay=local, >> delay=0.06, delays=0.05/0/0/0.01, dsn=5.4.6, status=bounced (mail >> forwarding loop for usern...@postfix-server.mydomain.com) >> >> When I look at dovecot log (I have got mail_log plugins on), and >> I note that postfix bounced this message even before handling it >> to dovecot-lda (ie. dovecot-lda does not even record any handling of >> this transaction). >> >> However, if I changed the .forward as follows: >> >> username@localhost, "|/usr/bin/vacation username" >> >> Then vacation works, username can also receive a copy of email. > > This likely because $myorigin is not listed in $mydestination, > and so just a bare "username" in aliases(5) or .forward files > is not a reference to an address in "local" address class. > > You either need to ensure that $myorigin is listed in > $mydestination, or else to use explicit local domains > in .forward files and aliases(5) files as you noted. > -- Dominic Lai Department of Computer Science and Engineering HKUST