[Dovecot] Quota, message is never send?
I think i have quota setup correctly, but finally time arrived to check that ;)
opensuse:/etc/dovecot # doveadm quota get -u luuk Quota name Type Value Limit % User quota STORAGE 571973 716800 79 User quota MESSAGE 45555 - 0
It seems i am at 79% of my quota so, i added a line to conf.d/90-quota.conf, to get a wraning when quota exceeds 10%: .... plugin { quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 %u quota_warning2 = storage=90%% /usr/local/bin/quota-warning.sh 90 %u quota_warning3 = storage=10%% /usr/local/bin/quota-warning.sh 10 %u } ....
But this message is never send, what am i missing (in my config)?
Below is some info from a debug.log: 2012-05-12 10:40:51 imap(luuk): Debug: Effective uid=1000, gid=100, home=/home/luuk 2012-05-12 10:40:51 imap(luuk): Debug: Quota root: name=User quota backend=maildir args= 2012-05-12 10:40:51 imap(luuk): Debug: Quota rule: root=User quota mailbox=* bytes=734003200 messages=0 2012-05-12 10:40:51 imap(luuk): Debug: Quota warning: bytes=697303040 (95%) messages=0 reverse=no command=/usr/local/bin/quota-warning.sh 95 luuk 2012-05-12 10:40:51 imap(luuk): Debug: Quota warning: bytes=660602880 (90%) messages=0 reverse=no command=/usr/local/bin/quota-warning.sh 90 luuk 2012-05-12 10:40:51 imap(luuk): Debug: Quota warning: bytes=73400320 (10%) messages=0 reverse=no command=/usr/local/bin/quota-warning.sh 10 luuk 2012-05-12 10:40:51 imap(luuk): Debug: maildir++: root=/home/luuk/Maildir, index=, control=, inbox=/home/luuk/Maildir, alt=
On 12-05-2012 10:50, Luuk@dovecot wrote:
I think i have quota setup correctly, but finally time arrived to check that ;)
...
But this message is never send, what am i missing (in my config)?
dovecot -n: # 2.0.16: /etc/dovecot/dovecot.conf # OS: Linux 3.1.10-1.9-desktop x86_64 openSUSE 12.1 (x86_64) auth_debug = yes auth_mechanisms = plain login cram-md5 info_log_path = /var/log/dovecot/dovecot-debug.log log_path = /var/log/dovecot/dovecot.log log_timestamp = "%Y-%m-%d %H:%M:%S " mail_debug = yes mail_location = maildir:~/Maildir mail_plugins = mail_log notify fts fts_squat quota 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 passdb { args = scheme=cram-md5 /etc/cram-md5.pwd driver = passwd-file } plugin { quota = maildir:User quota quota_rule = *:storage=700M quota_rule2 = *:messages=60000 quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 %u quota_warning2 = storage=90%% /usr/local/bin/quota-warning.sh 90 %u quota_warning3 = storage=10%% /usr/local/bin/quota-warning.sh 10 %u sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } protocols = imap lmtp service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } process_min_avail = 0 service_count = 1 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot } user = dovecot } ssl_cert =
On Saturday, May 12, 2012 at 12:37:25 UTC, dovecot@vosslamber.nl confabulated:
On 12-05-2012 10:50, Luuk@dovecot wrote:
I think i have quota setup correctly, but finally time arrived to check that ;)
...
But this message is never send, what am i missing (in my config)?
dovecot -n: # 2.0.16: /etc/dovecot/dovecot.conf # OS: Linux 3.1.10-1.9-desktop x86_64 openSUSE 12.1 (x86_64) auth_debug = yes auth_mechanisms = plain login cram-md5 info_log_path = /var/log/dovecot/dovecot-debug.log log_path = /var/log/dovecot/dovecot.log log_timestamp = "%Y-%m-%d %H:%M:%S " mail_debug = yes mail_location = maildir:~/Maildir mail_plugins = mail_log notify fts fts_squat quota 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 passdb { args = scheme=cram-md5 /etc/cram-md5.pwd driver = passwd-file } plugin { quota = maildir:User quota quota_rule = *:storage=700M quota_rule2 = *:messages=60000 quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 %u quota_warning2 = storage=90%% /usr/local/bin/quota-warning.sh 90 %u quota_warning3 = storage=10%% /usr/local/bin/quota-warning.sh 10 %u sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } protocols = imap lmtp service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } process_min_avail = 0 service_count = 1 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot } user = dovecot } ssl_cert =
Tell the quota warnings to use the quota-warning service you have defined:
plugin { ... quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=90%% quota-warning 90 %u quota_warning3 = storage=10%% quota-warning 10 %u ... }
That's the way it is demonstrated in the default configuration files.
-- If at first you don't succeed... ...so much for skydiving.
On 05/12/2012 04:50 AM, Luuk@dovecot wrote:
It seems i am at 79% of my quota so, i added a line to conf.d/90-quota.conf, to get a wraning when quota exceeds 10%: Quota warnings are only sent when you _cross_ the limit, they are not sent (again) when you are already over the limit. So, in your case you will get your next warnings at 90% and 95%.
On 12-05-2012 15:55, Gedalya wrote:
On 05/12/2012 04:50 AM, Luuk@dovecot wrote:
It seems i am at 79% of my quota so, i added a line to conf.d/90-quota.conf, to get a wraning when quota exceeds 10%: Quota warnings are only sent when you _cross_ the limit, they are not sent (again) when you are already over the limit. So, in your case you will get your next warnings at 90% and 95%.
OK, so i tweaked my rules a bit, and send meself a huge mail to make sure i cross a border. (I've overdone this, because the pdf got base64 encoded, and stored in Sent AND in INBOX ;)
I also followed the suggestion form 'Duane Hill' and delete the path before the quota-warning.sh. I hope he did mean that when he was referring to the docs ;)
In the log, the following message showed: 2012-05-12 17:11:43 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning.sh) failed: No such file or directory
I think i have to revert the changes, and retest..... ;)
On 12-05-2012 17:42, Luuk@dovecot wrote:
On 12-05-2012 15:55, Gedalya wrote:
On 05/12/2012 04:50 AM, Luuk@dovecot wrote:
It seems i am at 79% of my quota so, i added a line to conf.d/90-quota.conf, to get a wraning when quota exceeds 10%: Quota warnings are only sent when you _cross_ the limit, they are not sent (again) when you are already over the limit. So, in your case you will get your next warnings at 90% and 95%.
OK, so i tweaked my rules a bit, and send meself a huge mail to make sure i cross a border. (I've overdone this, because the pdf got base64 encoded, and stored in Sent AND in INBOX ;)
I also followed the suggestion form 'Duane Hill' and delete the path before the quota-warning.sh. I hope he did mean that when he was referring to the docs ;)
In the log, the following message showed: 2012-05-12 17:11:43 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning.sh) failed: No such file or directory
I think i have to revert the changes, and retest..... ;)
2012-05-12 17:50:22 imap(luuk): Error: quota: net_connect_unix(/usr/local/bin/quota-warning.sh) failed: Permission denied (euid=1000(luuk) egid=100(users) missing +w perm: /usr/local/bin/quota-warning.sh, dir owned by 0:0 mode=0755) ^C opensuse:/etc/dovecot # ll /usr/local/bin/quota-warning.sh -rwxr-xr-x 1 root root 301 Apr 9 16:09 /usr/local/bin/quota-warning.sh
Why does this script need +w ?? or am i misreading the error message?
opensuse:/home/luuk # dovecot -n | grep -i quota mail_plugins = mail_log notify fts fts_squat quota quota = maildir:User quota quota_rule = *:storage=800M quota_rule2 = *:messages=60000 quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 %u quota_warning2 = storage=90%% /usr/local/bin/quota-warning.sh 90 %u quota_warning3 = storage=72%% /usr/local/bin/quota-warning.sh 72 %u service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { mail_plugins = mail_log notify fts fts_squat quota imap_quota opensuse:/home/luuk #
On 5/12/2012 11:59 AM, Luuk@dovecot wrote:
2012-05-12 17:50:22 imap(luuk): Error: quota: net_connect_unix(/usr/local/bin/quota-warning.sh) failed: Permission denied (euid=1000(luuk) egid=100(users) missing +w perm: /usr/local/bin/quota-warning.sh, dir owned by 0:0 mode=0755)
This is net_connect_unix(), it's trying to write to a socket. But it ended up with a path to a script, not a socket.
On 12-05-2012 18:02, Gedalya wrote:
On 5/12/2012 11:59 AM, Luuk@dovecot wrote:
2012-05-12 17:50:22 imap(luuk): Error: quota: net_connect_unix(/usr/local/bin/quota-warning.sh) failed: Permission denied (euid=1000(luuk) egid=100(users) missing +w perm: /usr/local/bin/quota-warning.sh, dir owned by 0:0 mode=0755)
This is net_connect_unix(), it's trying to write to a socket. But it ended up with a path to a script, not a socket.
i just read you other post, and re-test.... ;)
On 5/12/2012 11:42 AM, Luuk@dovecot wrote:
In the log, the following message showed: 2012-05-12 17:11:43 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning.sh) failed: No such file or directory
I think i have to revert the changes, and retest.....;)
Wiki says: quota_warning = <limit configuration> <quota-warning socket name> <parameters>
You define a listening socket in the unix_listener line in the service definition, and refer to that socket in your quota_warning plugin configuration.
Duane wasn't saying to delete the path, he said to use the socket name. So, just quota-warning without the .sh
plugin { quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=90%% quota-warning 90 %u quota_warning3 = storage=10%% quota-warning 10 %u }
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot } user = dovecot }
On 12-05-2012 18:00, Gedalya wrote:
On 5/12/2012 11:42 AM, Luuk@dovecot wrote:
In the log, the following message showed: 2012-05-12 17:11:43 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning.sh) failed: No such file or directory
I think i have to revert the changes, and retest.....;)
Wiki says: quota_warning = <limit configuration> <quota-warning socket name> <parameters>
You define a listening socket in the unix_listener line in the service definition, and refer to that socket in your quota_warning plugin configuration.
Duane wasn't saying to delete the path, he said to use the socket name. So, just quota-warning without the .sh
plugin { quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=90%% quota-warning 90 %u quota_warning3 = storage=10%% quota-warning 10 %u }
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot } user = dovecot }
ok, after this error, i must have seen them all: 2012-05-12 18:08:31 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning) failed: Permission denied (euid=1000(luuk) egid=100(users) missing +r perm: /var/run/dovecot/quota-warning, dir owned by 0:0 mode=0755)
opensuse:/var/run/dovecot # ls -l /var/run/dovecot/quota-warning srw------- 1 dovecot root 0 May 12 18:18 /var/run/dovecot/quota-warning opensuse:/var/run/dovecot #
Changing the permissions using chmod +rw /var/run/dovecot/quota-warning is reset when dovecot is restarted.....
On 5/12/2012 12:21 PM, Luuk@dovecot wrote:
On 12-05-2012 18:00, Gedalya wrote:
On 5/12/2012 11:42 AM, Luuk@dovecot wrote:
In the log, the following message showed: 2012-05-12 17:11:43 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning.sh) failed: No such file or directory
I think i have to revert the changes, and retest.....;) Wiki says: quota_warning =<limit configuration> <quota-warning socket name> <parameters>
You define a listening socket in the unix_listener line in the service definition, and refer to that socket in your quota_warning plugin configuration.
Duane wasn't saying to delete the path, he said to use the socket name. So, just quota-warning without the .sh
plugin { quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=90%% quota-warning 90 %u quota_warning3 = storage=10%% quota-warning 10 %u }
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot } user = dovecot }
ok, after this error, i must have seen them all: 2012-05-12 18:08:31 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning) failed: Permission denied (euid=1000(luuk) egid=100(users) missing +r perm: /var/run/dovecot/quota-warning, dir owned by 0:0 mode=0755)
opensuse:/var/run/dovecot # ls -l /var/run/dovecot/quota-warning srw------- 1 dovecot root 0 May 12 18:18 /var/run/dovecot/quota-warning opensuse:/var/run/dovecot #
Changing the permissions using chmod +rw /var/run/dovecot/quota-warning is reset when dovecot is restarted.....
You should probably add mode = 0666 like so:
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot mode = 0666 } user = dovecot }
Indeed you can't use chmod from the command line because these sockets are created by dovecot when it starts up.
On 12-05-2012 18:40, Gedalya wrote:
On 5/12/2012 12:21 PM, Luuk@dovecot wrote:
On 12-05-2012 18:00, Gedalya wrote:
On 5/12/2012 11:42 AM, Luuk@dovecot wrote:
In the log, the following message showed: 2012-05-12 17:11:43 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning.sh) failed: No such file or directory
I think i have to revert the changes, and retest.....;) Wiki says: quota_warning =<limit configuration> <quota-warning socket name> <parameters>
You define a listening socket in the unix_listener line in the service definition, and refer to that socket in your quota_warning plugin configuration.
Duane wasn't saying to delete the path, he said to use the socket name. So, just quota-warning without the .sh
plugin { quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=90%% quota-warning 90 %u quota_warning3 = storage=10%% quota-warning 10 %u }
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot } user = dovecot }
ok, after this error, i must have seen them all: 2012-05-12 18:08:31 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning) failed: Permission denied (euid=1000(luuk) egid=100(users) missing +r perm: /var/run/dovecot/quota-warning, dir owned by 0:0 mode=0755)
opensuse:/var/run/dovecot # ls -l /var/run/dovecot/quota-warning srw------- 1 dovecot root 0 May 12 18:18 /var/run/dovecot/quota-warning opensuse:/var/run/dovecot #
Changing the permissions using chmod +rw /var/run/dovecot/quota-warning is reset when dovecot is restarted.....
You should probably add mode = 0666 like so:
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot mode = 0666 } user = dovecot }
Indeed you can't use chmod from the command line because these sockets are created by dovecot when it starts up.
ok, it seems to work now ;)
but my quota-usage is dropping harder that it should
i started at 71%, received a file, it went to 74% deleted the message in Inbox deleted the message from Sent and not the quota is at 68%.....
Recovery is possible with: doveadm quota recalc -u
On 5/12/2012 1:34 PM, Luuk@dovecot wrote:
On 12-05-2012 18:40, Gedalya wrote:
On 5/12/2012 12:21 PM, Luuk@dovecot wrote:
On 12-05-2012 18:00, Gedalya wrote:
On 5/12/2012 11:42 AM, Luuk@dovecot wrote:
In the log, the following message showed: 2012-05-12 17:11:43 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning.sh) failed: No such file or directory
I think i have to revert the changes, and retest.....;) Wiki says: quota_warning =<limit configuration> <quota-warning socket name> <parameters>
You define a listening socket in the unix_listener line in the service definition, and refer to that socket in your quota_warning plugin configuration.
Duane wasn't saying to delete the path, he said to use the socket name. So, just quota-warning without the .sh
plugin { quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=90%% quota-warning 90 %u quota_warning3 = storage=10%% quota-warning 10 %u }
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot } user = dovecot }
ok, after this error, i must have seen them all: 2012-05-12 18:08:31 imap(luuk): Error: quota: net_connect_unix(/var/run/dovecot/quota-warning) failed: Permission denied (euid=1000(luuk) egid=100(users) missing +r perm: /var/run/dovecot/quota-warning, dir owned by 0:0 mode=0755)
opensuse:/var/run/dovecot # ls -l /var/run/dovecot/quota-warning srw------- 1 dovecot root 0 May 12 18:18 /var/run/dovecot/quota-warning opensuse:/var/run/dovecot #
Changing the permissions using chmod +rw /var/run/dovecot/quota-warning is reset when dovecot is restarted.....
You should probably add mode = 0666 like so:
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = dovecot mode = 0666 } user = dovecot }
Indeed you can't use chmod from the command line because these sockets are created by dovecot when it starts up.
ok, it seems to work now ;)
but my quota-usage is dropping harder that it should
i started at 71%, received a file, it went to 74% deleted the message in Inbox deleted the message from Sent and not the quota is at 68%.....
Recovery is possible with: doveadm quota recalc -u
I understand you sent an email to yourself? If you gained one $message_size upon reception and lost 2*$message_size upon deletion from Inbox+Sent, I would suspect quota plugin isn't active when the message is being delivered. How are messages delivered? Dovecot LDA, LMTP or an external MTA? You really should use LDA or LMTP to handle quota accounting.
On 12-05-2012 19:48, Gedalya wrote:
I understand you sent an email to yourself? If you gained one $message_size upon reception and lost 2*$message_size upon deletion from Inbox+Sent, I would suspect quota plugin isn't active when the message is being delivered. How are messages delivered? Dovecot LDA, LMTP or an external MTA? You really should use LDA or LMTP to handle quota accounting.
Yes, i was sending it to meself...
Postfix delivers mail using procmail.
Next thing i need to read about mailservers are the LDA/LMTP pages....
Am 12.05.2012 20:35, schrieb Luuk@dovecot:
On 12-05-2012 19:48, Gedalya wrote:
I understand you sent an email to yourself? If you gained one $message_size upon reception and lost 2*$message_size upon deletion from Inbox+Sent, I would suspect quota plugin isn't active when the message is being delivered. How are messages delivered? Dovecot LDA, LMTP or an external MTA? You really should use LDA or LMTP to handle quota accounting.
Yes, i was sending it to meself... Postfix delivers mail using procmail. Next thing i need to read about mailservers are the LDA/LMTP pages....
this should be one of the first things
nobody needs procmail/shellscripts to get quota with postfix and a MDA with LMPT support wokring these days
usually the better way implementing services is to draw what exactly is needed and read docs how all this things can be achived
example from dbmail (dovecot should be the same) /etc/postfix/master.cf: dbmail-lmtp unix - - n - - lmtp -o disable_dns_lookups=yes
set the postfix-transport to "dbmail-lmtp:127.0.0.1:24" for each domain which should be delivered to LMTP and you are done, "dbmail-lmtp" is only a name
On 12-05-2012 20:42, Reindl Harald wrote:
Am 12.05.2012 20:35, schrieb Luuk@dovecot:
On 12-05-2012 19:48, Gedalya wrote:
I understand you sent an email to yourself? If you gained one $message_size upon reception and lost 2*$message_size upon deletion from Inbox+Sent, I would suspect quota plugin isn't active when the message is being delivered. How are messages delivered? Dovecot LDA, LMTP or an external MTA? You really should use LDA or LMTP to handle quota accounting.
Yes, i was sending it to meself... Postfix delivers mail using procmail. Next thing i need to read about mailservers are the LDA/LMTP pages....
this should be one of the first things
nobody needs procmail/shellscripts to get quota with postfix and a MDA with LMPT support wokring these days
usually the better way implementing services is to draw what exactly is needed and read docs how all this things can be achived
Everything (besides quota ;) is working as needed
example from dbmail (dovecot should be the same) /etc/postfix/master.cf: dbmail-lmtp unix - - n - - lmtp -o disable_dns_lookups=yes
set the postfix-transport to "dbmail-lmtp:127.0.0.1:24" for each domain which should be delivered to LMTP and you are done, "dbmail-lmtp" is only a name
i have a line like that in my master.cf, i reads: lmtp unix - - n - - lmtp
but (apparantly) is not used.
Before starting to use that, i should make sure all received mail keeps coming in at the right place...
participants (4)
-
Duane Hill
-
Gedalya
-
Luuk@dovecot
-
Reindl Harald