Re: writing Maildir subscriptions file outside of dovecot

2021-10-06 Thread Aki Tuomi


> On 06/10/2021 22:52 David Mandelberg  wrote:
> 
>  
> Hi,
> 
> Is it safe to write to the Maildir subscriptions file directly?
> 
> I'm trying to figure out a way to make sure the subscriptions match the 
> actual folders exactly. I know how to subscribe to existing mailboxes 
> with `doveadm mailbox list` and `doveadm mailbox subscribe`, but the 
> latter seems to only accept mailboxes on the command line, and any local 
> user can see the command line of any other user's commands. Also, that 
> doesn't handle unsubscribing from non-existent mailboxes. I think 
> unsubscribing from any mailboxes listed in `doveadm mailbox list -s` but 
> not in `doveadm mailbox list` would work, but it has the same issue of 
> mailboxes on the command line.
> 
> It looks like I could do what I want with something like this command, 
> but I'm not sure if it's safe to write directly to the subscriptions file:
> 
> { echo INBOX; ls -1A | grep '^\.' | cut -c 2-; } > subscriptions
> 
> (I was also thinking about using `doveadm mailbox list` to write the 
> subscriptions file directly, but it looks like they use different 
> separators and encodings.)


You could also use the doveadm HTTP API to handle subscription changes? It 
should be safe to modify that file though, especially if the user is not logged 
in.

Aki


writing Maildir subscriptions file outside of dovecot

2021-10-06 Thread David Mandelberg

Hi,

Is it safe to write to the Maildir subscriptions file directly?

I'm trying to figure out a way to make sure the subscriptions match the 
actual folders exactly. I know how to subscribe to existing mailboxes 
with `doveadm mailbox list` and `doveadm mailbox subscribe`, but the 
latter seems to only accept mailboxes on the command line, and any local 
user can see the command line of any other user's commands. Also, that 
doesn't handle unsubscribing from non-existent mailboxes. I think 
unsubscribing from any mailboxes listed in `doveadm mailbox list -s` but 
not in `doveadm mailbox list` would work, but it has the same issue of 
mailboxes on the command line.


It looks like I could do what I want with something like this command, 
but I'm not sure if it's safe to write directly to the subscriptions file:


{ echo INBOX; ls -1A | grep '^\.' | cut -c 2-; } > subscriptions

(I was also thinking about using `doveadm mailbox list` to write the 
subscriptions file directly, but it looks like they use different 
separators and encodings.)


Re: Quota emails... nothing happened

2021-10-06 Thread Aki Tuomi
No. The syntax is not correct. 

https://doc.dovecot.org/configuration_manual/quota/#quota-rules

this says that the rule is:

quota_rule = :

so unless you want 160GB quota for mailbox folder `azt000` (not username), you 
want to use * here.

Aki

> On 06/10/2021 15:36 Stephane Magnier  wrote:
> 
> 
> OK, but is the syntax correct ?
>  
>  Should it be :azt000:quota_rule4=+160GB ?
> Is that correct ?
>  
> Because I've made the test.. It didn't "shoot at me" while restarting the 
> service, it apparently accept the syntax, but the result is still wrong.. 
>  It is still considering a limit of 30gb and not 160Gb
>  ( the line : quota_rule = *:storage=30GB ) 
>  
>  To sum up , I have 
>  
> 
> > plugin {
> >  quota = maildir:User quota
> >  quota_rule = *:storage=30GB
> >  quota_rule2 = Trash:storage=+100MB
> >  quota_rule3 = Spam:storage=+20%%
> >  azt000:quota_rule4=+160GB
> >  
> >  
> >  quota_status_success = DUNNO
> >  quota_status_nouser = DUNNO
> >  quota_status_overquota = "552 5.2.2 Mailbox is full"
> >  quota_warning = storage=95%% quota-warning 95 %u
> >  quota_warning2 = storage=80%% quota-warning 80 %u
> >  quota_warning3 = storage=100%% quota-warning below %u
> >  quota_grace = 10%%
> >  
> >  # Quota plugin can also limit the maximum accepted mail size.
> >  quota_max_mail_size = 100M
> >  }
> > 
> and 
>  
> 
> > userdb {
> >  driver = passwd
> >  args = /etc/dovecot/quota-overrides
> >  result_success=continue-ok
> >  }
> > 
> but 
>  
> 
> > [root@mbox1 conf.d]# service dovecot restart
> >  Redirecting to /bin/systemctl restart dovecot.service
> >  [root@mbox1 conf.d]# doveadm quota get -u azt000
> >  Quota name Type Value Limit %
> >  User quota STORAGE 22268406 31457280 70
> >  User quota MESSAGE 29853 - 0
> >  [root@mbox1 conf.d]#
> > 
> 
>  
>  With 70% ; it's considering the 30Gb and not the 160Gb ( the AZT000 folder 
> size is about 21Gb )
>  
>  
> 
> Le 06/10/2021 à 14:08, Aki Tuomi a écrit :
> 
> > The rules must be consecutive,
> > 
> > if your global config has
> > 
> > quota_rule1
> > quota_rule2
> > 
> > then the userdb must return
> > 
> > quota_rule3. Or it will overwrite an existing rule.
> > 
> > Aki
> > 
> > 
> > 
> > > On 06/10/2021 13:07 Stephane Magnier  wrote:
> > > 
> > > 
> > > Hi,
> > >  
> > >  OK, I wrote this :
> > >  
> > > 
> > > 
> > > > userdb {
> > > >  driver = passwd
> > > >  args = /etc/dovecot/quota-overrides
> > > >  
> > > >  result_success=continue-ok
> > > >  
> > > >  # Override fields from passwd
> > > >  #override_fields = home=/home/virtual/%u
> > > >  }
> > > > 
> > > > 
> > >  but sorry I don't understand the following line 
> > > 
> > >  username::quota_ruleX=... where X is the next rule number.
> > > 
> > >  What should I write ?.. for instance :  ? something like that ??
> > >  
> > >  
> > >  
> > >  
> > >  Le 06/10/2021 à 10:13, Aki Tuomi a écrit :
> > > 
> > > 
> > > > That `*` there is actually mailbox mask. You have to return an 
> > > > additional quota_ruleN from your userdb for that user.
> > > > 
> > > > You can do e.g.
> > > > 
> > > > userdb {
> > > >..
> > > >result_success=continue-ok}
> > > > }
> > > > 
> > > > userdb {
> > > >driver = passwd
> > > >args = /etc/dovecot/quota-overrides
> > > > }
> > > > 
> > > > and put in there 
> > > > 
> > > > username::quota_ruleX=... where X is the next rule number.
> > > > 
> > > > the count of : might be wrong.
> > > > 
> > > > Aki
> > > > 
> > > > 
> > > > 
> > > > > On 06/10/2021 10:43 Stephane Magnier  
> > > > > wrote:
> > > > > 
> > > > > 
> > > > > Hi Again,
> > > > >  
> > > > >  Juste another one...
> > > > >  
> > > > >  The quota I've decided is 30Gb for everybody
> > > > >  I would like to add an exception for the user AZT000 so here is my 
> > > > > test :
> > > > >  
> > > > >  I put 60 GB for AZT000, but apparently, this is not seen :-( No 
> > > > > error message
> > > > >  Is there a general syntax for a specific user ?
> > > > >  
> > > > >  NB: I tried :
> > > > >  quota_rule = azt000:storage=+60GB orquota_rule1 = 
> > > > > azt000:storage=+60GB same results
> > > > >  
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > > plugin {
> > > > > >  quota = maildir:User quota
> > > > > >  quota_rule = *:storage=30GB
> > > > > >  quota_rule2 = Trash:storage=+100MB
> > > > > >  quota_rule3 = Spam:storage=+20%%
> > > > > >  # quota_rule = *:storage=70GB
> > > > > >  # quota_rule = *:storage=70GB
> > > > > >  quota_rule = azt000:storage=+60GB
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > Le 06/10/2021 à 08:09, Stephane Magnier a écrit :
> > > > > 
> > > > > 
> > > > > 
> > > > > > Great !! works fine.. 
> > > > > >  
> > > > > >  I had in fact, twice the same déclaration of quotat and storage on 
> > > > > > the same file. one of them was with an upper case "S" for 
> > > > > > Storage..
> > > > > > 
> > > > > >  Thanks again
> > > > > >  
> > > > > > 
> > > > > > Le 06/10/2021 à 07:50, Aki Tuomi a écrit :
> > > > > > 
> > > > > >

Re: Quota emails... nothing happened

2021-10-06 Thread Stephane Magnier

OK, but is the syntax correct ?

Should it be : *azt000:quota_rule4=+160GB   ?
*Is that correct ?*

*Because I've made the test.. It didn't "shoot at me" while restarting 
the service, it apparently accept the syntax, but the result is still 
wrong..

It is still considering a limit of 30gb and not 160Gb
( the line : quota_rule = *:storage=30GB )

To sum up , I have

   plugin {
 quota = maildir:User quota
 quota_rule = *:storage=30GB
 quota_rule2 = Trash:storage=+100MB
 quota_rule3 = Spam:storage=+20%%
 azt000:quota_rule4=+160GB


  quota_status_success = DUNNO
  quota_status_nouser = DUNNO
  quota_status_overquota = "552 5.2.2 Mailbox is full"
  quota_warning = storage=95%% quota-warning 95 %u
   quota_warning2 = storage=80%% quota-warning 80 %u
   quota_warning3 = storage=100%% quota-warning below %u
  quota_grace = 10%%

  # Quota plugin can also limit the maximum accepted mail size.
  quota_max_mail_size = 100M
   }

and

   userdb {
  driver = passwd
  args = /etc/dovecot/quota-overrides
  result_success=continue-ok
   }

but

   [root@mbox1 conf.d]# service dovecot restart
   Redirecting to /bin/systemctl restart dovecot.service
   [root@mbox1 conf.d]# doveadm quota  get -u azt000
   Quota name Type   Value Limit %
   User quota STORAGE 22268406
   31457280  70
   User quota MESSAGE    29853 - 0
   [root@mbox1 conf.d]#



With 70% ; it's considering the 30Gb and not the 160Gb ( the AZT000 
folder size is about 21Gb )



Le 06/10/2021 à 14:08, Aki Tuomi a écrit :

The rules must be consecutive,

if your global config has

quota_rule1
quota_rule2

then the userdb must return

quota_rule3. Or it will overwrite an existing rule.

Aki



On 06/10/2021 13:07 Stephane Magnier  wrote:


Hi,
  
  OK, I wrote this :
  


userdb {
  driver = passwd
  args = /etc/dovecot/quota-overrides
  
  result_success=continue-ok
  
  # Override fields from passwd

  #override_fields = home=/home/virtual/%u
  }


  but sorry I don't understand the following line

  username::quota_ruleX=... where X is the next rule number.

  What should I write ?.. for instance :  ? something like that ??
  
  
  
  
  Le 06/10/2021 à 10:13, Aki Tuomi a écrit :



That `*` there is actually mailbox mask. You have to return an additional 
quota_ruleN from your userdb for that user.

You can do e.g.

userdb {
..
result_success=continue-ok}
}

userdb {
driver = passwd
args = /etc/dovecot/quota-overrides
}

and put in there

username::quota_ruleX=... where X is the next rule number.

the count of : might be wrong.

Aki



On 06/10/2021 10:43 Stephane Magnier  wrote:


Hi Again,
  
  Juste another one...
  
  The quota I've decided is 30Gb for everybody

  I would like to add an exception for the user AZT000 so here is my test :
  
  I put 60 GB for AZT000, but apparently, this is not seen :-( No error message

  Is there a general syntax for a specific user ?
  
  NB: I tried :

  quota_rule = azt000:storage=+60GB orquota_rule1 = azt000:storage=+60GB same 
results
  
  




plugin {
  quota = maildir:User quota
  quota_rule = *:storage=30GB
  quota_rule2 = Trash:storage=+100MB
  quota_rule3 = Spam:storage=+20%%
  # quota_rule = *:storage=70GB
  # quota_rule = *:storage=70GB
  quota_rule = azt000:storage=+60GB



Le 06/10/2021 à 08:09, Stephane Magnier a écrit :



Great !! works fine..
  
  I had in fact, twice the same déclaration of quotat and storage on the same file. one of them was with an upper case "S" for Storage..


  Thanks again
  


Le 06/10/2021 à 07:50, Aki Tuomi a écrit :



On 06/10/2021 08:38 Stephane Magnier  wrote:



  


Le 06/10/2021 à 06:51, Aki Tuomi a écrit :




On 06/10/2021 07:30 Stephane Magnier  wrote:



  


Le 06/10/2021 à 06:10, Stephane Magnier a écrit :





Hi,
  I am just running Dovecot v 2.3.8 .. seems to work fine.
  I just add the quota plugin.. and.. I cannot see any differences.. I cannot 
see any information on Quota per user.. No specific info on Log file :-(
  
  Any help please ?
  
  Tahnks for your help
  
  Here is my config :
  


# 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.8 (b7b03ba2)
# OS: Linux 4.18.0-305.12.1.el8_4.x86_64 x86_64 CentOS Linux release 8.4.2105 
nfs4
# Hostname: mbox1.intranet.office.itx
auth_cache_negative_ttl = 5 mins
auth_cache_ttl = 5 mins
auth_mechanisms = plain login
auth_username_format = %u
debug_log_path = /var/log/dovecot-debug.log
default_vsz_limit = 4 G
info_log_path = /var/log/dovecot-info.log
listen = * [::]
log_path = /var/log/dovecot.log
login_trusted_networks = 172.18.0.0/16 127.0.0.1 ::1
mail_access_groups = dovecot
mail_fsync = always
mail_location = maildir:/var/spool2/mail/%u:LAYOUT=fs
mail_nfs_storage = yes
mail_plugins = " quota"
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-c

two different mail_location

2021-10-06 Thread Gabx

Hi everybody,

my mail system has all users in usual path ~ .

Only one user is in /var/%u .
This user doesn't receive emails.

I guess it is because its $HOME is on a different path than the one 
specified in dovecot mail_location which is:


> mail_location = maildir:~/%u/Maildir

What's the best way to solve this issue ?

Namespaces ?

If so could someone explain me how ?

Best Regards

Gabriel


--
GPG fingerprint: 5A6A F742 ACEA C9A7 93A8 8D5E 7AEF 5A02 D080 89F7

Contact: xmpp://g...@jabber.tcpreset.net


OpenPGP_0x8ED8A7AD1473BC20.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Quota emails... nothing happened

2021-10-06 Thread Aki Tuomi
The rules must be consecutive,

if your global config has

quota_rule1
quota_rule2

then the userdb must return

quota_rule3. Or it will overwrite an existing rule.

Aki


> On 06/10/2021 13:07 Stephane Magnier  wrote:
> 
> 
> Hi,
>  
>  OK, I wrote this :
>  
> 
> > userdb {
> >  driver = passwd
> >  args = /etc/dovecot/quota-overrides
> >  
> >  result_success=continue-ok
> >  
> >  # Override fields from passwd
> >  #override_fields = home=/home/virtual/%u
> >  }
> > 
> 
>  but sorry I don't understand the following line 
> 
>  username::quota_ruleX=... where X is the next rule number.
> 
>  What should I write ?.. for instance : azt000:quota_rule1=+160GB ? 
> something like that ??
>  
>  
>  
>  
>  Le 06/10/2021 à 10:13, Aki Tuomi a écrit :
> 
> > That `*` there is actually mailbox mask. You have to return an additional 
> > quota_ruleN from your userdb for that user.
> > 
> > You can do e.g.
> > 
> > userdb {
> >..
> >result_success=continue-ok}
> > }
> > 
> > userdb {
> >driver = passwd
> >args = /etc/dovecot/quota-overrides
> > }
> > 
> > and put in there 
> > 
> > username::quota_ruleX=... where X is the next rule number.
> > 
> > the count of : might be wrong.
> > 
> > Aki
> > 
> > 
> > > On 06/10/2021 10:43 Stephane Magnier  wrote:
> > > 
> > > 
> > > Hi Again,
> > >  
> > >  Juste another one...
> > >  
> > >  The quota I've decided is 30Gb for everybody
> > >  I would like to add an exception for the user AZT000 so here is my test :
> > >  
> > >  I put 60 GB for AZT000, but apparently, this is not seen :-( No error 
> > > message
> > >  Is there a general syntax for a specific user ?
> > >  
> > >  NB: I tried :
> > >  quota_rule = azt000:storage=+60GB orquota_rule1 = azt000:storage=+60GB 
> > > same results
> > >  
> > >  
> > > 
> > > 
> > > > plugin {
> > > >  quota = maildir:User quota
> > > >  quota_rule = *:storage=30GB
> > > >  quota_rule2 = Trash:storage=+100MB
> > > >  quota_rule3 = Spam:storage=+20%%
> > > >  # quota_rule = *:storage=70GB
> > > >  # quota_rule = *:storage=70GB
> > > >  quota_rule = azt000:storage=+60GB
> > > > 
> > > > 
> > > Le 06/10/2021 à 08:09, Stephane Magnier a écrit :
> > > 
> > > 
> > > > Great !! works fine.. 
> > > >  
> > > >  I had in fact, twice the same déclaration of quotat and storage on the 
> > > > same file. one of them was with an upper case "S" for Storage..
> > > > 
> > > >  Thanks again
> > > >  
> > > > 
> > > > Le 06/10/2021 à 07:50, Aki Tuomi a écrit :
> > > > 
> > > > 
> > > > > > On 06/10/2021 08:38 Stephane Magnier  
> > > > > > wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >  
> > > > > > 
> > > > > > Le 06/10/2021 à 06:51, Aki Tuomi a écrit :
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > > > On 06/10/2021 07:30 Stephane Magnier 
> > > > > > > >  wrote:
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > >  
> > > > > > > > 
> > > > > > > > Le 06/10/2021 à 06:10, Stephane Magnier a écrit :
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > Hi,
> > > > > > > > >  I am just running Dovecot v 2.3.8 .. seems to work fine.
> > > > > > > > >  I just add the quota plugin.. and.. I cannot see any 
> > > > > > > > > differences.. I cannot see any information on Quota per 
> > > > > > > > > user.. No specific info on Log file :-(
> > > > > > > > >  
> > > > > > > > >  Any help please ?
> > > > > > > > >  
> > > > > > > > >  Tahnks for your help
> > > > > > > > >  
> > > > > > > > >  Here is my config :
> > > > > > > > >  
> > > > > > > > > 
> > > > > > > > > # 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
> > > > > > > > > # Pigeonhole version 0.5.8 (b7b03ba2)
> > > > > > > > > # OS: Linux 4.18.0-305.12.1.el8_4.x86_64 x86_64 CentOS Linux 
> > > > > > > > > release 8.4.2105 nfs4
> > > > > > > > > # Hostname: mbox1.intranet.office.itx
> > > > > > > > > auth_cache_negative_ttl = 5 mins
> > > > > > > > > auth_cache_ttl = 5 mins
> > > > > > > > > auth_mechanisms = plain login
> > > > > > > > > auth_username_format = %u
> > > > > > > > > debug_log_path = /var/log/dovecot-debug.log
> > > > > > > > > default_vsz_limit = 4 G
> > > > > > > > > info_log_path = /var/log/dovecot-info.log
> > > > > > > > > listen = * [::]
> > > > > > > > > log_path = /var/log/dovecot.log
> > > > > > > > > login_trusted_networks = 172.18.0.0/16 127.0.0.1 ::1
> > > > > > > > > mail_access_groups = dovecot
> > > > > > > > > mail_fsync = always
> > > > > > > > > mail_location = maildir:/var/spool2/mail/%u:LAYOUT=fs
> > > > > > > > > mail_nfs_storage = yes
> > > > > > > > > mail_plugins = " quota"
> > > > > > > > > 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 i

Re: Quota emails... nothing happened

2021-10-06 Thread Stephane Magnier

Hi,

OK, I wrote this :

   userdb {
   driver = passwd
  args = /etc/dovecot/quota-overrides

   result_success=continue-ok

  # Override fields from passwd
  #override_fields = home=/home/virtual/%u
   }


but sorry I don't understand the following line

username::quota_ruleX=... where X is the next rule number.

What should I write ?.. for instance : /*azt000:quota_rule1=+160GB*/ 
? something like that ??





Le 06/10/2021 à 10:13, Aki Tuomi a écrit :

That `*` there is actually mailbox mask. You have to return an additional 
quota_ruleN from your userdb for that user.

You can do e.g.

userdb {
..
result_success=continue-ok}
}

userdb {
driver = passwd
args = /etc/dovecot/quota-overrides
}

and put in there

username::quota_ruleX=... where X is the next rule number.

the count of : might be wrong.

Aki


On 06/10/2021 10:43 Stephane Magnier  wrote:


Hi Again,
  
  Juste another one...
  
  The quota I've decided is 30Gb for everybody

  I would like to add an exception for the user AZT000 so here is my test :
  
  I put 60 GB for AZT000, but apparently, this is not seen :-( No error message

  Is there a general syntax for a specific user ?
  
  NB: I tried :

  quota_rule = azt000:storage=+60GB orquota_rule1 = azt000:storage=+60GB same 
results
  
  


plugin {
  quota = maildir:User quota
  quota_rule = *:storage=30GB
  quota_rule2 = Trash:storage=+100MB
  quota_rule3 = Spam:storage=+20%%
  # quota_rule = *:storage=70GB
  # quota_rule = *:storage=70GB
  quota_rule = azt000:storage=+60GB



Le 06/10/2021 à 08:09, Stephane Magnier a écrit :


Great !! works fine..
  
  I had in fact, twice the same déclaration of quotat and storage on the same file. one of them was with an upper case "S" for Storage..


  Thanks again
  


Le 06/10/2021 à 07:50, Aki Tuomi a écrit :


On 06/10/2021 08:38 Stephane Magnier  wrote:



  


Le 06/10/2021 à 06:51, Aki Tuomi a écrit :



On 06/10/2021 07:30 Stephane Magnier  wrote:



  


Le 06/10/2021 à 06:10, Stephane Magnier a écrit :




Hi,
  I am just running Dovecot v 2.3.8 .. seems to work fine.
  I just add the quota plugin.. and.. I cannot see any differences.. I cannot 
see any information on Quota per user.. No specific info on Log file :-(
  
  Any help please ?
  
  Tahnks for your help
  
  Here is my config :
  


# 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.8 (b7b03ba2)
# OS: Linux 4.18.0-305.12.1.el8_4.x86_64 x86_64 CentOS Linux release 8.4.2105 
nfs4
# Hostname: mbox1.intranet.office.itx
auth_cache_negative_ttl = 5 mins
auth_cache_ttl = 5 mins
auth_mechanisms = plain login
auth_username_format = %u
debug_log_path = /var/log/dovecot-debug.log
default_vsz_limit = 4 G
info_log_path = /var/log/dovecot-info.log
listen = * [::]
log_path = /var/log/dovecot.log
login_trusted_networks = 172.18.0.0/16 127.0.0.1 ::1
mail_access_groups = dovecot
mail_fsync = always
mail_location = maildir:/var/spool2/mail/%u:LAYOUT=fs
mail_nfs_storage = yes
mail_plugins = " quota"
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 ihave
mbox_very_dirty_syncs = yes
mbox_write_locks = fcntl
mmap_disable = yes
namespace inbox {
   disabled = no
   ignore_on_failure = no
   inbox = yes
   list = yes
   location =
   mailbox Archive {
 auto = no
 comment = " All my Accepted/NON  SPAM"
 special_use = \Archive
   }
   mailbox Drafts {
 auto = subscribe
 special_use = \Drafts
   }
   mailbox Junk {
 auto = subscribe
 autoexpunge = 90 days
 special_use = \Junk
   }
   mailbox Sent {
 auto = subscribe
 special_use = \Sent
   }
   mailbox Trash {
 auto = no
 autoexpunge = 60 days
 special_use = \Trash
   }
   mailbox virtual/All {
 auto = no
 special_use = \All
   }
   prefix =
   subscriptions = yes
   type = private
}
passdb {
   driver = pam
}
plugin {
   quota_grace = 10%%
   quota_max_mail_size = 100M
   quota_rule = *:storage=1M
   quota_rule2 = Trash:Storage=+100M
   quota_rule3 = Spam:storage=+20%%
   quota_status_nouser = DUNNO
   quota_status_overquota = 552 5.2.2 Mailbox is full
   quota_status_success = DUNNO
   quota_warning = storage=95%% quota-warning 95 %u
   quota_warning2 = storage=80%% quota-warning 80 %u
   quota_warning3 = -storage=100%% quota-warning below %u
   sieve = file:~/sieve;active=~/.dovecot.sieve
}
pop3_uidl_format = %v-%u
service auth {
   unix_listener auth-master {
 mode = 0666
   }
   unix_listener auth-userdb {
 mode = 0600
 user = mail
   }
}
service dict {
   unix_listener dict {
 mode = 0600
 user = mail
   }
}
service imap-login {
   inet_listener imap {
 port = 143
   }
   inet_listener imaps {
 port = 993
 ssl = yes
   }
   process_min_avail = 4
   s

Re: Quota emails... nothing happened

2021-10-06 Thread Aki Tuomi
That `*` there is actually mailbox mask. You have to return an additional 
quota_ruleN from your userdb for that user.

You can do e.g.

userdb {
   ..
   result_success=continue-ok}
}

userdb {
   driver = passwd
   args = /etc/dovecot/quota-overrides
}

and put in there 

username::quota_ruleX=... where X is the next rule number.

the count of : might be wrong.

Aki

> On 06/10/2021 10:43 Stephane Magnier  wrote:
> 
> 
> Hi Again,
>  
>  Juste another one...
>  
>  The quota I've decided is 30Gb for everybody
>  I would like to add an exception for the user AZT000 so here is my test :
>  
>  I put 60 GB for AZT000, but apparently, this is not seen :-( No error message
>  Is there a general syntax for a specific user ?
>  
>  NB: I tried :
>  quota_rule = azt000:storage=+60GB orquota_rule1 = azt000:storage=+60GB same 
> results
>  
>  
> 
> > plugin {
> >  quota = maildir:User quota
> >  quota_rule = *:storage=30GB
> >  quota_rule2 = Trash:storage=+100MB
> >  quota_rule3 = Spam:storage=+20%%
> >  # quota_rule = *:storage=70GB
> >  # quota_rule = *:storage=70GB
> >  quota_rule = azt000:storage=+60GB
> > 
> 
> 
> Le 06/10/2021 à 08:09, Stephane Magnier a écrit :
> 
> > Great !! works fine.. 
> >  
> >  I had in fact, twice the same déclaration of quotat and storage on the 
> > same file. one of them was with an upper case "S" for Storage..
> > 
> >  Thanks again
> >  
> > 
> > Le 06/10/2021 à 07:50, Aki Tuomi a écrit :
> > 
> > > > On 06/10/2021 08:38 Stephane Magnier  
> > > > wrote:
> > > > 
> > > > 
> > > > 
> > > >  
> > > > 
> > > > Le 06/10/2021 à 06:51, Aki Tuomi a écrit :
> > > > 
> > > > 
> > > > > > On 06/10/2021 07:30 Stephane Magnier  
> > > > > > wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >  
> > > > > > 
> > > > > > Le 06/10/2021 à 06:10, Stephane Magnier a écrit :
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > > Hi,
> > > > > > >  I am just running Dovecot v 2.3.8 .. seems to work fine.
> > > > > > >  I just add the quota plugin.. and.. I cannot see any 
> > > > > > > differences.. I cannot see any information on Quota per user.. No 
> > > > > > > specific info on Log file :-(
> > > > > > >  
> > > > > > >  Any help please ?
> > > > > > >  
> > > > > > >  Tahnks for your help
> > > > > > >  
> > > > > > >  Here is my config :
> > > > > > >  
> > > > > > > 
> > > > > > > # 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
> > > > > > > # Pigeonhole version 0.5.8 (b7b03ba2)
> > > > > > > # OS: Linux 4.18.0-305.12.1.el8_4.x86_64 x86_64 CentOS Linux 
> > > > > > > release 8.4.2105 nfs4
> > > > > > > # Hostname: mbox1.intranet.office.itx
> > > > > > > auth_cache_negative_ttl = 5 mins
> > > > > > > auth_cache_ttl = 5 mins
> > > > > > > auth_mechanisms = plain login
> > > > > > > auth_username_format = %u
> > > > > > > debug_log_path = /var/log/dovecot-debug.log
> > > > > > > default_vsz_limit = 4 G
> > > > > > > info_log_path = /var/log/dovecot-info.log
> > > > > > > listen = * [::]
> > > > > > > log_path = /var/log/dovecot.log
> > > > > > > login_trusted_networks = 172.18.0.0/16 127.0.0.1 ::1
> > > > > > > mail_access_groups = dovecot
> > > > > > > mail_fsync = always
> > > > > > > mail_location = maildir:/var/spool2/mail/%u:LAYOUT=fs
> > > > > > > mail_nfs_storage = yes
> > > > > > > mail_plugins = " quota"
> > > > > > > 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 ihave
> > > > > > > mbox_very_dirty_syncs = yes
> > > > > > > mbox_write_locks = fcntl
> > > > > > > mmap_disable = yes
> > > > > > > namespace inbox {
> > > > > > >   disabled = no
> > > > > > >   ignore_on_failure = no
> > > > > > >   inbox = yes
> > > > > > >   list = yes
> > > > > > >   location = 
> > > > > > >   mailbox Archive {
> > > > > > > auto = no
> > > > > > > comment = " All my Accepted/NON  SPAM"
> > > > > > > special_use = \Archive
> > > > > > >   }
> > > > > > >   mailbox Drafts {
> > > > > > > auto = subscribe
> > > > > > > special_use = \Drafts
> > > > > > >   }
> > > > > > >   mailbox Junk {
> > > > > > > auto = subscribe
> > > > > > > autoexpunge = 90 days
> > > > > > > special_use = \Junk
> > > > > > >   }
> > > > > > >   mailbox Sent {
> > > > > > > auto = subscribe
> > > > > > > special_use = \Sent
> > > > > > >   }
> > > > > > >   mailbox Trash {
> > > > > > > auto = no
> > > > > > > autoexpunge = 60 days
> > > > > > > special_use = \Trash
> > > > > > >   }
> > > > > > >   mailbox virtual/All {
> > > > > > > auto = no
> > > > > > > special_use = \All
> > > > > > >   }
> > > > > > >   prefix = 
> > > > > > >   subscriptions = yes
> > > > > > >   type = private
> > > > > > > }
> > > > > > > passdb {
> > > > > > >   driver = pam
> 

Re: two different mail_location

2021-10-06 Thread Aki Tuomi


> On 06/10/2021 11:09 Gabx  wrote:
> 
>  
> Hi everybody,
> 
> my mail system has all users in usual path ~ .
> 
> Only one user is in /var/%u .
> This user doesn't receive emails.
> 
> I guess it is because its $HOME is on a different path than the one 
> specified in dovecot mail_location which is:
> 
>  > mail_location = maildir:~/%u/Maildir
> 
> What's the best way to solve this issue ?
> 
> Namespaces ?
> 
> If so could someone explain me how ?
> 
> Best Regards
> 
> Gabriel
> 
> 
> -- 
> GPG fingerprint: 5A6A F742 ACEA C9A7 93A8 8D5E 7AEF 5A02 D080 89F7
> 
> Contact: xmpp://g...@jabber.tcpreset.net


Return `mail=maildir:/var/%u` from auth. See 
https://doc.dovecot.org/configuration_manual/authentication/user_databases_userdb/

Aki


Re: Quota emails... nothing happened

2021-10-06 Thread Stephane Magnier

Hi Again,

Juste another one...

The quota I've decided is 30Gb for everybody
I would like to add an exception for the user AZT000 so here is my test :

I put 60 GB for AZT000, but apparently, this is not seen :-(    No error 
message

 Is there a general syntax for a specific user ?

NB: I tried :
*quota_rule* = azt000:storage=+60GB or *quota_rule1* = 
azt000:storage=+60GB  same results



   plugin {
 quota = maildir:User quota
 quota_rule = *:storage=30GB
 quota_rule2 = Trash:storage=+100MB
 quota_rule3 = Spam:storage=+20%%
 # quota_rule = *:storage=70GB
 # quota_rule = *:storage=70GB
   *quota_rule = azt000:storage=+60GB*


Le 06/10/2021 à 08:09, Stephane Magnier a écrit :

Great !! works fine..

I had in fact, twice the same déclaration of quotat and storage on the 
same file. one of them was with an upper case "S" for Storage..


Thanks again

Le 06/10/2021 à 07:50, Aki Tuomi a écrit :

On 06/10/2021 08:38 Stephane Magnier  wrote:



  


Le 06/10/2021 à 06:51, Aki Tuomi a écrit :


On 06/10/2021 07:30 Stephane Magnier  wrote:



  


Le 06/10/2021 à 06:10, Stephane Magnier a écrit :



Hi,
  I am just running Dovecot v 2.3.8 .. seems to work fine.
  I just add the quota plugin.. and.. I cannot see any differences.. I cannot 
see any information on Quota per user.. No specific info on Log file :-(
  
  Any help please ?
  
  Tahnks for your help
  
  Here is my config :
  


# 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.8 (b7b03ba2)
# OS: Linux 4.18.0-305.12.1.el8_4.x86_64 x86_64 CentOS Linux release 8.4.2105 
nfs4
# Hostname: mbox1.intranet.office.itx
auth_cache_negative_ttl = 5 mins
auth_cache_ttl = 5 mins
auth_mechanisms = plain login
auth_username_format = %u
debug_log_path = /var/log/dovecot-debug.log
default_vsz_limit = 4 G
info_log_path = /var/log/dovecot-info.log
listen = * [::]
log_path = /var/log/dovecot.log
login_trusted_networks = 172.18.0.0/16 127.0.0.1 ::1
mail_access_groups = dovecot
mail_fsync = always
mail_location = maildir:/var/spool2/mail/%u:LAYOUT=fs
mail_nfs_storage = yes
mail_plugins = " quota"
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 ihave
mbox_very_dirty_syncs = yes
mbox_write_locks = fcntl
mmap_disable = yes
namespace inbox {
   disabled = no
   ignore_on_failure = no
   inbox = yes
   list = yes
   location =
   mailbox Archive {
 auto = no
 comment = " All my Accepted/NON  SPAM"
 special_use = \Archive
   }
   mailbox Drafts {
 auto = subscribe
 special_use = \Drafts
   }
   mailbox Junk {
 auto = subscribe
 autoexpunge = 90 days
 special_use = \Junk
   }
   mailbox Sent {
 auto = subscribe
 special_use = \Sent
   }
   mailbox Trash {
 auto = no
 autoexpunge = 60 days
 special_use = \Trash
   }
   mailbox virtual/All {
 auto = no
 special_use = \All
   }
   prefix =
   subscriptions = yes
   type = private
}
passdb {
   driver = pam
}
plugin {
   quota_grace = 10%%
   quota_max_mail_size = 100M
   quota_rule = *:storage=1M
   quota_rule2 = Trash:Storage=+100M
   quota_rule3 = Spam:storage=+20%%
   quota_status_nouser = DUNNO
   quota_status_overquota = 552 5.2.2 Mailbox is full
   quota_status_success = DUNNO
   quota_warning = storage=95%% quota-warning 95 %u
   quota_warning2 = storage=80%% quota-warning 80 %u
   quota_warning3 = -storage=100%% quota-warning below %u
   sieve =file:~/sieve;active=~/.dovecot.sieve
}
pop3_uidl_format = %v-%u
service auth {
   unix_listener auth-master {
 mode = 0666
   }
   unix_listener auth-userdb {
 mode = 0600
 user = mail
   }
}
service dict {
   unix_listener dict {
 mode = 0600
 user = mail
   }
}
service imap-login {
   inet_listener imap {
 port = 143
   }
   inet_listener imaps {
 port = 993
 ssl = yes
   }
   process_min_avail = 4
   service_count = 0
}
service lmtp {
   inet_listener lmtp {
 port = 24
   }
   unix_listener /var/run/lmtp {
 group = mail
 mode = 0660
 user = mail
   }
}
service pop3-login {
   inet_listener pop3 {
 address = *
 port = 110
   }
   inet_listener pop3s {
 port = 995
 ssl = yes
   }
}
service quota-warning {
   executable = script /usr/local/bin/quota-warning.sh
   unix_listener quota-warning {
 user = mail
   }
   user = dovecot
}
service submission {
   process_limit = 250
}
ssl = required
ssl_ca = 
  Just for info
  
  [root@mbox1 xenia]# doveadm quota get -A |grep "STORAGE"

  Nothing at all ?? weird
  [root@mbox1 xenia]#
  
  [root@mbox1 xenia]# doveadm quota get -u 

  Quota name Type Value Limit %
  [root@mbox1 xenia]#
  => Absolutely nothing is displayed 
  
  
  normally, the size of the user1 email folder is about 21 Gb

  So..just modified the line :quota_rule = *:sto