The link should be
https://www.gnu.org/software/findutils/manual/html_node/posix_002dextended-regular-expression-syntax.html
So backreferences are with backslash. E.g. \1
Markus
On 12/2/26 6:06 PM, Ben Hardill via dovecot wrote:
Yes,
It is logging
Dec 02 16:56:38 mail dovecot[33162]: auth(?,sasl:plain): Debug: Auth
request finished
Dec 02 16:56:38 mail dovecot[33162]: auth(?,sasl:plain): Debug:
delaying auth failure
I'm testing with
doveadm -Dv auth test hardillb@localhost
If I try
doveadm -Dv auth test hardillb
it logs
Dec 02 16:56:03 mail dovecot[33162]: auth(hardillb,sasl:plain): Debug:
pam: Performing passdb lookup
Dec 02 16:56:03 mail dovecot[33162]: auth-worker(hardillb)<33168>:
request [9]: Debug: pam: Performing passdb lookup
Dec 02 16:56:03 mail dovecot[33162]: auth-worker(hardillb)<33168>:
request [9]: Debug: pam: lookup service=dovecot
Dec 02 16:56:03 mail dovecot[33162]: auth-worker(hardillb)<33168>:
request [9]: Debug: pam: #1/1 style=1 msg=Password:
Dec 02 16:56:04 mail dovecot[33162]: auth-worker(hardillb)<33168>:
request [9]: Debug: pam: Finished passdb lookup
Dec 02 16:56:04 mail dovecot[33162]: auth(hardillb,sasl:plain): Debug:
pam: Finished passdb lookup
Dec 02 16:56:04 mail dovecot[33162]: auth(hardillb,sasl:plain): Debug:
Auth request finished
The '?' implies to me that the regexp is not outputting a string
correctly, if I replace the empty string in the regexp with a space, I
see
Dec 02 16:59:41 mail dovecot[33243]: auth( ,sasl:plain): Debug: pam:
Performing passdb lookup
Dec 02 16:59:41 mail dovecot[33243]: auth-worker( )<33247>: request
[2]: Debug: pam: Performing passdb lookup
Dec 02 16:59:41 mail dovecot[33243]: auth-worker( )<33247>: request
[2]: Debug: pam: lookup service=dovecot
Dec 02 16:59:41 mail dovecot[33243]: auth-worker( )<33247>: request
[2]: Debug: pam: #1/1 style=1 msg=Password:
Dec 02 16:59:44 mail dovecot[33243]: auth-worker( )<33247>: request
[2]: Debug: pam: Finished passdb lookup
Dec 02 16:59:44 mail dovecot[33243]: auth( ,sasl:plain): Debug: pam:
Finished passdb lookup
Dec 02 16:59:44 mail dovecot[33243]: auth( ,sasl:plain): Debug:
passwd-file: Performing passdb lookup
Dec 02 16:59:44 mail dovecot[33243]: auth( ,sasl:plain): Debug:
passwd-file: lookup: user= file=/etc/dovecot/users
Dec 02 16:59:44 mail dovecot[33243]: auth( ,sasl:plain): passwd-file:
unknown user
Dec 02 16:59:44 mail dovecot[33243]: auth( ,sasl:plain): Debug:
passwd-file: Finished passdb lookup
Dec 02 16:59:44 mail dovecot[33243]: auth( ,sasl:plain): Debug: Auth
request finished
Dec 02 16:59:44 mail dovecot[33243]: auth( ,sasl:plain): Debug:
delaying auth failure
I wonder if we need something like
regexp("(*.)@localhost$", "$1")
This doesn't work and just outputs '$1' so I need to know what the
group output syntax is (and the link
https://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended-regular-expression-syntax.html
in the docs is broken)
Ben
On 02/12/2026 16:40, Aki Tuomi wrote:
Did you try enabling log_debug=category=auth to see what happens?
Aki
On 02/12/2026 10:48 EET Ben Hardill via dovecot
<[email protected]> wrote:
Hello, Thanks for the suggestion, but it's still not working, I
sitll get
User doesn't exist: hardillb@localhost (in reply to RCPT TO command)
when trying to deliver email to this user with the following in the
20-lmtp.conf (both versions)
protocol lmtp {
auth_username_format = %{user | regexp("@localhost$", "") | lower}
# auth_username_format = %{user | lower | regexp("@localhost", "")}
}
but if I use
protocol lmtp {
auth_username_format = %{user | username | lower}
}
it works for this user, but not the ones that get looked up with the
none `@localhost` domains, they get looked up in a dedicated users file
with usernames that include the domain. (The @localhost users are
looked
up via PAM hence needing to stip the domain)
I've also tried it in the 10-auth.conf file as well but same problem
Let me know if you need more informaton.
Ben Hardill
On 02/12/2026 06:32, Aki Tuomi wrote:
That's not how it works. What you want is %{user | lower |
regexp("@localhost", "")}
Aki
On 01/12/2026 15:20 EET Ben Hardill via dovecot
<[email protected]> wrote:
Hi,
I'm trying to migate an old if statement and I can't get it to work
auth_username_format = %{if;%d;eq;localhost;%Ln;%Lu}
I think it should be something like
auth_username_format = %{user | domain | if ('eq', 'localhost', {user
|username}, user) | lower }
but it throws errors when about the {} round user | username or
the | if
I remove them.
Any suggestions?
The bigger picture is I have a mix of vitrual users and real local
users
and a alias that remaps the local users
--
https://www.hardill.me.uk/wordpress
https://github.com/hardillb
https://about.me/hardillb
https://flickr.com/photos/hardillb/
https://keybase.io/hardillb
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
--
https://www.hardill.me.uk/wordpress
https://github.com/hardillb
https://about.me/hardillb
https://flickr.com/photos/hardillb/
https://keybase.io/hardillb
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]