[Dovecot] Dovecot+Postfix+Mysql+quotas doesn't work
Hi ! I'm using postfix with mysql, dovecot and squirrelmail for WEBMAIL
In my dovecot.conf I've:
plugin { quota = maildir:User quota quota2 = maildir:Shared quota:ns=Public/ quota_rule = *:storage=400M quota_rule2 = Trash:storage=100M quota_exceeded_message = Quota excedida. Por favor, exclua alguns emails! quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80 }
In my webmail, he informs me that I'm using the percentage of quota. But I can't make the TRASH folder is ignored. That is, I can't put a higher limit on it than the others. Am I doing something wrong?
Another thing. I'm not receiving message of quota exceeded. This is with the MTA or dovecot?
############################################################################################################## ############################################################################################################## ############################################################################################################## ##############################################################################################################
My quota-warning.sh:
#!/bin/sh
PERCENT=$1 FROM="postmaster@xxxxxxxx.br" qwf="/tmp/quota.warning.$$"
echo "From: $FROM To: $USER To: postmaster@xxxxxxx.br Subject: Your email quota is $PERCENT% full Content-Type: text/plain; charset="UTF-8"
Sua caixa de e-mail está: $PERCENT% full." >> $qwf
cat $qwf | /usr/sbin/sendmail -f $FROM "$USER" rm -f $qwf
exit 0
############################################################################################################## ############################################################################################################## ##############################################################################################################
DOVECOT: dovecot.x86_64 1.0.7-7.el5 POSTFIX: postfix.x86_64 2:2.3.3-2.1.centos.mysql_pgsql MYSQL: mysql-server.x86_64 5.0.77-4.el5_5.4
thank's !
--
Atenciosamente;
Graciously;
*Lucas Possamai *
http://psyscrew.posterous.com/
"Sexo? O governo dá camisinha! Engravidou? Bolsa família! Preso? Ele dá dinheiro! Agora vai estudar pra você vê."
"Sucesso é a capacidade de enfrentar o fracasso sem perder o entusiasmo"
*INFORMAÇÃO DE SEGURANÇA:* Este e-mail é de uso restritamente pessoal. As informações nele contidas podem ser de caráter confidencial e/ou privilegiada. Se você não for o destinatário e recebeu a mensagem por engano, avise imediatamente o remetente e em seguida apague o e-mail, ficando, expressamente vedado o uso, cópia e/ou divulgação das informações contidas, sob pena de responsabilização.
*SAFETY INFORMATION:* This e-mail is strictly personal use. The information contained here may be confidential and / or privileged. If you aren't the intended recipient and received the message in error, please notify the sender immediately and delete the email, being expressly forbidden the use, copying and / or disclosure of information, under penalty of accountability. *P* Antes de imprimir, pense em sua responsabilidade e seu compromisso com o meio ambiente. *P* Before printing, think about your responsibility and commitment to the environment.**
PLEASE !
Any help?
2011/2/28 drum.lucas@gmail.com drum.lucas@gmail.com
Hi ! I'm using postfix with mysql, dovecot and squirrelmail for WEBMAIL
In my dovecot.conf I've:
plugin { quota = maildir:User quota quota2 = maildir:Shared quota:ns=Public/ quota_rule = *:storage=400M quota_rule2 = Trash:storage=100M quota_exceeded_message = Quota excedida. Por favor, exclua alguns emails! quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80 }
In my webmail, he informs me that I'm using the percentage of quota. But I can't make the TRASH folder is ignored. That is, I can't put a higher limit on it than the others. Am I doing something wrong?
Another thing. I'm not receiving message of quota exceeded. This is with the MTA or dovecot?
##############################################################################################################
##############################################################################################################
##############################################################################################################
##############################################################################################################
My quota-warning.sh:
#!/bin/sh
PERCENT=$1 FROM="postmaster@xxxxxxxx.br" qwf="/tmp/quota.warning.$$"
echo "From: $FROM To: $USER To: postmaster@xxxxxxx.br Subject: Your email quota is $PERCENT% full Content-Type: text/plain; charset="UTF-8"
Sua caixa de e-mail está: $PERCENT% full." >> $qwf
cat $qwf | /usr/sbin/sendmail -f $FROM "$USER" rm -f $qwf
exit 0
##############################################################################################################
##############################################################################################################
##############################################################################################################
DOVECOT: dovecot.x86_64 1.0.7-7.el5 POSTFIX: postfix.x86_64 2:2.3.3-2.1.centos.mysql_pgsql MYSQL: mysql-server.x86_64 5.0.77-4.el5_5.4
thank's !
--
Atenciosamente;
Graciously;
*Lucas Possamai *
http://psyscrew.posterous.com/
"Sexo? O governo dá camisinha! Engravidou? Bolsa família! Preso? Ele dá dinheiro! Agora vai estudar pra você vê."
"Sucesso é a capacidade de enfrentar o fracasso sem perder o entusiasmo"
*INFORMAÇÃO DE SEGURANÇA:* Este e-mail é de uso restritamente pessoal. As informações nele contidas podem ser de caráter confidencial e/ou privilegiada. Se você não for o destinatário e recebeu a mensagem por engano, avise imediatamente o remetente e em seguida apague o e-mail, ficando, expressamente vedado o uso, cópia e/ou divulgação das informações contidas, sob pena de responsabilização.
*SAFETY INFORMATION:* This e-mail is strictly personal use. The information contained here may be confidential and / or privileged. If you aren't the intended recipient and received the message in error, please notify the sender immediately and delete the email, being expressly forbidden the use, copying and / or disclosure of information, under penalty of accountability. *P* Antes de imprimir, pense em sua responsabilidade e seu compromisso com o meio ambiente. *P* Before printing, think about your responsibility and commitment to the environment.**
--
Atenciosamente;
Graciously;
*Lucas Possamai *
http://psyscrew.posterous.com/
"Sucesso é a capacidade de enfrentar o fracasso sem perder o entusiasmo"
"Success is the ability to cope with failure without losing enthusiasm"
*INFORMAÇÃO DE SEGURANÇA:* Este e-mail é de uso restritamente pessoal. As informações nele contidas podem ser de caráter confidencial e/ou privilegiada. Se você não for o destinatário e recebeu a mensagem por engano, avise imediatamente o remetente e em seguida apague o e-mail, ficando, expressamente vedado o uso, cópia e/ou divulgação das informações contidas, sob pena de responsabilização.
*SAFETY INFORMATION:* This e-mail is strictly personal use. The information contained here may be confidential and / or privileged. If you aren't the intended recipient and received the message in error, please notify the sender immediately and delete the email, being expressly forbidden the use, copying and / or disclosure of information, under penalty of accountability. *P* Antes de imprimir, pense em sua responsabilidade e seu compromisso com o meio ambiente. *P* Before printing, think about your responsibility and commitment to the environment.**
In my webmail, he informs me that I'm using the percentage of quota. But I can't make the TRASH folder is ignored. That is, I can't put a higher limit on it than the others. Am I doing something wrong?
We use something like this in our "user_query" SQL, which overrides the rules put in config file(s):
concat('*:bytes=', quota) AS quota_rule, 'INBOX.Trash:ignore' AS quota_rule2, 'INBOX.Spam:ignore' AS quota_rule3, 'INBOX.Virus:ignore' AS quota_rule4,
But we run version 2.0.9 - quota stuff changed a bit from 1 to 2. (I think I had to add the "INBOX." part.)
Another thing. I'm not receiving message of quota exceeded. This is with the MTA or dovecot?
That is another thing. Likely a bit different in Dovecot 2 now, but in any version, only the LDA knows when the theshold is being crossed @ deliver time. Dovecot's LDA can be configured to execute a script which must do the actual delivering of the warning message. Example script given in documentation is working for us.
ok. Thank's Ben.
My dovecot-sql.conf :
user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, 150 AS uid, 12 AS gid, CONCAT('dirsize:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota FROM mailbox WHERE username = '%u' AND active = '1'
So, I changed to: user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, 150 AS uid, 12 AS gid, CONCAT('*:bytes=', quota) AS quota_rule, 'INBOX.Trash:ignore' AS quota_rule2, 'INBOX.Spam:ignore' AS quota_rule3, 'INBOX.Virus:ignore' AS quota_rule4, FROM mailbox WHERE username = '%u' AND active = '1'
Are you agree?
Thank's again
2011/2/28 ben@electricembers.net
In my webmail, he informs me that I'm using the percentage of quota. But I
can't make the TRASH folder is ignored. That is, I can't put a higher limit on it than the others. Am I doing something wrong?
We use something like this in our "user_query" SQL, which overrides the rules put in config file(s):
concat('*:bytes=', quota) AS quota_rule, 'INBOX.Trash:ignore' AS quota_rule2, 'INBOX.Spam:ignore' AS quota_rule3, 'INBOX.Virus:ignore' AS quota_rule4,
But we run version 2.0.9 - quota stuff changed a bit from 1 to 2. (I think I had to add the "INBOX." part.)
Another thing. I'm not receiving message of quota exceeded. This is with
the MTA or dovecot?
That is another thing. Likely a bit different in Dovecot 2 now, but in any version, only the LDA knows when the theshold is being crossed @ deliver time. Dovecot's LDA can be configured to execute a script which must do the actual delivering of the warning message. Example script given in documentation is working for us.
--
Atenciosamente;
Graciously;
*Lucas Possamai *
http://psyscrew.posterous.com/
"Sucesso é a capacidade de enfrentar o fracasso sem perder o entusiasmo"
"Success is the ability to cope with failure without losing enthusiasm"
*INFORMAÇÃO DE SEGURANÇA:* Este e-mail é de uso restritamente pessoal. As informações nele contidas podem ser de caráter confidencial e/ou privilegiada. Se você não for o destinatário e recebeu a mensagem por engano, avise imediatamente o remetente e em seguida apague o e-mail, ficando, expressamente vedado o uso, cópia e/ou divulgação das informações contidas, sob pena de responsabilização.
*SAFETY INFORMATION:* This e-mail is strictly personal use. The information contained here may be confidential and / or privileged. If you aren't the intended recipient and received the message in error, please notify the sender immediately and delete the email, being expressly forbidden the use, copying and / or disclosure of information, under penalty of accountability. *P* Antes de imprimir, pense em sua responsabilidade e seu compromisso com o meio ambiente. *P* Before printing, think about your responsibility and commitment to the environment.**
On 1.3.2011, at 14.41, drum.lucas@gmail.com wrote:
user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, 150 AS uid, 12 AS gid, CONCAT('*:bytes=', quota) AS quota_rule,
Looks ok.
'INBOX.Trash:ignore' AS quota_rule2, 'INBOX.Spam:ignore' AS quota_rule3, 'INBOX.Virus:ignore' AS quota_rule4,
These are unnecessary here though. They work, but they're just extra unnecessary work for SQL server. You could just as well keep them in plugin { } section in config.
On 03/01/2011 06:58 PM Timo Sirainen wrote:
On 1.3.2011, at 14.41, drum.lucas@gmail.com wrote:
user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, 150 AS uid, 12 AS gid, CONCAT('*:bytes=', quota) AS quota_rule,
Looks ok.
Hum, I'd suggest: user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:~/Maildir' as mail …
Or remove it from your query and add "mail_location = maildir:~/Maildir" to your configuration.
Regards, Pascal
The trapper recommends today: c01dcofe.1106018@localdomain.org
participants (4)
-
ben@electricembers.net
-
drum.lucas@gmail.com
-
Pascal Volk
-
Timo Sirainen