Hi all,
I have a legacy system that uses gnarwl to handle vacation messages, most specifically the vacation messages are stored in LDAP. We have a web based tool that allows people to update their vacation message, all they’re doing is modifying LDAP.
I am trying to find out if dovecot’s vacation sieve can do the same thing. I am struggling however to find something that describes to me how dovecot vacation sieve is configured. Is there a howto or walkthrough anywhere?
Specific burning questions:
If I was to configure the dovecot vacation sieve, where is the body of each vacation message stored? File on disk? In a store like an LDAP store? Somewhere else?
How is the body of vacation message modified? Does this happen through the IMAP protocol, a command line tool, something else?
How is the vacation message switched on and off? Does this happen through the IMAP protocol, a command line tool, or something else?
The docs at https://wiki2.dovecot.org/Pigeonhole/Sieve/Extensions/Vacation describe how to control how often the vacation messages are sent, but very little else. I am very confused :(
Regards, Graham —
It is just a sieve rule.
On disk default file .dovecot.sieve
I am using roundcube webmail for that.
with if false # true
rule:[Out of Office]
if true { vacation :days 1 :subject "Test" "test test"; }
-----Original Message----- From: Graham Leggett [mailto:minfrin@sharp.fm] Sent: woensdag 23 september 2020 14:03 To: dovecot@dovecot.org Subject: Vacation sieve explained: how does it work?
Hi all,
I have a legacy system that uses gnarwl to handle vacation messages, most specifically the vacation messages are stored in LDAP. We have a web based tool that allows people to update their vacation message, all they’re doing is modifying LDAP.
I am trying to find out if dovecot’s vacation sieve can do the same thing. I am struggling however to find something that describes to me how dovecot vacation sieve is configured. Is there a howto or walkthrough anywhere?
Specific burning questions:
If I was to configure the dovecot vacation sieve, where is the body of each vacation message stored? File on disk? In a store like an LDAP store? Somewhere else?
How is the body of vacation message modified? Does this happen through the IMAP protocol, a command line tool, something else?
How is the vacation message switched on and off? Does this happen through the IMAP protocol, a command line tool, or something else?
The docs at https://wiki2.dovecot.org/Pigeonhole/Sieve/Extensions/Vacation describe how to control how often the vacation messages are sent, but very little else. I am very confused :(
Regards, Graham —
On 23 Sep 2020, at 14:07, Marc Roos <M.Roos@f1-outsourcing.eu> wrote:
It is just a sieve rule.
On disk default file .dovecot.sieve
I am using roundcube webmail for that.
with if false # true
rule:[Out of Office]
if true { vacation :days 1 :subject "Test" "test test"; }
Is there a way to inject variables from the userdb into the above?
For example, if I was to pass the vacation message attribute through the userdb lookup, could I then test if the variable was present, and then embed that variable in the message?
Regards, Graham —
You can do whatever you like, as long as the result is this 'text' file. I have also bash file that modifies this file for users. You can make a 5 min cron job that detects changes in ldap and then creates the sieve rule.
-----Original Message----- Cc: dovecot Subject: Re: Vacation sieve explained: how does it work?
It is just a sieve rule.
On disk default file .dovecot.sieve
I am using roundcube webmail for that.
with if false # true
rule:[Out of Office]
if true { vacation :days 1 :subject "Test" "test test"; }
Is there a way to inject variables from the userdb into the above?
For example, if I was to pass the vacation message attribute through the userdb lookup, could I then test if the variable was present, and then embed that variable in the message?
Regards, Graham —
On 23 Sep 2020, at 14:29, Marc Roos <M.Roos@f1-outsourcing.eu> wrote:
You can do whatever you like, as long as the result is this 'text' file. I have also bash file that modifies this file for users. You can make a 5 min cron job that detects changes in ldap and then creates the sieve rule.
I've tried the cronjob approach before, and people didn’t like the delay.
I have found the extra fields being queried from the userdb,
user_attrs = mailMessageStore=home=%$,=mail_auto_reply_mode=%{ldap:mailAutoReplyMode},=mail_auto_reply_text=%{ldap:mailAutoReplyText}
Is it possible to confirm how the mail_auto_reply_mode variable would be available in sieve? Is it just a case of referring to ${mail_auto_reply_mode} or is there more to it than that?
Regards, Graham —
On 23 Sep 2020, at 08:52, Graham Leggett <minfrin@sharp.fm> wrote:
On 23 Sep 2020, at 14:29, Marc Roos <M.Roos@f1-outsourcing.eu> wrote:
You can do whatever you like, as long as the result is this 'text' file. I have also bash file that modifies this file for users. You can make a 5 min cron job that detects changes in ldap and then creates the sieve rule.
I've tried the cronjob approach before, and people didn’t like the delay.
If people cannot deal with a delay of a minute or five, increase the interval to 12 hours, or even better, "changes will take affect at 6am the next business day."
That'll learn 'em.
-- A clear conscience is usually the sign of a bad memory.
On 23 Sep 2020, at 21:51, @lbutlr <kremels@kreme.com> wrote:
If people cannot deal with a delay of a minute or five, increase the interval to 12 hours, or even better, "changes will take affect at 6am the next business day."
That'll learn ‘em.
We like our users, and they like us :)
We’re pulling the value of the vacation message like this:
user_attrs = mailMessageStore=home=%$,=mail_auto_reply_mode=%{ldap:mailAutoReplyMode},=mail_auto_reply_text=%{ldap:mailAutoReplyText}
So far the sieve that I have looks like this:
#
require ["fileinto", "mailbox"]; require ["vacation", "variables"];
# fileinto: for putting mail into a imap folder # mailbox: for creating imap folder if not exists # if header :contains "X-Spam-Flag" "YES" { # move mail into folder Junk, create folder if not exists fileinto :create "Junk"; stop; }
if string :matches "${mail_auto_reply_mode}" "reply" { if header :matches "subject" "*" { vacation :subject "AutoReply: ${1}" "${mail_auto_reply_text}"; } }
And sieve-test looks like this:
sieve-test(root): Debug: sieve: Pigeonhole version 0.5.8 (b7b03ba2) initializing
sieve-test(root): Debug: sieve: include: sieve_global is not set; it is currently not possible to include :global' scripts. debug: file storage: Using Sieve script path: /var/lib/dovecot-sieve/default.sieve. debug: file script: Opened script
default' from `/var/lib/dovecot-sieve/default.sieve'.
debug: Script binary /var/lib/dovecot-sieve/default.svbin successfully loaded.
debug: binary save: not saving binary /var/lib/dovecot-sieve/default.svbin, because it is already stored.
Performed actions:
(none)
Implicit keep:
- store message in folder: INBOX
sieve-test(root): Info: final result: success
Effectively no vacation message was detected.
Is the variable syntax or ${mail_auto_reply_text} correct, or is there a namespace I should be using?
Regards, Graham —
On 23. Sep 2020, at 15.15, Graham Leggett <minfrin@sharp.fm> wrote:
On 23 Sep 2020, at 14:07, Marc Roos <M.Roos@f1-outsourcing.eu> wrote:
It is just a sieve rule.
On disk default file .dovecot.sieve
I am using roundcube webmail for that.
with if false # true
rule:[Out of Office]
if true { vacation :days 1 :subject "Test" "test test"; }
Is there a way to inject variables from the userdb into the above?
For example, if I was to pass the vacation message attribute through the userdb lookup, could I then test if the variable was present, and then embed that variable in the message?
Pigeonhole can read sieve scripts from ldap too https://wiki.dovecot.org/Pigeonhole/Sieve/Configuration/LDAP <https://wiki.dovecot.org/Pigeonhole/Sieve/Configuration/LDAP>
Sami
On 23 Sep 2020, at 15:37, Sami Ketola <sami.ketola@dovecot.fi> wrote:
Pigeonhole can read sieve scripts from ldap too https://wiki.dovecot.org/Pigeonhole/Sieve/Configuration/LDAP <https://wiki.dovecot.org/Pigeonhole/Sieve/Configuration/LDAP>
Thanks for confirming this - it will need some updates to our LDAP, but this is another thing for us to try.
Regards, Graham —
participants (4)
-
@lbutlr
-
Graham Leggett
-
Marc Roos
-
Sami Ketola