Skip to content
Snippets Groups Projects
Commit 07ef39ee authored by Stephan Bosch's avatar Stephan Bosch
Browse files

lda-sieve: fall back to global recipient_delimiter setting if...

lda-sieve: fall back to global recipient_delimiter setting if plugin/recipient_delimiter is not set.
parent d9c2d870
No related branches found
No related tags found
No related merge requests found
......@@ -42,13 +42,13 @@ static deliver_mail_func_t *next_deliver_mail;
static const char *lda_sieve_get_homedir
(void *context)
{
struct mail_user *mail_user = (struct mail_user *) context;
struct mail_deliver_context *mdctx = (struct mail_deliver_context *)context;
const char *home = NULL;
if ( mail_user == NULL )
if ( mdctx == NULL || mdctx->dest_user == NULL )
return NULL;
if ( mail_user_get_home(mail_user, &home) <= 0 )
if ( mail_user_get_home(mdctx->dest_user, &home) <= 0 )
return NULL;
return home;
......@@ -57,12 +57,19 @@ static const char *lda_sieve_get_homedir
static const char *lda_sieve_get_setting
(void *context, const char *identifier)
{
struct mail_user *mail_user = (struct mail_user *) context;
struct mail_deliver_context *mdctx = (struct mail_deliver_context *)context;
const char *value = NULL;
if ( mail_user == NULL )
if ( mdctx == NULL )
return NULL;
return mail_user_plugin_getenv(mail_user, identifier);
if ( mdxtx->dest_user == NULL ||
(value=mail_user_plugin_getenv(mail_user, identifier)) == NULL ) {
if ( strcmp(identifier, "recipient_delimiter") == 0 )
value = mdctx->set->recipient_delimiter;
}
return value;
}
static const struct sieve_environment lda_sieve_env = {
......@@ -665,7 +672,7 @@ static int lda_sieve_deliver_mail
/* Initialize Sieve engine */
svinst = sieve_init(&lda_sieve_env, mdctx->dest_user, debug);
svinst = sieve_init(&lda_sieve_env, mdctx, debug);
/* Initialize master error handler */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.