Sieve coding question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Sieve coding question

Roger B.A. Klorese
Is there a more appropriate list on which to ask for assistance in
coding Sieve rules, or may I ask here?
Reply | Threaded
Open this post in threaded view
|

Re: Sieve coding question

Stephan Bosch-2
Op 11/16/2017 om 7:42 PM schreef [hidden email]:
> Is there a more appropriate list on which to ask for assistance in
> coding Sieve rules, or may I ask here?

I know of no other suitable venue, so go ahead.

Regards,

Stephan.
Reply | Threaded
Open this post in threaded view
|

Re: Sieve coding question

Roger B.A. Klorese
On 11/16/17 11:03 AM, Stephan Bosch wrote:
> Op 11/16/2017 om 7:42 PM schreef [hidden email]:
>> Is there a more appropriate list on which to ask for assistance in
>> coding Sieve rules, or may I ask here?
> I know of no other suitable venue, so go ahead.
>
> Regards,
>
> Stephan.


I have the following as the last rule:

if anyof (header :contains "x-spam-flag" "YES", header :contains
"subject" "*****SPAM*****")
{
     fileinto "INBOX.Junk";
     stop;
}

It seems to fire not only when mail is first retrieved, but if a message
is moved back into INBOX (so it moves back to Spam). Any suggestions on
how to make it fire only on initial processing?
Reply | Threaded
Open this post in threaded view
|

Re: Sieve coding question

Stephan Bosch-2
Op 11/17/2017 om 9:29 PM schreef Roger B.A. Klorese:

> On 11/16/17 11:03 AM, Stephan Bosch wrote:
>> Op 11/16/2017 om 7:42 PM schreef [hidden email]:
>>> Is there a more appropriate list on which to ask for assistance in
>>> coding Sieve rules, or may I ask here?
>> I know of no other suitable venue, so go ahead.
>>
>> Regards,
>>
>> Stephan.
>
>
> I have the following as the last rule:
>
> if anyof (header :contains "x-spam-flag" "YES", header :contains
> "subject" "*****SPAM*****")
> {
>     fileinto "INBOX.Junk";
>     stop;
> }
>
> It seems to fire not only when mail is first retrieved, but if a
> message is moved back into INBOX (so it moves back to Spam). Any
> suggestions on how to make it fire only on initial processing?

In what kind of configuration is this script supposed to work?
Presumably something involving IMAPSieve...

Regards,

Stephan.
Reply | Threaded
Open this post in threaded view
|

Re: Sieve coding question

Roger B.A. Klorese
In reply to this post by Stephan Bosch-2
On 11/16/17 11:03 AM, Stephan Bosch wrote:
> Op 11/16/2017 om 7:42 PM schreef [hidden email]:
>> Is there a more appropriate list on which to ask for assistance in
>> coding Sieve rules, or may I ask here?
> I know of no other suitable venue, so go ahead.
>
> Regards,
>
> Stephan.


Here is the config. I don't think IMAPsieve is configured...

# dovecot -n
# 2.2.30.2 (c0c463e): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.18 (29cc74d)
# OS: Linux 3.10.0-514.6.1.el7.x86_64 x86_64 CentOS Linux release
7.3.1611 (Core)  xfs
first_valid_uid = 1000
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
listen = *
mail_gid = mailboxes
mail_home = maildir:/home/mailboxes/%d/%u
mail_location = maildir:/home/mailboxes/%d/%u
mail_privileged_group = mailboxes
mail_uid = mailboxes
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date index ihave duplicate mime foreverypart
extracttext imapflags notify
mbox_write_locks = fcntl
namespace inbox {
   inbox = yes
   list = yes
   location =
   mailbox Drafts {
     auto = subscribe
     special_use = \Drafts
   }
   mailbox Junk {
     auto = subscribe
     special_use = \Junk
   }
   mailbox Sent {
     auto = subscribe
     special_use = \Sent
   }
   mailbox "Sent Messages" {
     auto = no
     special_use = \Sent
   }
   mailbox Trash {
     auto = subscribe
     special_use = \Trash
   }
   prefix = INBOX.
   separator = .
   subscriptions = yes
   type = private
}
passdb {
   driver = pam
}
passdb {
   args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
   driver = sql
}
plugin {
   recipient_delimiter = +
   sieve = /home/mailboxes/%d/%u/sieve/dovecot.sieve
   sieve_default = /etc/dovecot/sieve/default.sieve
   sieve_dir = /home/mailboxes/%d/%u/sieve
   sieve_extensions = +notify +imapflags
   sieve_global_dir = /etc/dovecot/sieve/global/
   sieve_global_path = /etc/dovecot/sieve/default.sieve
}
pop3_uidl_format = %v-%u
protocols = imap pop3 lmtp sieve sieve
service auth {
   unix_listener /var/spool/postfix/private/auth {
     group = postfix
     mode = 0666
     user = postfix
   }
   unix_listener auth-master {
     group = mailboxes
     mode = 0660
     user = mailboxes
   }
   unix_listener auth-userdb {
     mode = 0777
   }
}
service managesieve-login {
   inet_listener sieve {
     port = 4190
   }
}
ssl_cert = </etc/pki/dovecot/certs/mailbox.onlinepolicy.net.crt
ssl_cipher_list = ALL:!LOW:!SSLv2:!SSLv3:!EXP:!aNULL
ssl_key =  # hidden, use -P to show it
ssl_key_password =  # hidden, use -P to show it
ssl_protocols = !SSLv2 !SSLv3
userdb {
   driver = passwd
}
userdb {
   args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
   driver = sql
}
protocol lmtp {
   info_log_path =
   log_path =
   mail_plugins = " sieve quota"
}
protocol sieve {
   info_log_path =
   log_path =
   managesieve_implementation_string = Dovecot Pigeonhole
   managesieve_max_line_length = 65536
}
protocol lda {
   auth_socket_path = /var/run/dovecot/auth-master
   hostname = mail.mydomain.com
   info_log_path =
   log_path =
   mail_plugins = " sieve quota sieve"
   postmaster_address = [hidden email]
}
Reply | Threaded
Open this post in threaded view
|

Re: Sieve coding question

Stephan Bosch-2
Op 11/19/2017 om 8:54 AM schreef Roger B.A. Klorese:

> On 11/16/17 11:03 AM, Stephan Bosch wrote:
>> Op 11/16/2017 om 7:42 PM schreef [hidden email]:
>>> Is there a more appropriate list on which to ask for assistance in
>>> coding Sieve rules, or may I ask here?
>> I know of no other suitable venue, so go ahead.
>>
>> Regards,
>>
>> Stephan.
>
>
> Here is the config. I don't think IMAPsieve is configured...

Then I don't understand what you mean. Sieve is normally only involved
at initial delivery, not when messages are moved between mailboxes.

Regards,

Stephan.


>
> # dovecot -n
> # 2.2.30.2 (c0c463e): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.18 (29cc74d)
> # OS: Linux 3.10.0-514.6.1.el7.x86_64 x86_64 CentOS Linux release
> 7.3.1611 (Core)  xfs
> first_valid_uid = 1000
> lda_mailbox_autocreate = yes
> lda_mailbox_autosubscribe = yes
> listen = *
> mail_gid = mailboxes
> mail_home = maildir:/home/mailboxes/%d/%u
> mail_location = maildir:/home/mailboxes/%d/%u
> mail_privileged_group = mailboxes
> mail_uid = mailboxes
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope
> encoded-character vacation subaddress comparator-i;ascii-numeric
> relational regex imap4flags copy include variables body enotify
> environment mailbox date index ihave duplicate mime foreverypart
> extracttext imapflags notify
> mbox_write_locks = fcntl
> namespace inbox {
>   inbox = yes
>   list = yes
>   location =
>   mailbox Drafts {
>     auto = subscribe
>     special_use = \Drafts
>   }
>   mailbox Junk {
>     auto = subscribe
>     special_use = \Junk
>   }
>   mailbox Sent {
>     auto = subscribe
>     special_use = \Sent
>   }
>   mailbox "Sent Messages" {
>     auto = no
>     special_use = \Sent
>   }
>   mailbox Trash {
>     auto = subscribe
>     special_use = \Trash
>   }
>   prefix = INBOX.
>   separator = .
>   subscriptions = yes
>   type = private
> }
> passdb {
>   driver = pam
> }
> passdb {
>   args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
>   driver = sql
> }
> plugin {
>   recipient_delimiter = +
>   sieve = /home/mailboxes/%d/%u/sieve/dovecot.sieve
>   sieve_default = /etc/dovecot/sieve/default.sieve
>   sieve_dir = /home/mailboxes/%d/%u/sieve
>   sieve_extensions = +notify +imapflags
>   sieve_global_dir = /etc/dovecot/sieve/global/
>   sieve_global_path = /etc/dovecot/sieve/default.sieve
> }
> pop3_uidl_format = %v-%u
> protocols = imap pop3 lmtp sieve sieve
> service auth {
>   unix_listener /var/spool/postfix/private/auth {
>     group = postfix
>     mode = 0666
>     user = postfix
>   }
>   unix_listener auth-master {
>     group = mailboxes
>     mode = 0660
>     user = mailboxes
>   }
>   unix_listener auth-userdb {
>     mode = 0777
>   }
> }
> service managesieve-login {
>   inet_listener sieve {
>     port = 4190
>   }
> }
> ssl_cert = </etc/pki/dovecot/certs/mailbox.onlinepolicy.net.crt
> ssl_cipher_list = ALL:!LOW:!SSLv2:!SSLv3:!EXP:!aNULL
> ssl_key =  # hidden, use -P to show it
> ssl_key_password =  # hidden, use -P to show it
> ssl_protocols = !SSLv2 !SSLv3
> userdb {
>   driver = passwd
> }
> userdb {
>   args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
>   driver = sql
> }
> protocol lmtp {
>   info_log_path =
>   log_path =
>   mail_plugins = " sieve quota"
> }
> protocol sieve {
>   info_log_path =
>   log_path =
>   managesieve_implementation_string = Dovecot Pigeonhole
>   managesieve_max_line_length = 65536
> }
> protocol lda {
>   auth_socket_path = /var/run/dovecot/auth-master
>   hostname = mail.mydomain.com
>   info_log_path =
>   log_path =
>   mail_plugins = " sieve quota sieve"
>   postmaster_address = [hidden email]
> }

Reply | Threaded
Open this post in threaded view
|

Re: Sieve coding question

Stephan Bosch-2
Op 11/25/2017 om 5:33 PM schreef Roger Klorese:

> On Sat, Nov 25, 2017 at 4:56 AM Stephan Bosch <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Op 11/19/2017 om 8:54 AM schreef Roger B.A. Klorese:
>     > On 11/16/17 11:03 AM, Stephan Bosch wrote:
>     >> Op 11/16/2017 om 7:42 PM schreef [hidden email]
>     <mailto:[hidden email]>:
>     >>> Is there a more appropriate list on which to ask for assistance in
>     >>> coding Sieve rules, or may I ask here?
>     >> I know of no other suitable venue, so go ahead.
>     >>
>     >> Regards,
>     >>
>     >> Stephan.
>     >
>     And I >
>     > Here is the config. I don't think IMAPsieve is configured...
>
>     Then I don't understand what you mean. Sieve is normally only involved
>     at initial delivery, not when messages are moved between mailboxes.
>
>     Regards,
>
>     Stephan.
>
>
> Of cpurse, that was my understanding too. Hence the question.

Are you sure your mail client doesn't have any rules of its own that may
be doing this?

Regards,

Stephan.