]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-storage: Add variable aliases
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Wed, 30 Dec 2020 10:02:56 +0000 (10:02 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 11 Jan 2021 15:08:14 +0000 (15:08 +0000)
Accept new aliases "local_ip" (="lip") and "remote_ip" (="rip") when expanding
variables.

src/lib-storage/mail-storage-service.c
src/lib-storage/mail-user.c

index 1d3ea9d3d47b118bd11ec94921786907fa08be6c..1599267908d24091b035c50a7f7d7a255f55d1c4 100644 (file)
@@ -432,6 +432,9 @@ get_var_expand_table(struct master_service *service,
                { '\0', auth_user, "auth_user" },
                { '\0', auth_username, "auth_username" },
                { '\0', auth_domain, "auth_domain" },
+               /* aliases: */
+               { '\0', net_ip2addr(&input->local_ip), "local_ip" },
+               { '\0', net_ip2addr(&input->remote_ip), "remote_ip" },
                { '\0', NULL, NULL }
        };
        struct var_expand_table *tab;
index f58017937f610749be1b2ea19f78bab4fdff5318..1e2546b208308ac310bafe45286d84b7547a4519 100644 (file)
@@ -310,6 +310,9 @@ mail_user_var_expand_table(struct mail_user *user)
                { '\0', auth_username, "auth_username" },
                { '\0', auth_domain, "auth_domain" },
                { '\0', user->set->hostname, "hostname" },
+               /* aliases: */
+               { '\0', local_ip, "local_ip" },
+               { '\0', remote_ip, "remote_ip" },
                /* NOTE: keep this synced with imap-hibernate's
                   imap_client_var_expand_table() */
                { '\0', NULL, NULL }