Re: Sieve not working.

2018-03-15 Thread Jungersen, Danjel - Jungersen Grafisk ApS







On 15 Mar 2018 at 9:01, Aki Tuomi wrote:








On 15.03.2018 00:43, Jungersen, Danjel - Jungersen Grafisk ApS wrote:

Hi there.




I have set up dovecot and sieve.




I can log in, see, send and receive mails.

I can move files around via imap.




I have set up a sieve script that are supposed to move some files to junk based on a 
header from rspamd.




The header is there in the relevant emails, but sieve does not do anything.




I have searched a lot online and the script looks correct.




I cannot see anything in the mail.log file ( or in .warn and .err).

Nothing indicating that sieve is running at all, no errors, no confirmations, not anything.




I have tried to set permissions to "dovecot" and "vmail", same result.




I have "compiled" my .sieve to the .svbin file.




I'm running debian stretch, and have tried to follow the guide here:

https://workaround.org/ispmail/stretch/filtering-out-spam-with-rspamd




Can anyone help me where to start looking?




Best regards

Danjel

> Try setting mail_debug=yes
Already did that :-)



> it should give you idea on what happens.
I found out that I needed to add "sieve" to "mail_plugins" manually.


I got it to work, but had to enable layout=fs, does this have any drawbacks?


My reason for enabling it was that sieve created the subfolders even though layout=fs was 
not set.

> Also providing doveconf -n could help.


root@mail:/home/danjel# doveconf -n
# 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.16 (fed8554)
# OS: Linux 4.9.0-6-amd64 x86_64 Debian 9.3 ext4
auth_mechanisms = plain login
mail_location = maildir:/var/vmail/%d/%n:LAYOUT=fs
mail_privileged_group = mail
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
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  sieve = file:~/sieve;active=~/.dovecot.sieve
  sieve_after = /etc/dovecot/sieve-after
}
protocols = imap lmtp
service auth-worker {
  user = vmail
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }
  user = dovecot
}
service imap-login {
  inet_listener imap {
    port = 0
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
ssl = required
ssl_cert = 
ssl_key =  # hidden, use -P to show it
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol lmtp {
  mail_plugins = " sieve"
}
protocol lda {
  mail_plugins = " sieve"
}
root@mail:/home/danjel#

> Aki




Re: Sieve not working.

2018-03-15 Thread Jungersen, Danjel - Jungersen Grafisk ApS



Extra note...


I also edited a bit here:
root@mail:/home/danjel# cat /etc/dovecot/sieve-after/spam-to-folder.sieve
require ["fileinto","mailbox"];


if header :contains "X-Spam" "Yes" {
 fileinto :create "Junk";
 stop;
}








On 15 Mar 2018 at 9:01, Aki Tuomi wrote:








On 15.03.2018 00:43, Jungersen, Danjel - Jungersen Grafisk ApS wrote:

Hi there.




I have set up dovecot and sieve.




I can log in, see, send and receive mails.

I can move files around via imap.




I have set up a sieve script that are supposed to move some files to junk based on a 
header from rspamd.




The header is there in the relevant emails, but sieve does not do anything.




I have searched a lot online and the script looks correct.




I cannot see anything in the mail.log file ( or in .warn and .err).

Nothing indicating that sieve is running at all, no errors, no confirmations, not anything.




I have tried to set permissions to "dovecot" and "vmail", same result.




I have "compiled" my .sieve to the .svbin file.




I'm running debian stretch, and have tried to follow the guide here:

https://workaround.org/ispmail/stretch/filtering-out-spam-with-rspamd




Can anyone help me where to start looking?




Best regards

Danjel

Try setting mail_debug=yes

it should give you idea on what happens.

Also providing doveconf -n could help.

Aki




Sieve not working.

2018-03-14 Thread Jungersen, Danjel - Jungersen Grafisk ApS



Hi there.


I have set up dovecot and sieve.


I can log in, see, send and receive mails.
I can move files around via imap.


I have set up a sieve script that are supposed to move some files to junk based on a header 
from rspamd.


The header is there in the relevant emails, but sieve does not do anything.


I have searched a lot online and the script looks correct.


I cannot see anything in the mail.log file ( or in .warn and .err).
Nothing indicating that sieve is running at all, no errors, no confirmations, not anything.


I have tried to set permissions to "dovecot" and "vmail", same result.


I have "compiled" my .sieve to the .svbin file.


I'm running debian stretch, and have tried to follow the guide here:
https://workaround.org/ispmail/stretch/filtering-out-spam-with-rspamd


Can anyone help me where to start looking?


Best regards
Danjel




Re: Sieve filter doesn't respect mailbox separator

2018-03-06 Thread Jungersen, Danjel - Jungersen Grafisk ApS



On 2 Mar 2018 at 18:10, Konstantinos Tsakiltzidis wrote:


> namespace separator is '.',
> this sieve script incorrectly tries to put the mail inside a mailbox
> rather that beside it, for example if the mailbox is named 'example',
> the mail will be put in the path 'example/.Spam' instead of
> 'example.Spam'
> 
> require ["fileinto"];
> if header :contains "X-Spam" "yes" {
>    fileinto "Spam";
> }
Could it be related to the fact that in one line you say "Junk" (In dovecot) and in another you 
say "Spam" (In sieve) ??


//Danjel
> 
> 
> 
> # 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.21 (92477967)
> # OS: Linux 4.9.0-6-amd64 x86_64 Debian 9.1 ext4
> lda_mailbox_autocreate = yes
> lda_mailbox_autosubscribe = yes
> mail_debug = yes
> mail_location = maildir:/var/vmail/%d/%n
> 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 namespace inbox {
>    inbox = yes
>    location =
>    mailbox Drafts {
>      special_use = \Drafts
>    }
>    mailbox Junk {
>      special_use = \Junk
>    }
>    mailbox Sent {
>      special_use = \Sent
>    }
>    mailbox "Sent Messages" {
>      special_use = \Sent
>    }
>    mailbox Trash {
>      special_use = \Trash
>    }
>    prefix =
>    separator = .
>    subscriptions = yes
>    type = private
> }
> namespace modulus {
>    list = children
>    location = maildir:/var/vmail/%d/Public:INDEXPVT=~/public/indexes
>    mailbox admin {     auto = subscribe   }   mailbox support {
>      auto = subscribe   }   mailbox telecoms {     auto =
>  subscribe   }   prefix = Public.   separator = .   subscriptions
>  = yes   type = public
> }
> passdb {
>    driver = pam
> }
> plugin {
>    acl = vfile
>    mail_log_events = flag_change
>    mail_log_fields = box flags uid
>    sieve = ~/dovecot.sieve
>    sieve_before = /var/vmail/global.sieve
>    sieve_dir = ~/sieve
>    sieve_global_dir = /var/vmail/sieve
> }
> protocols = " imap lmtp sieve lmtp"
> service auth {
>    unix_listener /var/spool/postfix/private/auth {
>      group = mail
>      mode = 0666
>      user = postfix
>    }
>    unix_listener auth-userdb {
>      group = mail
>      mode = 0666
>      user = vmail
>    }
> }
> service imap-login {
>    inet_listener imap {
>      port = 0
>    }
> }
> service lmtp {
>    unix_listener /var/spool/postfix/private/dovecot-lmtp {
>      group = postfix
>      mode = 0600
>      user = postfix
>    }
> }
> service managesieve-login {
>    inet_listener sieve {
>      port = 4190
>    }
>    process_min_avail = 0
>    service_count = 1
>    vsz_limit = 64 M
> }
> service managesieve {
>    process_limit = 1024
> }
> ssl = required
> ssl_cert = 
> ssl_key =  # hidden, use -P to show it
> userdb {
>    driver = passwd
> }
> protocol imap {
>    mail_max_userip_connections = 20
>    mail_plugins = " mail_log notify acl"
>    passdb {
>      args = /etc/dovecot/dovecot-ldap-users.conf.ext
>      driver = ldap
>      name =
>    }
>    userdb {
>      args = uid=vmail gid=mail home=/var/vmail/%d/%n
>      driver = static
>      name =
>    }
> }
> protocol lda {
>    mail_plugins = " sieve acl"
>    userdb {
>      args = /etc/dovecot/dovecot-ldap-users.conf.ext
>      driver = ldap
>      name =
>      override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n  
>  }   userdb {     args = /etc/dovecot/dovecot-ldap-groups.conf.ext
>      driver = ldap     name =     override_fields = uid=vmail
>  gid=mail home=/var/vmail/%d/Public/.%n 
> mail=maildir:/var/vmail/%d/Public/.%n
>    }
> }
> protocol lmtp {
>    mail_plugins = " sieve acl"
>    postmaster_address = postmas...@modulus.gr
>    userdb {
>      args = /etc/dovecot/dovecot-ldap-users.conf.ext
>      driver = ldap
>      name =
>      override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n  
>  }   userdb {     args = /etc/dovecot/dovecot-ldap-groups.conf.ext
>      driver = ldap     name =     override_fields = uid=vmail
>  gid=mail home=/var/vmail/%d/Public/.%n 
> mail=maildir:/var/vmail/%d/Public/.%n
>    }
> }
> protocol doveadm {
>    userdb {
>      args = /etc/dovecot/dovecot-ldap-users.conf.ext
>      driver = ldap
>      name =
>      override_fields = uid=vmail gid=mail home=/var/vmail/%d/%n  
>  }   userdb {     args = /etc/dovecot/dovecot-ldap-groups.conf.ext
>      driver = ldap     name =     override_fields = uid=vmail
>  gid=mail home=/var/vmail/%d/Public/.%n 
> mail=maildir:/var/vmail/%d/Public/.%n
>    }
> }
> protocol sieve {
>    mail_max_userip_connections = 10
>    managesieve_implementation_string = Dovecot Pigeonhole
>    managesieve_logout_format = bytes=%i/%o
>    managesieve_max_line_length = 65536
>    passdb {
>      args = /etc/dovecot/dovecot-ldap-users.conf.ext
>      driver = ldap
>      name =
>  

Re: LAYOUT=fs

2018-01-23 Thread Jungersen, Danjel - Jungersen Grafisk ApS







On 23 Jan 2018 at 11:30, Aki Tuomi wrote:








On 23.01.2018 11:27, Jungersen, Danjel - Jungersen Grafisk ApS wrote:





On 22 Jan 2018 at 10:28, Aki Tuomi wrote:













On 22.01.2018 00:46, Jungersen, Danjel - Jungersen Grafisk ApS wrote:

Hi there.




I have read what I could find, but not enough apparently.




I am about to migrate my server to a postfix / dovecot setup.




I have stumbled on the mentioned option and are wondering if I should use it.




I have read about it, and I understand the difference, but I cannot find anything that 
guides me to what I should do.




A pro / con list ?




I figure that there are a reason for the default value, but also wonder when I will benefit 
from changing it.




My plan is to (if possible) make spamassasin put spam i the spamfolder under the 
seperate users (serverside), I dont know if that make any difference here.




If it makes any difference, I'm running 2.2.27.




Best regards Danjel


LAYOUT=fs with maildir makes maildir use filesystem directories for folders, so instead 
of '.mail.folder' it will use 'mail/folder'.

Make sure you put mail_location (or mail from userdb) to something like maildir:~/Mail




Yes, I understand that, the thing I'm not sure of is when should I use one or the other?




What are the pros and cons for each solution?




:-)

Danjel

Aki

> Asking for pros and cons is bit difficult but I suppose it boils down to having or not having
> subfolders. It might matter if you have lots and lots of folders.


I thought about, what if I have lot and lots of mails?
I have about 100.000 mails in my mailbox, stored in 402 folders, several of my users have 
similar amounts.
I don't know if that is "lots and lots".


> Also if you are using third party tools they might expect one way or another.



Third party
Any recommendations regarding spamassasin?


As mentioned, a perfect solution for me was to have the server put detected spam in the 
users spamfolders.


:-)
Danjel

Aki




Re: LAYOUT=fs

2018-01-23 Thread Jungersen, Danjel - Jungersen Grafisk ApS







On 22 Jan 2018 at 10:28, Aki Tuomi wrote:








On 22.01.2018 00:46, Jungersen, Danjel - Jungersen Grafisk ApS wrote:

Hi there.




I have read what I could find, but not enough apparently.




I am about to migrate my server to a postfix / dovecot setup.




I have stumbled on the mentioned option and are wondering if I should use it.




I have read about it, and I understand the difference, but I cannot find anything that 
guides me to what I should do.




A pro / con list ?




I figure that there are a reason for the default value, but also wonder when I will benefit 
from changing it.




My plan is to (if possible) make spamassasin put spam i the spamfolder under the 
seperate users (serverside), I dont know if that make any difference here.




If it makes any difference, I'm running 2.2.27.




Best regards Danjel

LAYOUT=fs with maildir makes maildir use filesystem directories for folders, so instead of 
'.mail.folder' it will use 'mail/folder'.

Make sure you put mail_location (or mail from userdb) to something like maildir:~/Mail


Yes, I understand that, the thing I'm not sure of is when should I use one or the other?


What are the pros and cons for each solution?


:-)
Danjel

Aki




LAYOUT=fs

2018-01-21 Thread Jungersen, Danjel - Jungersen Grafisk ApS



Hi there.


I have read what I could find, but not enough apparently.


I am about to migrate my server to a postfix / dovecot setup.


I have stumbled on the mentioned option and are wondering if I should use it.


I have read about it, and I understand the difference, but I cannot find anything that guides 
me to what I should do.


A pro / con list ?


I figure that there are a reason for the default value, but also wonder when I will benefit from 
changing it.


My plan is to (if possible) make spamassasin put spam i the spamfolder under the seperate 
users (serverside), I dont know if that make any difference here.


If it makes any difference, I'm running 2.2.27.


Best regards Danjel