[Dovecot] Gettings mails recently moved to a folder
Hello,
some spam training tools learn the same message over and over again. Since I want to use a daily cronjob to train messages and I do not want to have the same messages trained multiple times, I need to way to get new messages in a folder.
Is there a (consolish) way to get a list of messages that were recently moved to a folder? dovecot does not modify mtime, according to RFC 3501.
Thanks, Florian
On 11/21/2013 11:11 AM Florian Lindner wrote:
Hello,
some spam training tools learn the same message over and over again. Since I want to use a daily cronjob to train messages and I do not want to have the same messages trained multiple times, I need to way to get new messages in a folder.
Is there a (consolish) way to get a list of messages that were recently moved to a folder? dovecot does not modify mtime, according to RFC 3501.
Does doveadm search -u spam@xgm.de mailbox INBOX SAVEDSINCE 2013-11-21
list the wanted messages? For more details see doveadm-search(1) and
doveadm-search-query(7).
Regards, Pascal
The trapper recommends today: cafefeed.1332518@localdomain.org
Am Donnerstag, 21. November 2013, 17:28:18 schrieb Pascal Volk:
On 11/21/2013 11:11 AM Florian Lindner wrote:
Hello,
some spam training tools learn the same message over and over again. Since I want to use a daily cronjob to train messages and I do not want to have the same messages trained multiple times, I need to way to get new messages in a folder.
Is there a (consolish) way to get a list of messages that were recently moved to a folder? dovecot does not modify mtime, according to RFC 3501.
Does
doveadm search -u spam@xgm.de mailbox INBOX SAVEDSINCE 2013-11-21
list the wanted messages? For more details see doveadm-search(1) and doveadm-search-query(7).
Not really:
% doveadm search -u mailinglists@xgm.de mailbox INBOX SAVEDSINCE 2013-11-21
doveadm(mailinglists@xgm.de): Error: user mailinglists@xgm.de: Initialization failed: Namespace '': Mail storage autodetection failed with home=/home/flindner/Mail/mailinglists@xgm.de doveadm(mailinglists@xgm.de): Fatal: User init failed
Which seems to be another problem. IMAP and POP3 work fine, but on occasions like that dovecot fails to detect that it is a maildir.
Problem may be that in my database home and mail location is identical (and there is no way to change that). Is there a way to tell dovecot that every mailbox is a maildir without modifying the database?
Thanks, Florian
On 2013-12-02 9:24 AM, Florian Lindner <mailinglists@xgm.de> wrote:
Problem may be that in my database home and mail location is identical (and there is no way to change that). Is there a way to tell dovecot that every mailbox is a maildir without modifying the database?
There are very good reasons why this is broken...
And I highly doubt that it *can't* be changed... you just don't want to go through the pain, right?
Personally, I think you should rethink this decision, but if you still 'can't, then learn to live with the pain.
--
Best regards,
*/Charles/*
Am Montag, 2. Dezember 2013, 09:29:54 schrieb Charles Marcus:
On 2013-12-02 9:24 AM, Florian Lindner <mailinglists@xgm.de> wrote:
Problem may be that in my database home and mail location is identical (and there is no way to change that). Is there a way to tell dovecot that every mailbox is a maildir without modifying the database?
There are very good reasons why this is broken...
And I highly doubt that it *can't* be changed... you just don't want to go through the pain, right?
Personally, I think you should rethink this decision, but if you still 'can't, then learn to live with the pain.
Actually I don't really understand why that is so strictly enforced as a number of dovecot tools (deliver, doveadm) refuse to work while imap is working perfectly without any additional settings or workarounds.
My maildir show a number of folders like .*, the usual cur, new, tmp and the dovecot* files. I don't see any possible name clash there, even without stat'ing the entries to test if it's a directory.
I just need to disable the mail storage autodetection and set it always maildir. Prefixing the database entry for the mail field with maildir: changes nothing.
I've read the warnings about having mail == home but honestly I don't understand. Sorry if I miss the point here, but I'm eager to learn.
Kind Regards, Florian
On 2013-12-02 12:24 PM, Florian Lindner <mailinglists@xgm.de> wrote:
I've read the warnings about having mail == home but honestly I don't understand. Sorry if I miss the point here, but I'm eager to learn.
Sorry, I don't understand the gory details of the 'why' myself beyond the obvious - when you tell dovecot where the mail_location is, it expects there to *only* *be* *mail* there.
Expecting dovecot to handle every possible circumstance of other possible files that someone might decide to dump in there is unreasonable.
Not to mention the possibility of some other software messing with dovecots files.
It simply is a really, really bad idea to use a directory that the user has direct access to for their mail location.
You don't put postfix's spool directory in home do you?
--
Best regards,
*/Charles/*
Charles Marcus skrev den 2013-12-02 18:44:
You don't put postfix's spool directory in home do you?
that was unfait
i think OP confuse ~ dovecot with HOME env variable, not neaseserly in /home/vmail
just remember if useradd vmail make it not share groups with login users should keep it safe to use /home path
On 2.12.2013, at 16.24, Florian Lindner <mailinglists@xgm.de> wrote:
doveadm(mailinglists@xgm.de): Error: user mailinglists@xgm.de: Initialization failed: Namespace '': Mail storage autodetection failed with home=/home/flindner/Mail/mailinglists@xgm.de doveadm(mailinglists@xgm.de): Fatal: User init failed
Which seems to be another problem. IMAP and POP3 work fine, but on occasions like that dovecot fails to detect that it is a maildir.
If something works fine for imap and pop3, but not for doveadm (for the same user), then the difference is that imap/pop3 sees different settings (e.g. in protocol imap {}).
Am Montag, 2. Dezember 2013, 20:26:13 schrieb Timo Sirainen:
On 2.12.2013, at 16.24, Florian Lindner <mailinglists@xgm.de> wrote:
doveadm(mailinglists@xgm.de): Error: user mailinglists@xgm.de: Initialization failed: Namespace '': Mail storage autodetection failed with home=/home/flindner/Mail/mailinglists@xgm.de doveadm(mailinglists@xgm.de): Fatal: User init failed
Which seems to be another problem. IMAP and POP3 work fine, but on occasions like that dovecot fails to detect that it is a maildir.
If something works fine for imap and pop3, but not for doveadm (for the same user), then the difference is that imap/pop3 sees different settings (e.g. in protocol imap {}).
Actually there isn't a protocol imap {} section. Or am I missing something?
Thanks, Florian
# doveconf -n # 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.2 auth_mechanisms = plain login digest-md5 cram-md5 ntlm namespace inbox { inbox = yes location = mailbox Drafts { auto = create special_use = \Drafts } mailbox Junk { auto = create special_use = \Junk } mailbox Sent { auto = create special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Spam { special_use = \Junk } mailbox Trash { auto = create special_use = \Trash } prefix = } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocols = imap pop3 service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } } ssl_cert = </etc/ssl/astarte.centershock.net.cert ssl_key = </etc/ssl/astarte.centershock.net.key userdb { driver = prefetch } userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql }
On 12/03/2013 10:40 AM Florian Lindner wrote:
Actually there isn't a protocol imap {} section. Or am I missing something?
Thanks, Florian
# doveconf -n # 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.2 auth_mechanisms = plain login digest-md5 cram-md5 ntlm namespace inbox { inbox = yes location = mailbox Drafts { auto = create special_use = \Drafts } mailbox Junk { auto = create special_use = \Junk } mailbox Sent { auto = create special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Spam { special_use = \Junk } mailbox Trash { auto = create special_use = \Trash } prefix = } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocols = imap pop3 service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } } ssl_cert = </etc/ssl/astarte.centershock.net.cert ssl_key = </etc/ssl/astarte.centershock.net.key userdb { driver = prefetch } userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql }
Let me repeat myself: Set a mail_location <http://dovecot.org/list/dovecot/2013-November/093607.html>
Regards, Pascal
The trapper recommends today: f007ba11.1333719@localdomain.org
participants (5)
-
Benny Pedersen
-
Charles Marcus
-
Florian Lindner
-
Pascal Volk
-
Timo Sirainen