I’ve posed this question to the dovecot mailing list as well, but I’m asking here also because I think this more likely something that I’ve missed or misconfigured in postfix than dovecot.
Sending mail from a local address to gmail, I’d expect it to be forwarded through the configured relay host (the IMAP server doesn’t have direct internet accesss, only the relay box.):
I’ve got postfix setup to use dovecot-lmtp for (virtual) user delivery, and things to users or aliases that Dovecot knows about now get delivered correctly. However, I’ve done something wrong with postfix and/or the LMTP configuration because upon RCPT TO, instead of forwarding the mail off to the configured smartest, somehow dovecot-lmtp is ending up in the mix. (Perhaps this is more a postfix question than a dovecot one, but, I’ll start here.)
> 2019-08-11T15:38:40+00:00 81716ec5-bca4-6d53-ed81-bd1a55d46b4f postfix/lmtp: [ID 197553 mail.info] 12327F13D: to=<[hidden email]>, relay=81716ec5-bca4-6d53-ed81-bd1a55d46b4f.localdomain[private/dovecot-lmtp], delay=55, delays=55/0.01/0/0.03, dsn=5.1.1, status=bounced (host 81716ec5-bca4-6d53-ed81-bd1a55d46b4f.localdomain[private/dovecot-lmtp] said: 550 5.1.1 <[hidden email]> User doesn't exist: [hidden email] (in reply to RCPT TO command))
> Shouldn’t the mail to gmail.com be punted off to the relay host, rather than getting lost in the LMTP agent?