Hmm, actually it is set -

root@ns:/usr/local/etc/dovecot # dovecot -a | grep auth_username_format
auth_username_format = %Ln

Oddly, it now seems to work once I made this change -

root@ns:/usr/local/etc/dovecot # dovecot -a | grep -A5 "protocol lmtp"
protocol lmtp {
  # Added explicit hostname
  hostname = ns.mahan.org
  mail_fsync = optimized
  mail_plugins = " sieve"
}

I now see -

root@ns:/usr/local/etc/dovecot # tail -f /var/log/maillog | grep "mahan@mahan.org"
Mar 31 08:54:47 ns postfix/lmtp[74403]: 7871EA2DFB5: to=<mahan@mahan.org>, relay=ns.mahan.org[private/dovecot-lmtp], delay=1.9, delays=1.8/0.01/0.01/0.01, dsn=2.0.0, status=sent (250 2.0.0 <mahan@mahan.org> t1FFEMfioFykIgEAYVf4yg Saved)

So I guess it is working? :-)

Thanks,

Patrick


On Sun, Mar 31, 2019 at 7:56 AM Aki Tuomi via dovecot <dovecot@dovecot.org> wrote:

On 31 March 2019 17:41 Jerry via dovecot < dovecot@dovecot.org> wrote:


On Thu, 28 Mar 2019 05:22:37 -0700, Patrick Mahan via dovecot stated:

>FreeBSD 11.2
>Postfix 3.3.2
>Dovecot 2.3.4
>
>I am trying to use dovecot lmtp with postfix to verify authentication
>of incoming email and to avoid being a spam relay (an issue I was
>having using sendmail as my MTA).
>
>I am getting the following log message in /var/log/maillog:
>
>Mar 30 20:31:38 ns postfix/smtpd[40373]: NOQUEUE: reject: RCPT from
>mail-eopbgr750091.outbound.protection.outlook.com[40.107.75.91]: 450
>4.1.1 < mahan@mahan.org>: Recipient address rejected: unverified
>address: host ns.mahan.org[private/dovecot-lmtp] said: 550 5.1.1
>< mahan@mahan.org> User doesn't exist: mahan@mahan.org (in reply to
>RCPT TO command); from=< pmahan@silver-peak.com> to=< mahan@mahan.org>
>proto=ESMTP helo=< NAM02-BL2-obe.outbound.protection.outlook.com>
>
>'mahan' does exist on ns.mahan.org. So I am confused to why lmtp is
>failing to find this username.
>
>Thanks,
>
>Patrick
>

You probably shuld be asking this on the Postfix forum. Have you read
< ">http://www.postfix.org/ADDRESS_VERIFICATION_README.html>? You also
have "smtpd_reject_unlisted_recipient" options. You really need to post
the output of "postconf -nf" and perhaps "postconf -Mf".

--
Jerry

I would try setting

auth_username_format=%Ln 

as otherwise domain part is included in username lookup...
---
Aki Tuomi