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-le...@dovecot.org

References

   Visible links
   1. mailto:dovecot@dovecot.org
   2. https://doc.dovecot.org/2.4.1/core/settings/variables.html
   3. https://doc.dovecot.org/2.4.1/core/summaries/settings.html#listen
   4. mailto:dovecot@dovecot.org
   5. mailto:dovecot-le...@dovecot.org
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to