Re: [Dovecot] Dovecot Postfix Quota Policy Service
On 2013-05-05, Robert Schetterer wrote: Am 04.05.2013 21:11, schrieb Daniel Luttermann: May 4 20:55:16 mail dovecot: quota-status(dan...@dlutt.de): Error: user dan...@dlutt.de: Error reading configuration: net_connect_unix(/usr/var/run/dovecot/config) failed: Permission denied Permissions of the Dovecot config service: srw--- 1 root root 0 May 4 20:53 /usr/var/run/dovecot/config Maybe the problem has something to do with the double space as pointed out by Andreas? quota-status entry has empty value maybe, sorry i cant test it here yet, did you use latest code from http://hg.dovecot.org/dovecot-2.2/ seems like there was a patch http://hg.dovecot.org/dovecot-2.2/rev/aefdf65442cc I've just compiled aefdf65442cc from source but the problem still exists, also the problem with the permissions of the Dovecot config service if I doesn't change the permission of the service. -- Daniel
Re: [Dovecot] Dovecot Postfix Quota Policy Service
On 2013-05-04, Robert Schetterer wrote: Am 03.05.2013 23:34, schrieb Daniel Luttermann: Zum Einsatz kommt aktuell Postfix 2.10.0 und Dovecot 2.2.1. Die Dovecot Quota Konfiguration sieht so aus, wie bei sys4 beschrieben: service quota-status { executable = quota-status -p postfix unix_listener /var/spool/postfix/private/quota-status { group = postfix mode = 0660 user = postfix } client_limit = 1 } Mittlerweile habe ich schon einige Optionen und Berechtigungen ausprobiert, aber der Fehler bleibt leider der gleiche. Hat vielleicht jemand noch einen Tip? Danke schon mal. besser hier nicht in deutsch sorry - I wanted to ask on the german Dovecot mailing list but sent this mail to the english list. du solltest nur Dovecot 2.2.1 verwenden der quota code in 2.1 ist nicht voellig vollstaendig das setup sieht auf den ersten Blick ok aus Current I'm using Dovecot 2.2.1 and Postfix 2.10.0. hast du es schon mal alternativ exakt wie beschrieben in http://sys4.de/de/blog/2013/04/05/dovecot-quota-mit-postfix-abfragen/ vor allem quota_grace = 10%% quota_status_success = DUNNO quota_status_nouser = DUNNO quota_status_overquota = 552 5.2.2 Mailbox is full / Mailbox ist voll etc nicht vergessen getestet ? yes, I've tried this (see doveconf/postconf below). alternativ versuch mal mode = 0666 fuer mich sieht es wie ein permission Problem aus, das könnte unterschiedlich sein je nach setup, user / group postfix muessen existieren usw When I use service config { unix_listener config { group = mode = 0666 user = } } then the error permission denied doesn't occur anymore but the error warning: access table unix:private/quota-status entry has empty value is the same. The verbose logging shows this: = May 4 14:01:52 mail dovecot: quota-status(dan...@dlutt.de): Debug: acl vfile: Global ACL directory: /etc/dovecot/global-acls May 4 14:01:52 mail dovecot: quota-status(dan...@dlutt.de): Debug: Namespace : type=shared, prefix=shared/%u/, sep=/, inbox=no, hidden=no, list=children, subscriptions=no location=mdbox:%h/sdbox May 4 14:01:52 mail dovecot: quota-status(dan...@dlutt.de): Debug: shared: root=/usr/var/run/dovecot, index=, indexpvt=, control=, inbox=, alt= May 4 14:01:52 mail dovecot: quota-status(dan...@dlutt.de): Debug: acl: initializing backend with data: vfile:/etc/dovecot/global-acls:cache_secs=300 May 4 14:01:52 mail dovecot: quota-status(dan...@dlutt.de): Debug: acl: acl username = dan...@dlutt.de May 4 14:01:52 mail dovecot: quota-status(dan...@dlutt.de): Debug: acl: owner = 0 May 4 14:01:52 mail dovecot: quota-status(dan...@dlutt.de): Debug: acl vfile: Global ACL directory: /etc/dovecot/global-acls May 4 14:01:52 mail postfix/smtpd[26993]: private/quota-status: wanted attribute: action May 4 14:01:52 mail postfix/smtpd[26993]: input attribute name: action May 4 14:01:52 mail postfix/smtpd[26993]: input attribute value: (end) May 4 14:01:52 mail postfix/smtpd[26993]: private/quota-status: wanted attribute: (list terminator) May 4 14:01:52 mail postfix/smtpd[26993]: input attribute name: (end) May 4 14:01:52 mail postfix/smtpd[26993]: check_table_result: unix:private/quota-status policy query May 4 14:01:52 mail postfix/smtpd[26993]: warning: access table unix:private/quota-status entry has empty value May 4 14:01:52 mail postfix/smtpd[26993]: generic_checks: name=check_policy_service status=1 May 4 14:01:52 mail postfix/smtpd[26993]: END Recipient address RESTRICTIONS May 4 14:01:52 mail postfix/smtpd[26993]: CHECKING RECIPIENT MAPS May 4 14:01:52 mail postfix/smtpd[26993]: ctable_locate: move existing entry key dan...@dlutt.de May 4 14:01:53 mail dovecot: lmtp(27012): Debug: auth input: dan...@dlutt.de home=/home/vmail/dlutt.de/daniel uid=5000 gid=5000 quota_rule=*:bytes=9 May 4 14:01:53 mail dovecot: lmtp(27012): Debug: Added userdb setting: plugin/quota_rule=*:bytes=9 May 4 14:01:53 mail dovecot: lmtp(27012, dan...@dlutt.de): Debug: Effective uid=5000, gid=5000, home=/home/vmail/dlutt.de/daniel May 4 14:01:53 mail dovecot: lmtp(27012, dan...@dlutt.de): Debug: Quota root: name=User quota backend=dict args=:proxy::quota May 4 14:01:53 mail dovecot: lmtp(27012, dan...@dlutt.de): Debug: Quota rule: root=User quota mailbox=* bytes=9 messages=0 May 4 14:01:53 mail dovecot: lmtp(27012, dan...@dlutt.de): Debug: Quota rule: root=User quota mailbox=Trash bytes=+104857600 messages=0 May 4 14:01:53 mail dovecot: lmtp(27012, dan...@dlutt.de): Debug: Quota warning: bytes=85500 (95%) messages=0 reverse=no command=quota-warning 95 dan...@dlutt.de May 4 14:01:53 mail dovecot: lmtp(27012, dan...@dlutt.de): Debug: Quota warning: bytes=72000 (80%) messages=0 reverse=no command=quota-warning 80 dan...@dlutt.de May 4 14:01:53 mail dovecot: lmtp(27012, dan...@dlutt.de): Debug: Quota grace: root=User quota bytes=9000 (10%) May 4 14:01:53
Re: [Dovecot] Dovecot Postfix Quota Policy Service
On 2013-05-04, Robert Schetterer wrote: Am 04.05.2013 15:06, schrieb Daniel Luttermann: service quota-status { client_limit = 1 executable = quota-status -p postfix unix_listener /var/spool/postfix/private/quota-status { group = postfix mode = 0660 user = postfix } try service quota-status { executable = quota-status -p postfix unix_listener /var/spool/postfix/private/quota-status { group = postfix mode = 0666 user = postfix } client_limit = 1 } OK, changed the permissions of the service as you suggested: srw-rw-rw- 1 postfix postfix 0 May 4 20:53 /var/spool/postfix/private/quota-status Log of the first incoming email: May 4 20:54:13 mail postfix/postscreen[12627]: CONNECT from [193.99.144.71]:46355 to [217.11.53.6]:25 May 4 20:54:13 mail postfix/postscreen[12627]: PASS OLD [193.99.144.71]:46355 May 4 20:54:13 mail postfix/smtpd[12631]: connect from web.heise.de[193.99.144.71] May 4 20:54:13 mail postfix/smtpd[12631]: warning: access table unix:private/quota-status entry has empty value Mail gets delivered... Second incoming email (mail.log) May 4 20:55:16 mail postfix/postscreen[12627]: CONNECT from [193.99.144.71]:33634 to [217.11.53.6]:25 May 4 20:55:16 mail postfix/postscreen[12627]: PASS OLD [193.99.144.71]:33634 May 4 20:55:16 mail postfix/smtpd[12631]: connect from web.heise.de[193.99.144.71] May 4 20:55:16 mail dovecot: quota-status(dan...@dlutt.de): Error: user dan...@dlutt.de: Error reading configuration: net_connect_unix(/usr/var/run/dovecot/config) failed: Permission denied May 4 20:55:16 mail postfix/smtpd[12631]: NOQUEUE: reject: RCPT from web.heise.de[193.99.144.71]: 450 4.7.1 dan...@dlutt.de: Recipient address rejected: Internal error occurred. Refer to server log for more information.; from=w...@heise.de to=dan...@dlutt.de proto=ESMTP helo=web.heise.de May 4 20:55:16 mail postfix/smtpd[12631]: disconnect from web.heise.de[193.99.144.71] mail.warn: May 4 20:55:16 mail dovecot: quota-status(dan...@dlutt.de): Error: user dan...@dlutt.de: Error reading configuration: net_connect_unix(/usr/var/run/dovecot/config) failed: Permission denied Permissions of the Dovecot config service: srw--- 1 root root 0 May 4 20:53 /usr/var/run/dovecot/config Maybe the problem has something to do with the double space as pointed out by Andreas? quota-status entry has empty value -- Daniel
[Dovecot] Dovecot Postfix Quota Policy Service
Hallo zusammen, über den Policy Service von Dovecot zum Abfragen der User Quotas wurde ja schon diskutiert - auch gibt es eine gute Anleitung zum Einrichten, nur leider bekomme ich den Policy Server nicht korrekt konfiguriert. Folgende Fehler werden protokolliert: May 3 22:00:13 mail postfix/smtpd[17463]: warning: access table unix:private/quota-status entry has empty value May 3 22:00:42 mail dovecot: quota-status(dan...@dlutt.de): Error: user dan...@dlutt.de: Error reading configuration: net_connect_unix(/usr/var/run/dovecot/config) failed: Permission denied Es ist dabei so, dass nach einem Reload der Dienste die erste Mail noch zugestellt wird, die folgende, eingehende Mail dann jedoch abgelehnt wird. Nachfolgend die kompletten Logeinträge: May 3 22:00:12 mail postfix/smtpd[17463]: connect from mail-ie0-x236.google.com[2607:f8b0:4001:c03::236] May 3 22:00:13 mail postfix/smtpd[17463]: warning: access table unix:private/quota-status entry has empty value May 3 22:00:13 mail postfix/smtpd[17463]: 0EB81172391A: client=mail-ie0-x236.google.com[2607:f8b0:4001:c03::236] May 3 22:00:13 mail postfix/cleanup[17475]: 0EB81172391A: message-id=CAKrzS114MaJGND9BxYUiixMMtORmXJqTA3W13B=qar0yw_n...@mail.gmail.com May 3 22:00:13 mail postfix/qmgr[17429]: 0EB81172391A: from=sen...@googlemail.com, size=5409, nrcpt=1 (queue active) May 3 22:00:13 mail postfix/smtpd[17463]: disconnect from mail-ie0-x236.google.com[2607:f8b0:4001:c03::236] May 3 22:00:13 mail klms-smtp_proxy: Message from sen...@googlemail.com to dan...@dlutt.de passed May 3 22:00:14 mail postfix/smtpd[17482]: connect from localhost[127.0.0.1] May 3 22:00:14 mail postfix/smtpd[17482]: 00776172391C: client=localhost[127.0.0.1], orig_client=mail-ie0-x236.google.com[2607:f8b0:4001:c03::236] May 3 22:00:14 mail postfix/cleanup[17475]: 00776172391C: message-id=CAKrzS114MaJGND9BxYUiixMMtORmXJqTA3W13B=qar0yw_n...@mail.gmail.com May 3 22:00:14 mail postfix/qmgr[17429]: 00776172391C: from=sen...@googlemail.com, size=6195, nrcpt=1 (queue active) May 3 22:00:14 mail postfix/smtpd[17482]: disconnect from localhost[127.0.0.1] May 3 22:00:14 mail postfix/smtp[17476]: 0EB81172391A: to=dan...@dlutt.de, relay=127.0.0.1[127.0.0.1]:10025, delay=1.2, delays=0.54/0.02/0/0.65, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 00776172391C) May 3 22:00:14 mail postfix/qmgr[17429]: 0EB81172391A: removed May 3 22:00:14 mail dovecot: lmtp(17484): Connect from local May 3 22:00:14 mail dovecot: lmtp(17484, dan...@dlutt.de): dEa8BE4XhFFMRAAAG4AjPw: sieve: msgid=CAKrzS114MaJGND9BxYUiixMMtORmXJqTA3W13B=qar0yw_n...@mail.gmail.com: stored mail into mailbox 'INBOX' May 3 22:00:14 mail dovecot: lmtp(17484): Disconnect from local: Successful quit May 3 22:00:14 mail postfix/lmtp[17483]: 00776172391C: to=dan...@dlutt.de, relay=mail.dlutt.de[private/dovecot-lmtp], delay=0.11, delays=0.05/0.02/0.01/0.03, dsn=2.0.0, status=sent (250 2.0.0 dan...@dlutt.de dEa8BE4XhFFMRAAAG4AjPw Saved) May 3 22:00:14 mail postfix/qmgr[17429]: 00776172391C: removed May 3 22:00:36 mail postfix/postscreen[17433]: CONNECT from [2607:f8b0:4001:c03::230]:43653 to [2a00:1828:2000:206::2]:25 May 3 22:00:42 mail postfix/postscreen[17433]: PASS NEW [2607:f8b0:4001:c03::230]:43653 May 3 22:00:42 mail postfix/smtpd[17463]: connect from mail-ie0-x230.google.com[2607:f8b0:4001:c03::230] May 3 22:00:42 mail dovecot: quota-status(dan...@dlutt.de): Error: user dan...@dlutt.de: Error reading configuration: net_connect_unix(/usr/var/run/dovecot/config) failed: Permission denied May 3 22:00:42 mail postfix/smtpd[17463]: NOQUEUE: reject: RCPT from mail-ie0-x230.google.com[2607:f8b0:4001:c03::230]: 450 4.7.1 dan...@dlutt.de: Recipient address rejected: Internal error occurred. Refer to server log for more information.; from=absen...@googlemail.com to=dan...@dlutt.de proto=ESMTP helo=mail-ie0-x230.google.com May 3 22:00:42 mail postfix/smtpd[17463]: disconnect from mail-ie0-x230.google.com[2607:f8b0:4001:c03::230] May 3 22:00:53 mail postfix/postfix-script[17560]: stopping the Postfix mail system May 3 22:00:53 mail postfix/master[17425]: terminating on signal 15 May 3 22:02:51 mail dovecot: master: Warning: Killed with signal 15 (by pid=17681 uid=0 code=kill) Das Problem tritt mit dem unix_listener, aber auch mit dem inet_listener auf - beide Male beschwert sich Dovecot über den Zugriff auf den Service config. Ich habe auch mal versucht, die Berechtigungen für den Service config auf World-Readable zu setzen, leider hat dies auch nicht geklappt, wobei ich nicht weiß, ob dieser unbedingt mit dem Problem etwas zu tun hat. Auch beim Debug-Logging sind leider nicht mehr Infos zum Fehler zu finden. Zum Einsatz kommt aktuell Postfix 2.10.0 und Dovecot 2.2.1. Die Dovecot Quota Konfiguration sieht so aus, wie bei sys4 beschrieben: service quota-status { executable = quota-status -p postfix unix_listener /var/spool/postfix/private/quota-status { group = postfix mode
Re: [Dovecot] Dovecot Postfix Quota Policy Service
On 2013-05-03, Daniel Luttermann wrote: Hallo zusammen, über den Policy Service von Dovecot zum Abfragen der User Quotas wurde ja schon diskutiert - auch gibt es eine gute Anleitung zum Einrichten, nur leider bekomme ich den Policy Server nicht korrekt konfiguriert. sorry, this was a question for the german Dovecot mailing list. -- Daniel
Re: [Dovecot] dovecot v-2.0, postfix+mysql configuration issue.
On 2013-03-28, Vimuth wrote: echo test | mail vim...@mydomain.rock [root@box1 ~]# tail -f /var/log/maillog Mar 26 07:00:44 box1 dovecot: auth: Error: sql(vim...@mydomain.rock): User query failed: Table 'mailserver.users' doesn't exist (using built-in default user_query: SELECT home, uid, gid FROM users WHERE username = '%n' AND domain = '%d') Mar 26 07:00:44 box1 dovecot: lda: Error: user vim...@mydomain.rock: Auth USER lookup failed Mar 26 07:00:44 box1 dovecot: lda: Fatal: Internal error occurred. Refer to server log for more information. Dovecot needs to know if the user exists and where the mails should be saved. You can use a dedicated user lookup query like SELECT home, uid, gid FROM users WHERE userid = '%u' or you can use a static userdb. See: http://wiki2.dovecot.org/UserDatabase/Static But it's also possible to combine passdb and userdb into a single lookup. This is explained here: http://wiki2.dovecot.org/UserDatabase/Prefetch Because you're using virtual users you'll find other useful informations here: http://wiki2.dovecot.org/VirtualUsers I guess you could start with a static userdb like userdb { driver = static args = uid=vmail gid=vmail home=/var/mail/%d/%n } In this example, mails are saved in /var/mail/domain/username. -- Daniel
Re: [Dovecot] problems with imaps
On 2013-02-22, Matthias Leopold wrote: with thunderbird 10.0.12 i can't connect to port 993 and get errors in the logs like TLS: SSL_read() failed: error:14094412:SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate (certificate generated by dovecot mkcert.sh) or TLS: SSL_read() failed: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca (certificate generated by own openssl cmdline) Did you create a Root CA certificate? If not, I would prefer to create your own CA and sign all certs with this Root CA certificate. You'll have to import the created Root CA certificate in Thunderbird and/or the Microsoft Certificate Store so that the applications can trust the self signed certificates. You could also use a free Certificate Authority like StartSSL but the Root CA certificate must also be available in the certificate store of the application (Thunderbird, MS, Opera...). -- Daniel
Re: [Dovecot] sdbox to mdbox
Joan Moreau wrote on 12/24/2010: Thanks for the link, but the page is not really speaking about the matter. I clarify my question: How to convert a sdbox system (in production) to mdbox without loosing any email ? you can use this command for example (without loosing emails): dsync -o mail_location=sdbox:/path_to_old_mailbox/sdbox mirror mdbox:/path_to_new_mailbox/mdbox You can stop Dovecot, convert your emails, change the Dovecot configuration to mdbox (instead of sdbox) and restart Dovecot. Maybe you could also use a script which runs after the user login. See http://wiki.dovecot.org/PostLoginScripting -- Daniel
Re: [Dovecot] Dovecot will not start, error in stat(/var/run/dovecot)
Frank Collette wrote on 11/14/2010: Error: stat(/var/run/dovecot) failed: Invalid argument Fatal: Invalid configuration in /etc/dovecot.conf Can someone please help me resolve this issue? I'm willing to pay if required to get this back up! I've been down since 11PM Saturday. could you please post the output of dovecot -n Are any other errors logged in mail.err or mail.info? Have you compiled Dovecot yourself or have you used a binary package? -- Daniel
Re: [Dovecot] Backing up dovecot
Spyros Tsiolis wrote on 11/12/2010: a. How safe will I be backing up dovecot b. What folders/files to backup It's enough to backup your Dovecot configuration files (usually the folder /etc/dovecot or /usr/local/etc/dovecot) and your SSL certs (if used). You should also backup your mailboxes (/var/MailRoot/domains) on a regular basis (hourly/daily with rsync for example). If you must reinstall your server you have to install Dovecot and restore your Dovecot config files from your backup. That should be all. P.S.: Depending of your authentication backend (database, PAM, LDAP..) you should also backup these informations so that users can login after a restore with the same credentials as before. -- Daniel
Re: [Dovecot] correct syntax for multiple ports
Kilburn Abrahams wrote on 12/11/2010: Hi, What is the correct format to specify multple ports in dovecot 2. With dovecot 1.2 listen = *:143 *:6188 worked fine. I cannot find any mention in the wiki2 about the different combinations of listen, address and port parameters and dovecot complains about the combinations I tried. Does not seem to work 1. inet_listener imap { listen = *:143 *:6188 } 2. inet_listener imap { address = *:143 *:6188 } 3. inet_listener imap { port = 143, 6188 or port = 143 6188 } This start dovecot, but roundcube will not connect on port 143, although Thunderbird will connect on 1432 and 6188 listen = *, :: 1. inet_listener imap { port 143 port = 6188 } This should work: listen = *:143, *:6188 -- Daniel
Re: [Dovecot] correct syntax for multiple ports
Kilburn Abrahams wrote on 12/11/2010: On 12/11/2010 10:17 PM, Daniel Luttermann wrote: Kilburn Abrahams wrote on 12/11/2010: Hi, What is the correct format to specify multple ports in dovecot 2. With dovecot 1.2 listen = *:143 *:6188 worked fine. I cannot find any mention in the wiki2 about the different combinations of listen, address and port parameters and dovecot complains about the combinations I tried. Does not seem to work 1. inet_listener imap { listen = *:143 *:6188 } 2. inet_listener imap { address = *:143 *:6188 } 3. inet_listener imap { port = 143, 6188 or port = 143 6188 } This start dovecot, but roundcube will not connect on port 143, although Thunderbird will connect on 1432 and 6188 listen = *, :: 1. inet_listener imap { port 143 port = 6188 } This should work: listen = *:143, *:6188 -- Daniel I tried that and get doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 68: Unknown setting: listen. Line 68 refers to listen = *:143, *:6188 OK, it seems that it's needed to specify multiple ports this way: service imap-login { inet_listener imap { port = 143 } inet_listener imap_second { port = 6188 } } -- Daniel
Re: [Dovecot] Problem with dovecot delivery (version 2.0.7)
Maxime Longuepee wrote on 11/10/2010: Here is the postconf -n: smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticatedpermit_tls_clientcerts reject_unauth_destinationreject_invalid_helo_hostname reject_non_fqdn_senderreject_non_fqdn_recipient reject_rbl_client cbl.abuseat.orgreject_rbl_client list.dsbl.orgreject_rbl_client opm.blitzed.org reject_rbl_client sbl.spamhaus.orgreject_rbl_client bl.spamcop.netreject_rbl_client dnsbl.sorbs.net=127.0.0.2 reject_rbl_client dnsbl.sorbs.net=127.0.0.3reject_rbl_client dnsbl.sorbs.net=127.0.0.4reject_rbl_client dnsbl.sorbs.net=127.0.0.5reject_rbl_client dnsbl.sorbs.net=127.0.0.7reject_rbl_client dnsbl.sorbs.net=127.0.0.9reject_rbl_client dnsbl.sorbs.net=127.0.0.11reject_rbl_client dnsbl.sorbs.net=127.0.0.12 these DNSBL's are dead: opm.blitzed.org list.dsbl.org -- Daniel
Re: [Dovecot] Problem with dovecot delivery (version 2.0.7)
Maxime Longuepee wrote on 11/10/2010: Here is the dovecot entry from master.cf: dovecot unix - n n - - pipe flags=DRhu user=dovecot:dovecot argv=/usr/local/libexec/dovecot/deliver -d ${recipient} Maybe the problem is that you run deliver as user dovecot. You should use another user/group for deliver. Also you should make sure that this user/group has correct permissions on /usr/vmail. (See also: http://wiki2.dovecot.org/UserIds) -- Daniel
Re: [Dovecot] Shared mailboxes in dovecot
Jay Mobile wrote on 11/02/2010: Hi, i hve a requirement of setting up two folders which should be shared only to selected users only. Pls note that my users are virtual and reside on mysql db. im using maildir as storage. lets assume user A wants to share a folder named shared with user B only. how can i get this done? Regards Jay you can find more informations in the Wiki. See: http://wiki2.dovecot.org/SharedMailboxes/Shared http://wiki2.dovecot.org/ACL (These informations are for Dovecot 2.x). You must define a namespace (shared) and create the appropriate acls. An acl looks like user=u...@example.com rl This acl (filename: dovecot-acl) can be stored in the folder you would like to share which means that user u...@example.com can read and list the mailbox. Some IMAP clients supports shared folders so if you configure Dovecot correctly you can manage this within your client software but you can also do this manually. -- Daniel
Re: [Dovecot] Convert Plugin
Dr Matthew Williams wrote on 10/27/2010: Hello, I have been investigating mailbox conversions and have used the convert plugin under Dovecot V1.x. I cannot find the plugin in the list on the wiki for Dovcot V2.x, is it not included for a reason? I understand that I can do a post-login script to do the conversion, any guidance on best practices? you can use dsync instead. Link: http://wiki2.dovecot.org/Tools/Dsync -- Daniel
Re: [Dovecot] Error or bug?
Robby Gunawan wrote on 10/21/2010: Dear all, Please help me, I just change from vm-pop3d to dovecot, installed from rpm that provided by dovecot.org, I got this error for random email user Command died with signal 11: /usr/libexec/dovecot/deliver maybe this patch helps? http://hg.dovecot.org/dovecot-2.0/rev/e2f9baa436f2 -- Daniel
Re: [Dovecot] anti-spam+anti-malware suggestions
Denny Lin wrote on 10/20/2010: Currently, I am using a setup with Postfix + Dovecot as well. We're using these DNSBL blacklists: zen.spamhaus.org b.barracudacentral.org cbl.abuseat.org bl.spamcop.net dnsbl.njabl.org info: it's not needed to use cbl.abuseat.org AND zen.spamhaus.org because the data from cbl is included in zen. Link: http://cbl.abuseat.org/faq.html -- Daniel
Re: [Dovecot] anti-spam+anti-malware suggestions
Jose Luis Faria wrote on 10/20/2010: Hello people, I am using now qmail in cluster with LDAP + Interscan Messaging Security Suite from Trendmicro. I need to develop a new solution with: - postfix - dovecot - anti-spam - anti-malware. I am thankful any help or suggestion for anti-spam and anti-malware. you can use several blacklists or header/body checks to block spam or malware to save your ressources. Another useful feature is the upcoming Postfix server postscreen - this feature will be available in Postfix 2.8. Info: http://www.postfix.org/POSTSCREEN_README.html Some header checks and maybe zen.spamhaus.org should block 85-95% of spam. All other messages can be scanned with spamassassin/amavisd/clamav or other commercial products. To block malware you could also look at: http://www.malwarepatrol.net/ Start with some good Postfix restrictions and then you can extend your setup with other filters/blacklists... -- Daniel
Re: [Dovecot] Error or bug?
Robby Gunawan wrote on 10/21/2010: how do I install / update to my system? Normally you should patch the file(s) in the source package. You can compile Dovecot from the official sources (apply the patch before), download/install Dovecot from Mercurial (hg.dovecot.org) or open a bugreport for the package maintainer so that the bug can be fixed for your distribution. -- Daniel
Re: [Dovecot] Why deliver+usercheck? deliver+MTA?
Lukas Haase wrote on 10/13/2010: Hi, I successfully configured dovecot using virtual users (and LDAP/AD). deliver is the LDA and verifies if the user exists (as recommended in the WIKI). However, the howtos in the Wiki say *nothing* about the case that the recipients should be verified *before* receiving the messages (prevent backscatter, ...). All configurations in the dovecot-Wiki (postfix and exim) just accept the mails and pass them to deliver. Also, all howtos which I found on the web. If the user does not exist, the mail is bounced because the mail was already accepted by the MTA. Nowadays this is an unacceptable configuration! By default, Postfix rejects mails for unknown local users.If Postfix accepts mails for unknown users than it's a configuration problem or you don't maintain a list of valid users. Is there a special reason why there is no discussion about this? It's Postfix related - Dovecot does no checks about valid recipients for Postfix but you can use the same data sources as for Dovecot - no need to maintain user lists for Postfix and Dovecot. Because Postfix needs to check for valid recipients why should there a special hint in the Dovecot Wiki about that? You must first make sure that Postfix works as expected - no other IMAP Server checks vor valid recipients. However, as postfix seems to be really too unflexible I have set up exim to handle incoming mail and do the usercheck in the router (with an LDAP query). But now the user is doubled-checked: Once when receiving with exim and a second time in deliver. This is not necessary, so I guess I can disable the LDAP query for deliver and set up a static userdb. Why is Postfix unflexible? Use reject_unverified_recipient for dynamic verification of valid recipients and there's no need to maintain static files. You could also use a LDAP query to retreive a list of valid recipients before you accept the mail for non-existing users. Why does the Wiki recommened to verfify with deliver when the user needs to be checked at the MTA anyway? Checking of valid recipients is a Postfix job so you can use relay_recipient_maps, reject_unverified_sender or virtual_mailbox_maps (depending on your configuration). Btw: what does the Wiki recommend? Weblink? -- Daniel
Re: [Dovecot] 2.0.5: quota warning failing
Ralf Hildebrandt wrote on 06.10.2010: From the log: Oct 6 09:54:10 postamt dovecot: imap(hkunte): Error: quota: connect(/usr/local/scripts/quota-warning2) failed: Permission denied From the config: quota = maildir quota_rule = INBOX.Trash:storage=+2048M quota_warning = storage=99%% /usr/local/scripts/quota-warning2 99 %u quota_warning2 = storage=95%% /usr/local/scripts/quota-warning2 95 %u quota_warning3 = storage=90%% /usr/local/scripts/quota-warning2 90 %u quota_warning4 = storage=85%% /usr/local/scripts/quota-warning2 85 %u service quota-warning { executable = script /usr/local/scripts/quota-warning2 # use some unprivileged user for executing the quota warnings user = vmail unix_listener quota-warning { } } But how exactly does this work? the user vmail cannot write to the users' mailboxes, so I'd have to run /usr/local/scripts/quota-warning2 as root, don't I? Personally I use this: service quota-warning { executable = script /usr/bin/quota-warning.sh user = vmail unix_listener quota-warning { mode = 0660 user = vmail group = vmail } } Same for some other sockets like dict... -- Daniel
Re: [Dovecot] Settings for unlimited quota for some mailboxes
Patrick Westenberg wrote on 26.09.2010: Hello, I´m using Dovecot 2.0.1 with quota support (quota and imap_quota) which works perfect. However, I´d like to give some mailboxes unlimited quota. What quota setting (in the backend (SLQ)) is needed to tell Dovecot as LDA that the mailbox has unlimited quota? 0 or NULL or -1 or something else? Regards Patrick I don't know if -1 is possible but 0 means unlimited. I use 0 in the SQL table and it's OK but I've never used NULL or something else. -- Daniel
Re: [Dovecot] tags disappear in Thunderbird
Stan Hoeppner wrote on 21.09.2010: Daniel Luttermann put forth on 9/21/2010 5:02 AM: I would also use maildir for all mailboxes instead of mbox for inbox... Do you have technical justification for this recommendation, or is this merely personal preference? If both exist on NFS storage in a Dovecot cluster environment I would tend to agree due to potential locking and caching issues. Regarding local storage I don't see how there would be much, if any, of an operational difference, performance or otherwise. I'm not calling BS here, but asking for solid technical reasoning behind the recommendation. Nothing technical - personal preference and as William wrote: reduced compexity. I don't see any benefit in the use of two different mailbox formats so I would tend to use only one of the available mailbox formats at once. Are there situations where two different formats will perform better or work more reliable? Why not use mdbox instead of a combination of mbox and maildir? -- Daniel
Re: [Dovecot] Moving from MBOX to Maildir or DBox ?
Frank Bonnet wrote on 16.09.2010: Hello Actually we use MBOX format for all our IMAP access but users complain they cannot create subfolders in imap folders, of course they cannot because of MBOX format ... I need gurus advices on changing mailbox format Maildir of Dbox ? What would be the safest way to go ? Note : we extensively use Thunderbird here. Thanks I'm using mdbox since a few months and I've no problems at all (but it's a smaller mail server). I think mdbox should perform better in large installations. For me one drawback is that you can not easily restore a single email of an user if he has accidently deleted one - this is no problem with maildir and maybe it's also possible with sdbox. With mdbox it's needed that you purge deleted mails. When a user deletes an email only the index is updated but the disk space is not freed automatically. One of the next Dovecot version comes with support for SIS (Single Instance Storage). With SIS and sbox or mdbox you can save attachments in seperate files. When you find this feature useful then you must use one of Dovecot's own mailbox formats. See this blog entry: http://blog.dovecot.org/2010/07/single-instance-attachment-storage.html -- Daniel
Re: [Dovecot] Certificate for outlook 2003
Richard Gliebe wrote on 12.09.2010: Hi all, We are running dovecot-1.0.7-7.el5 on a CentOS release 5.5 (Final) box. I know, its an old version, but it cames up with the CentOS release (yum). Anyway. Is there a way to import the certificate, which was generated with mkcert_dovecot.sh, permanently to the outlook 2003 clients? Every time, when our office 2003 clients fetches there emails (POP3s) from our dovecot server, they will be asked .., the CN-Name of this certificate doesn't match with the taken Value. Do you want to continue with this server?. sorry for the poor english translation. Here in german (for some german people): Der Server, mit dem Sie verbunden sind, verwendet ein Sicherheitszertifikat, das nicht verifiziert werden konnte. Der CN-Name des Zertifikates stimmt nicht mit dem übergebenen Wert überein. Möchten Sie diesen Server weiterhin verwenden? many thanks for some hints Richard Have you changed the value for # Common Name (*.example.com is also possible) CN=imap.example.com to match the hostname of your mail server before you've created the certificate? You can import the certificate in the certificate store of Windows but the error will be same because the hostname does not match the hostname in your certificate. You could also setup your own private CA or use a public one to sign your certificates - this is the preferred way. See also: http://wiki.dovecot.org/SSL/CertificateCreation -- Daniel
Re: [Dovecot] passwd(cont...@akairnet.com, 91.121.76.71): unknown user
Kurt22 wrote on 12.08.2010: But in mail.log I have now a new problem T_T connect to transport dovecot: Connection refused Aug 12 15:13:45 ns351550 postfix/master[19833]: daemon started -- version 2.5.5, configuration /etc/postfix Aug 12 15:17:42 ns351550 postfix/smtpd[20037]: connect from web24404.mail.ird.yahoo.com[87.248.114.216] Aug 12 15:17:42 ns351550 postfix/smtpd[20037]: 8F3A73BA9A: client=web24404.mail.ird.yahoo.com[87.248.114.216] Aug 12 15:17:42 ns351550 postfix/cleanup[20041]: 8F3A73BA9A: message-id=525519.24632...@web24404.mail.ird.yahoo.com Aug 12 15:17:42 ns351550 postfix/qmgr[19840]: 8F3A73BA9A: from=fwd...@yahoo.fr, size=3516, nrcpt=1 (queue active) Aug 12 15:17:42 ns351550 postfix/qmgr[19840]: warning: connect to transport dovecot: Connection refused do you've the appropriate entry for the Dovecot LDA in master.cf like dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} See also: http://wiki.dovecot.org/LDA/Postfix -- Daniel
Re: [Dovecot] passwd(cont...@akairnet.com, 91.121.76.71): unknown user
Kurt22 wrote on 12.08.2010: In fact I don't have :s but now in my mail.log - local configuration error Aug 12 16:35:19 ns351550 postfix/pipe[24171]: B06633BA9B: to=cont...@akairnet.com, relay=dovecot, delay=0.11, delays=0.07/0.01/0/0.03, dsn=5.3.5, status=bounced (local configuration error). And so in dovecot log unknow user. Do you think if I want all reinstal my server ? xD I have upload my http://old.nabble.com/file/p29419546/master.cf master.cf file if you want to look my file. OK, looks not so bad - it seems this is a configuration error in the dovecot.conf (especially in the LDA section). Are there any other fatal warnings in the log a few lines before the above message? What's the output of dovecot -n? -- Daniel
Re: [Dovecot] passwd(cont...@akairnet.com, 91.121.76.71): unknown user
Kurt22 wrote on 11.08.2010: I have a probleme with my configuration of dovecot I think. I have no problem for send a email but I don't want receive a email. In my /var/log/mail.log I have : Quote: connect from mail-ww0-f45.google.com[74.125.82.45] Aug 11 14:21:58 ns351550 postfix/smtpd[1844]: NOQUEUE: reject: RCPT from mail-ww0-f45.google.com[74.125.82.45]: 550 5.1.1 cont...@akairnet.com: Recipient address rejected: User unknown in local recipient table; from=fwd...@gmail.com to=cont...@akairnet.com proto=ESMTP helo=mail-ww0-f45.google.com Aug 11 14:21:58 ns351550 postfix/smtpd[1844]: disconnect from mail-ww0-f45.google.com[74.125.82.45] so...problem on : OK, user is unknown - you've commented out local_recipient_maps so the default value is local_recipient_maps = proxy:unix:passwd.byname $alias_maps mydestination = localhost, localhost.akairnet.com, akairnet.com #local_recipient_maps = Is the user contact existent in /etc/passwd? If you use your domain in mydestination then Postfix tries to find the user in /etc/passwd or /etc/aliases. If the user is not found then the above error is logged. -- Daniel
Re: [Dovecot] passwd(cont...@akairnet.com, 91.121.76.71): unknown user
Kurt22 wrote on 11.08.2010: Thanks Daniel, my log have evolued but i have always the problem. I use a mysql db authentification so I have replace your answer by : local_recipient_maps = mysql:/etc/postfix/mysql-virtual_comptes.cf with in mysql-virtual_comptes.cf : hosts = 127.0.0.1 user = password = dbname = x table = users select_field = CONCAT(SUBSTRING_INDEX(username,'@',-1),'/',SUBSTRING_INDEX(username,'@',1),'/') where_field = username in mail.log : Aug 11 20:35:22 ns351550 postfix/local[24266]: DA0353BA95: to=cont...@akairnet.com, relay=local, delay=0.13, delays=0.12/0/0/0, dsn=5.1.1, status=bounced (unknown user: contact) Hmm, first: the sql query for postfix above version 2.2 has changed. The query (new) looks like: query = SELECT value FROM table WHERE value='%s' See: http://www.postfix.org/MYSQL_README.html Depending on your mysql fields you can also use query = SELECT username FROM users WHERE username='%s' It's not really needed to works with concat etc. Your config looks like that you want to use virtual users and domains because you use virtual_mailbox_domains and other virtual related config options. For virtual users and domains you should not list your virtual domains in $mydestination. All virtual users should be in your database so that you can use the Dovecot LDA for delivery as you've set with virtual_transport = dovecot. I suggest to leave local_recipient_maps at the default value and use virtual_mailbox_domains, virtual_alias_maps and virtual_transport instead. You must also change $mydestination because you can not define a domain as virtual and local domain. If you use a mysql table for local users make sure that the user can be found. You can test this also with postmap -q cont...@your-domain mysql:/etc/postfix/mysql-virtual_comptes.cf If the query is correct you should get back the correct value. If so, Postfix should be able to deliver the mail. -- Daniel
Re: [Dovecot] SSHA256 scheme
Patrick Westenberg wrote on 31.07.2010: Hallo, Daniel Luttermann schrieb: Your PHP application generates the password with the given scheme and write it to the password field. wie soll ich denn via PHP dass Passwort generieren, wenn ich nicht weis in welcher Art und Weise Passwort und Salt miteinander kombiniert werden müssen damit Dovecot es versteht. Gruß Patrick I'm not familiar with this but there were a thread in February this year about salted passwords: http://www.dovecot.org/list/dovecot/2010-February/046715.html As far as I know dovecotpw or doveadm creates a random salt on every run so when you use PHP it should be possible to use standard routines with a random salt. -- Daniel
Re: [Dovecot] Convert plugin
Egbert wrote on 30.07.2010: Op 30-7-2010 0:07, Daniel Luttermann schreef: Egbert wrote on 29.07.2010: Hi, I'm trying to convert users from a sendmail server to a postfix/dovecot server. All works fine but one of the last things is to rescue the messages in /var/mail/user on the old server. This seems very straitforward using the convert plugin but with the settings from the wiki, nothing happens when the user logs in. Do I need a private namespace for this as suggested elsewhere in the wiki? No hint in the logfile? Maybe a permission problem or Dovecot can't find any emails? If nothing is logged maybe it helps when you set mail_debug=yes in dovecot.conf? Btw: it seems that in the upcoming Dovecot 2.0 version there's no convert plugin available anymore - with 2.0 you can use dsync to convert emails between different mailbox formats. -- Daniel Yeah, the obvious place to look. There I found out that the plugin looks for a direcory in /var/mail/ called user and in that directory a mailfile called 'inbox' is expected. So I have now the convert in imap and pop3 chapters of dovecot.conf and enabled the plugin in the plugin section: protocol imap { mail_plugins = convert } protocol pop3 { mail_plugins = convert } plugin { convert_mail = mbox:/var/mail/%u } So things finally start to work. Only the rename of the /var/mail/user directory doesn't work yet. Wrong owner. I made /var/mail owned by vmail:vmail but that is not good. Maybe it should be owned by dovecot. Who is the owner of the convert process? EJ I think that vmail should be the correct user/group for this but it could be a problem if the source and destination directories are the same (home directory is the same as mail_location). Have you set a different mail location? I think Dovecot can't rename the old directory if the new mail location is in the same directory. -- Daniel
Re: [Dovecot] Convert plugin
Egbert wrote on 29.07.2010: Hi, I'm trying to convert users from a sendmail server to a postfix/dovecot server. All works fine but one of the last things is to rescue the messages in /var/mail/user on the old server. This seems very straitforward using the convert plugin but with the settings from the wiki, nothing happens when the user logs in. Do I need a private namespace for this as suggested elsewhere in the wiki? No hint in the logfile? Maybe a permission problem or Dovecot can't find any emails? If nothing is logged maybe it helps when you set mail_debug=yes in dovecot.conf? Btw: it seems that in the upcoming Dovecot 2.0 version there's no convert plugin available anymore - with 2.0 you can use dsync to convert emails between different mailbox formats. -- Daniel
Re: [Dovecot] SSHA256 scheme
Patrick Westenberg wrote on 28.07.2010: Daniel Luttermann schrieb: when you create a password with dovecotpw or doveadm you can copypaste the generated password into your database. I can´t use dovecotpw. Passwords will be generated by PHP (webfrontend). should be no problem... Personlly I use Horde/IMP with passwd - in the passwd plugin I can configure which encryption/hash should be used for the generated passwords (SHA,SSHA,PLAIN...). Your PHP application generates the password with the given scheme and write it to the password field. When you configure your PHP application to generate SHA,SSHA... passwords then you should also use default_pass_scheme = in dovecot-sql.conf. -- Daniel
Re: [Dovecot] SSHA256 scheme
Patrick Westenberg wrote on 27.07.2010: Hi again, I`m a bit confused how to store a SSHA256 password in the database and I can`t find any information in the wiki. Do I have to store the SHA256 hash and the salt separately (what would the password_query be like in this way) or just the final SSHA256 hash? when you create a password with dovecotpw or doveadm you can copypaste the generated password into your database. If you use the same password scheme for all users you can use default_pass_scheme = ... or as far as I know you can also override the password scheme for the users in MySQL. Just insert the password with the scheme prefix like {SHA256}Password into your MySQL password field to override the default password scheme. The query looks like password_query = SELECT username, password \ FROM users WHERE username = '%u' even for other password schemes than PLAIN... -- Daniel
Re: [Dovecot] quota warning error with dict
Timo Sirainen wrote on 26.07.2010: On Sat, 2010-07-24 at 01:58 +0200, Daniel Luttermann wrote: cat EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o plugin/quota=dict:user::proxy::quota quota:noenforcing quota = dict:user::proxy::quota Well, this isn't right.. Assuming dict works normally, dovecot-lda should be called with one of the following: -o plugin/quota=dict:user:noenforcing::proxy::quota doesn't work. Error: Error: Unknown dict module -o plugin/quota=dict:user::noenforcing:proxy::quota works :-) -o plugin/quota=dict:user::proxy:noenforcing::quota doesn't work. Error: Error: net_connect_unix(noenforcing) failed: No such file or directory -o plugin/quota=dict:user::proxy::noenforcing:quota doesn't work. Error: Unconfigured dictionary name 'noenforcing:quota' I can never remember which one it is. Should write it to wiki Yes, this would be nice. I've had some problems to figure out the correct syntax of the command line for the LDA... Also I've never tried to use noenforcing at this postion. Thanks. -- Daniel
[Dovecot] quota warning error with dict
Version: Dovecot 2.0rc3 Hi, I try to get the quota-warning.sh script working with quota/dict but I get some errors. The script looks like: #!/bin/sh PERCENT=$1 USER=$2 cat EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o plugin/quota=dict:user::proxy::quota quota:noenforcing From: qu...@dlutt.de Subject: quota warning Your mailbox is now $PERCENT% full. EOF In 90-quota I use: plugin { quota = dict:user::proxy::quota quota_rule = *:storage=0 } service dict { unix_listener dict { mode = 0660 user = vmail group = vmail } } plugin { quota_warning = storage=90%% quota-warning 90 %u quota_warning2 = storage=80%% quota-warning 80 %u } service quota-warning { executable = script /usr/bin/quota-warning.sh user = vmail unix_listener quota-warning { mode = 0660 user = vmail group = vmail } } When a mailbox is nearly full I get this error: Jul 24 01:08:34 tux dovecot: dict: Error: dict client: Broken handshake Jul 24 01:08:34 tux dovecot: lda(testu...@dlutt.de): Error: read(/var/run/dovecot/dict) failed: Remote disconnected Jul 24 01:08:34 tux dovecot: lda(testu...@dlutt.de): Error: Internal quota calculation error Jul 24 01:08:34 tux dovecot: master: Error: service(quota-warning): child 8139 returned error 75 Jul 24 01:18:11 tux dovecot: dict: Error: dict client: Broken handshake Jul 24 01:18:11 tux dovecot: lda(testu...@dlutt.de): Error: read(/var/run/dovecot/dict) failed: Remote disconnected Jul 24 01:18:11 tux dovecot: lda(testu...@dlutt.de): Error: Internal quota calculation error Jul 24 01:18:11 tux dovecot: master: Error: service(quota-warning): child 8201 returned error 75 Thanks. -- Daniel
[Dovecot] quota-warning example script from wiki2
Hi, in the wiki there's an example script for sending an email to an user that has exceeded his quota. Link: http://wiki2.dovecot.org/Quota/Configuration The dovecot deliver command line is: dovecot-lda -d $USER -o plugin/quota=maildir:User quota:noenforcing I wonder about -o: seems to be undocumented because I've found no information about this parameter. If this parameter is needed what if I use dict instead of maildir? Is the syntax different? Thanks. -- Daniel
Re: [Dovecot] Global sieve filter ignored (Long)
Larry Crouch wrote on 22.07.2010: Lately though I considered filtering spam with a global sieve filter. I created the /var/vmail/globalsieverc file which contains: require [fileinto]; # Move spam to spam folder if header :contains X-Spam-Flag [YES] { fileinto spam; stop; } Made certain it was owned by vmail. Changed the last stanza of /etc/dovecot/dovecot.conf which in labeled plugin: sieve_global_path = /var/vmail/globalsieverc Restarted dovecot Sent a known spam email (GTUBE) The resulting email is always delivered to INBOX: 2010-07-19 03:35:19 deliver(x...@xxx.xxx): Info: msgid=: saved mail to INBOX Have you enabled sieve for the LDA? Example: protocol lda { mail_plugins = sieve ... ... } -- Daniel
Re: [Dovecot] Unknown column username in where clause
Timo Sirainen wrote on 20.07.2010: On 19.7.2010, at 22.59, Daniel Luttermann wrote: The queries uses only userid instead of username so I think if one sql field were missing it should report that userid could not be found because the query is FROM users WHERE userid = '%u'. I've not select username in any sql select so I wonder where does this name come from. There's actually a default query.. Hmm. Maybe it should be made empty, since probably no one wants to use it. hmm, I've nothing read about that - but it's OK because the examples in the wiki creates tables with the field username instead of userid which I've used so the default query should then match... password_query = SELECT userid AS user, password, \ home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, \ concat('*:bytes=', quota_bytes) as userdb_quota_rule \ FROM users WHERE userid = '%u' You must also have a user_query for LDA/LMTP. OK, it seems to be working if I add this in dovecot-sql.conf.ext too: user_query = SELECT home, uid, gid, \ concat('*:bytes=', quota_bytes) as quota_rule \ FROM users WHERE userid = '%u' -- Daniel
[Dovecot] Unknown column username in where clause
Version: Dovecot 2.0 rc2 I'm testing Dovecot with MySQL quotas but I get always this error for incoming mails: tux dovecot: lmtp(4928): Error: user testu...@dlutt.de: Auth USER lookup failed tux dovecot: auth: Error: mysql: Query failed, retrying: Unknown column 'username' in 'where clause' I dont' know where the field username should come from because I don't use this field (or query). The relevant files are: dovecot-sql.conf.ext password_query = SELECT userid AS user, password, \ home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, \ concat('*:bytes=', quota_bytes) as userdb_quota_rule \ FROM users WHERE userid = '%u' auth-sql.conf.ext = passdb { driver = sql args = /etc/dovecot/dovecot-sql.conf.ext } userdb { driver = prefetch } userdb { driver = sql args = /etc/dovecot/dovecot-sql.conf.ext } 90-quota.conf = plugin { quota = dict:user::proxy::quota quota_rule = *:storage=0 } dovecot-dict-sql.conf.ext = map { pattern = priv/quota/storage table = quota username_field = userid value_field = bytes } map { pattern = priv/quota/messages table = quota username_field = userid value_field = messages } I've grepped through all config files but I can't find any (active) query which uses the above where username= The quota db gets correctly updated if an user logs in so the problem only exists during mail delivery. My SQL tables were crated as follows: CREATE TABLE IF NOT EXISTS `users` ( `userid` varchar(100) NOT NULL, `password` varchar(64) NOT NULL, `home` varchar(255) NOT NULL, `uid` int(11) NOT NULL, `gid` int(11) NOT NULL, `quota_bytes` varchar(10) NOT NULL, PRIMARY KEY (`userid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `quota` ( `userid` varchar(100) NOT NULL, `bytes` bigint(20) NOT NULL default '0', `messages` int(11) NOT NULL default '0', PRIMARY KEY (`userid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- Daniel
Re: [Dovecot] Unknown column username in where clause
Anton Dollmaier wrote on 19.07.2010: Hi, I dont' know where the field username should come from because I don't use this field (or query). perhabs this is the problem? The queries uses only userid instead of username so I think if one sql field were missing it should report that userid could not be found because the query is FROM users WHERE userid = '%u'. I've not select username in any sql select so I wonder where does this name come from. Output of dovecot -n would be better, together with the additional files. dovecot -n == # 2.0.rc2 (7dd7adba1c9e): /etc/dovecot/dovecot.conf # OS: Linux 2.6.33.2 x86_64 Debian 5.0.5 auth_username_format = %Lu dict { quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext } hostname = tux.linuxmail.at listen = 89.238.81.84 mail_location = mdbox:~/mdbox mail_plugins = acl quota mail_privileged_group = vmail managesieve_notify_capability = mailto managesieve_sieve_capability = comparator-i;octet comparator-i;ascii-casemap fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date spamtest spamtestplus virustest namespace { hidden = no inbox = yes location = prefix = separator = / subscriptions = yes type = private } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } plugin { acl = vfile:/etc/dovecot/global-acls/%d:cache_secs=300 quota = dict:user::proxy::quota quota_rule = *:storage=0 sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } postmaster_address = m...@dlutt.de protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } user = $default_internal_user } service dict { unix_listener dict { group = vmail mode = 0660 user = vmail } } service imap-login { inet_listener imap { port = 143 } } service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0660 user = postfix } } service managesieve-login { inet_listener sieve { address = 127.0.0.1 port = 4190 } } ssl_cert = /etc/ssl/certs/dovecot.pem ssl_key = /etc/ssl/private/dovecot.key userdb { driver = prefetch } userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lmtp { mail_plugins = $mail_plugins sieve } protocol imap { mail_plugins = $mail_plugins imap_acl imap_quota } Additional files /etc/dovecot/dovecot-dict-sql.conf.ext connect = host=/var/run/mysqld/mysqld.sock dbname=mail user=user password=pwd map { pattern = priv/quota/storage table = quota username_field = userid value_field = bytes } map { pattern = priv/quota/messages table = quota username_field = userid value_field = messages } /etc/dovecot/dovecot-sql.conf.ext driver = mysql connect = host=/var/run/mysqld/mysqld.sock dbname=mail user=user password=pwd default_pass_scheme = PLAIN password_query = SELECT userid AS user, password, \ home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, \ concat('*:bytes=', quota_bytes) as userdb_quota_rule \ FROM users WHERE userid = '%u' -- Daniel
[Dovecot] mdbox expunge purge question
Hi, I'm testing Dovecot 2.0rc2 with mdbox mail format and I'm not sure what this exactly means: http://wiki2.dovecot.org/MailboxFormat/dbox Quote from wiki page: = Expunging a message only decreases the message's refcount. The space is later freed in purge step. This may be done automatically within the session or later in a nightly cronjob when there's less disk I/O. = So this means that even if a user deletes a mail the space gets only freed if I run doveadm purge manually or an user requests this over his mail client? When the expunge plugin is used the deleted mails are stored in a special mailbox in the users mailbox so it's needed to use the expire plugin too if this should be done automatically? Is it recommend to run doveadm purge periodically if mdbox is used? Btw: when I try to run doveadm -Dv expunge -u testu...@dlutt.de mailbox Trash savedbefore 30d for example I get such an error: doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules/doveadm doveadm(root): Error: dlopen(/usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so) failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so: undefined symbol: expire_set_lookup doveadm(root): Error: dlopen(/usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so) failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so: undefined symbol: quota_user_module Plugin expire or expunge is not currently enabled in Dovecot's config. Thanks for any hints. Daniel