1 (edited by ketan.aagja 2016-10-19 02:22:48)

Topic: Sieve Vacation response not working using SOGO

============ Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: CentOS Linux release 7.2.1511 (Core)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? : Yes
- Related log if you're reporting an issue: Dovecot, Sogo
====

Hi,

I have been struggling to make it work for Vacation response using SOGO. I can see sogo.sieve file is automatically created when vacation is enabled from sogo webmail in MAILDIR/sieve directory.

dovecot-sieve.log shows following entries:


Oct 18 18:45:28 lda: Debug: auth input: myid@mydomain.com master_user=myid@mydomain.com home=/var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10/ mail=maildir:~/Maildir/ quota_rule=*:bytes=26843545600
Oct 18 18:45:28 lda: Debug: Added userdb setting: plugin/master_user=myid@mydomain.com
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Effective uid=2000, gid=2000, home=/var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10/
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota root: name=user backend=dict args=:proxy::quotadict
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota rule: root=user mailbox=* bytes=26843545600 messages=0
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=26843545600 (100%) messages=0 reverse=no command=quota-warning 100 myid@mydomain.com
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=25501368320 (95%) messages=0 reverse=no command=quota-warning 95 myid@mydomain.com
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=24159191040 (90%) messages=0 reverse=no command=quota-warning 90 myid@mydomain.com
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=22817013760 (85%) messages=0 reverse=no command=quota-warning 85 myid@mydomain.com
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota grace: root=user bytes=2684354560 (10%)
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: dict quota: user=myid@mydomain.com, uri=proxy::quotadict, noenforcing=0
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Namespace : type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir/
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: maildir++: root=/var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//Maildir, index=, indexpvt=, control=, inbox=/var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//Maildir, alt=
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: acl: initializing backend with data: vfile:/etc/dovecot/dovecot-acl:cache_secs=300
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: acl: acl username = myid@mydomain.com
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: acl: owner = 1
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: acl vfile: Global ACL directory: /etc/dovecot/dovecot-acl
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota root: name=user backend=dict args=:proxy::quotadict
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota rule: root=user mailbox=* bytes=1073741824 messages=0
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=1073741824 (100%) messages=0 reverse=no command=quota-warning 100 raw mail user
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=1020054732 (95%) messages=0 reverse=no command=quota-warning 95 raw mail user
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=966367641 (90%) messages=0 reverse=no command=quota-warning 90 raw mail user
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota warning: bytes=912680550 (85%) messages=0 reverse=no command=quota-warning 85 raw mail user
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Quota grace: root=user bytes=107374182 (10%)
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: dict quota: user=raw mail user, uri=proxy::quotadict, noenforcing=0
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt=
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: Destination address: myid@mydomain.com (source: user@hostname)
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: Pigeonhole version 0.4.2 initializing
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: executed before user's personal Sieve script(1): /var/vmail/sieve/dovecot.sieve
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: using the following location for user's Sieve script: /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: opening script 1 of 2 from /var/vmail/sieve/dovecot.sieve
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: loading script /var/vmail/sieve/dovecot.sieve
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: script binary /var/vmail/sieve/dovecot.svbin successfully loaded
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: binary save: not saving binary /var/vmail/sieve/dovecot.svbin, because it is already stored
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: executing script from /var/vmail/sieve/dovecot.svbin
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: opening script 2 of 2 from /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: loading script /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: script binary /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.svbin is not up-to-date
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: script `main script' from /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script successfully compiled
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: executing script from /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script
Oct 18 18:45:28 lda(myid@mydomain.com): Info: sieve: msgid=<CAFpv_ZPYDZoFo-jaaMAVag4dziwVEHWZtfoGSD3ENuEb2XM2Jw@mail.gmail.com>: discarded duplicate vacation response to <myid@gmail.com>
Oct 18 18:45:28 lda(myid@mydomain.com): Info: sieve: msgid=<CAFpv_ZPYDZoFo-jaaMAVag4dziwVEHWZtfoGSD3ENuEb2XM2Jw@mail.gmail.com>: stored mail into mailbox 'INBOX'

Auto created dovecot.sieve (linked to sogo.sieve ) in MAILDIR/sieve shows:

require ["vacation","variables"];
if allof ( not exists ["list-help", "list-unsubscribe", "list-subscribe", "list-owner", "list-post", "list-archive", "list-id", "Mailing-List"], not header :comparator "i;ascii-casemap" :is "Precedence" ["list", "bulk", "junk"], not header :comparator "i;ascii-casemap" :matches "To" "Multiple recipients of*" ) { if header :matches "Subject" "*" { set "subject" "${1}"; } vacation :days 1 :subject "Out Of Office: ${subject}" :addresses ["myid@mydomain.com"] text:
i am on vacation-- test
.
;
}

in above file days shows 1 which leads to:
If first email has been received from a sender it will send vacation response, if same user sends email again in 1 day, vacation response is not being sent.

Is there any way where we can force to send vacation response everytime whenever email comes only to sender?

I tried following plugin in dovecot.conf also just to test as sogo vacation settings allow days between responses section:

plugin {
  # Use vacation-seconds
  sieve_extensions = +vacation-seconds

  # One hour at minimum
  sieve_vacation_min_period = 1h

  # Ten days default
  sieve_vacation_default_period = 10d

  # Thirty days at maximum
  sieve_vacation_max_period = 30d
}

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Sieve Vacation response not working using SOGO

ketan.aagja wrote:

Is there any way where we can force to send vacation response everytime whenever email comes only to sender?

You already find the answer: Dovecot plugin 'vacation-seconds'. Maybe you can set the min period to a shorter time.

3 (edited by ketan.aagja 2016-10-19 18:44:01)

Re: Sieve Vacation response not working using SOGO

Tried vacation-seconds extension but no effect.

I think sogo interface shows setting of "Days between responses" starting from 1 day might be setting up sieve script accordingly.

Does dovecot replication replicate sieve scripts from MAIL dir? I think my dovecot replication is not replicating files from Sieve directory from primary to secondary server or vise versa.

4

Re: Sieve Vacation response not working using SOGO

Today I added vacation response over SOGo interface which automatically created files in MAILDIR as per provided screenshot.

However when I send an email from my gmail ID it still shows following:

Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: executing script from /var/vmail/sieve/dovecot.svbin
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: opening script 2 of 2 from /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: loading script /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: script binary /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.svbin is not up-to-date
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: script `main script' from /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script successfully compiled
Oct 18 18:45:28 lda(myid@mydomain.com): Debug: sieve: executing script from /var/vmail/vmail1/mydomain.com/m/y/myid-2016.10.07.18.27.10//sieve/dovecot.sieve;name=main script
Oct 18 18:45:28 lda(myid@mydomain.com): Info: sieve: msgid=<CAFpv_ZPYDZoFo-jaaMAVag4dziwVEHWZtfoGSD3ENuEb2XM2Jw@mail.gmail.com>: discarded duplicate vacation response to <myid@gmail.com>

How come it is still discarding vacation response email if it is set as new?

Post's attachments

sieve.png
sieve.png 11.86 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

5

Re: Sieve Vacation response not working using SOGO

ketan.aagja wrote:

Oct 18 18:45:28 lda(myid@mydomain.com): Info: sieve: msgid=<CAFpv_ZPYDZoFo-jaaMAVag4dziwVEHWZtfoGSD3ENuEb2XM2Jw@mail.gmail.com>: discarded duplicate vacation response to <myid@gmail.com>

It says "duplicate vacation response". That means Dovecot already sent a vacation response to <myid@gmail.com> in certain period. You should check "sieve_vacation_min_period" setting in Dovecot config file, if this email was sent in certain period, then this is expected.

6

Re: Sieve Vacation response not working using SOGO

Hi Zhang,

I have set min period on to seconds just to test out:

plugin {
  # Use vacation-seconds
  sieve_extensions = +vacation-seconds

  # One hour at minimum
  sieve_vacation_min_period = 10s

  # Ten days default
  sieve_vacation_default_period = 10d

  # Thirty days at maximum
  sieve_vacation_max_period = 30d
}

But I think its not getting applied or working if vacation response is set from SOGo. However I can confirm I enabled vacation response after 2 days for one account and tried sending email but entry is still same discarded duplicate vacation response to <myid@gmail.com>

Moreover when there is no files Maildir/sieve folder it means vacation response is not set. When we set vacation response automatically two files are created:

sogo.sieve
dovecot.sieve (linked to sogo.sieve)

After some time third file is visible (May be it might be generated once any auto email is fired from dovecot)

dovecot.svbin

Now if we disable vacation response from SOGo interface sogo.sieve and dovecot.sieve files gets deleted automatically but dovecot.svbin file remains there. Is this normal?

7

Re: Sieve Vacation response not working using SOGO

According to your first post in this thread, the sieve rule contains:

vacation :days 1 

That means the period is set to 1 day. You should change this in your sieve script to get it work.

8 (edited by ketan.aagja 2016-10-22 18:54:05)

Re: Sieve Vacation response not working using SOGO

Zhang,

vacation :days 1

Above was applied before setting up sieve_extensions = +vacation-seconds as it is default from SOGo Vacation setup.

I applied vacation-seconds extension and tried reducing min period from day 1 to seconds, however editing sogo.sieve file and changing settings of day 1 to seconds does not work.

9

Re: Sieve Vacation response not working using SOGO

Did you edit sogo.sieve manually?

SOGo stores sieve scripts in SQL db, then dump to file system and link to 'dovecot.sieve'. Manual modification to 'sogo.sieve' will be overrode each time you access sieve rules from SOGo web UI.

As a testing, how about try this:

*) Create a testing mail user, do not create any sieve rules for this user.
*) Create a sample vacation sieve rule and copy it to correct sieve path for this user. e.g. /var/vmail/vmail1/mydomain.com/m/y/i/myid-2016.10.07.18.27.10/sieve/dovecot.sieve.
*) Send testing email to this user and check Dovecot log file, does it work?

10 (edited by ketan.aagja 2016-10-22 20:05:07)

Re: Sieve Vacation response not working using SOGO

tried with simple default script just changing days to seconds parameters in dovecot.sieve

as stated in vacation extension page :
http://wiki2.dovecot.org/Pigeonhole/Sie … s/Vacation

sieve_vacation_min_period = 1d
    This specifies the minimum period that can be specified for the :days and :seconds tags of the vacation command. A minimum of 0 indicates that users are allowed to make the Sieve interpreter send a vacation response message for every incoming message that meets the other reply criteria (refer to RFC5230). A value of zero is however not recommended.

when sending email it generated error in log

sieve: info: started log at Oct 22 13:01:34.
main script: line 2: error: unknown tagged argument ':seconds' for the vacation command (reported only once at first occurence).
main script: error: validation failed.

sample script wrote:

require ["vacation"];
vacation :seconds 10 :subject "Out of Office" :addresses ["myid@mydomain"] text:
Hi

I am out of office.
;

11

Re: Sieve Vacation response not working using SOGO

Is "vacation-seconds" listed in the output of command below?

telnet localhost 4190

Sample output:

# telnet localhost 4190
...
"IMPLEMENTATION" "Dovecot Pigeonhole"
"SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave vacation-seconds"

12

Re: Sieve Vacation response not working using SOGO

yes its listed:

telnet localhost 4190 wrote:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
"IMPLEMENTATION" "Dovecot Pigeonhole"
"SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave vacation-seconds"
"NOTIFY" "mailto"
"SASL" "PLAIN LOGIN"
"STARTTLS"
"VERSION" "1.0"
OK "Dovecot ready."

13

Re: Sieve Vacation response not working using SOGO

It should work as expected, i have no idea why it doesn't work for you, doesn't make sense.

How about setup a new virtual machine for testing?

14

Re: Sieve Vacation response not working using SOGO

yep, I am testing on virtual machine only. Once it will start working I will put it into production.