20 Sep
2025
20 Sep
'25
3:13 p.m.
Can you try
listen = $ENV:LAN_IPv4 , 127.0.0.1
note the space before comma
Aki
On 20/09/2025 15:46 EEST publists--- via dovecot
<[1]dovecot@dovecot.org> wrote:
Hi,
In a new dovecot 2.4 config I'm setting up a inet_listener for a
service.
I want to use an env var in `listen` expansion, like
service imap-login {
inet_listener imaps {
listen = %{env:LAN_IPv4}, 127.0.0.1
}
}
This
[2]https://doc.dovecot.org/2.4.1/core/settings/variables.html
says
"You can use special variables in several places:
All settings, except of type String without variables."
Reading
[3]https://doc.dovecot.org/2.4.1/core/summaries/settings.html#listen
`listen` directive allows
listen
Default *, ::
Value IP addresses
Unlike, for example
deliver_log_format
Default msgid=%{msgid}: %{message}
Value String without variables
which would be disallowed for "String without variables"
I CAN use env vars across almost all of my config.
But launch
systemctl start dovecot
fails with
dovecot[17358]: Fatal: service(imap-login) Can't resolve address
%{env:LAN_IPv4}: Name or service not known
OTOH replacing
- listen = %{env:LAN_IPv4}, 127.0.0.1
+ listen = 10.1.1.1, 127.0.0.1
solves the launch issue.
Like I said it works in other stanzas.
Am I configuring this right for `listen`?
Thanks,
Dave
_______________________________________________
dovecot mailing list -- [4]dovecot@dovecot.org
To unsubscribe send an email to [5]dovecot-leave@dovecot.org
References
Visible links
- mailto:dovecot@dovecot.org
- https://doc.dovecot.org/2.4.1/core/settings/variables.html
- https://doc.dovecot.org/2.4.1/core/summaries/settings.html#listen
- mailto:dovecot@dovecot.org
- mailto:dovecot-leave@dovecot.org