[Dovecot] OT: Counting emails in IMAP folders
Greetings I have a customer who has mail server running dovecot with an IMAP account (Customers) which contains hundreds of folders (one per customer). Looks like this: Customers Fred Smith and Co Joe Blogss Cust-1 Cust-n They have a requirement to report monthly on the total number of emails added to each customers' folder during the month. Basically I need to be able to run some kind of command line query that will give me each of the sub-folder names and the number of emails added to the folder for that month (or other user-specified time period). Any ideas please? TIA Nigel.
Re: [Dovecot] OT: Counting emails in IMAP folders
Jose Celestino wrote: Words by Nigel Allen [Mon, Nov 17, 2008 at 12:51:32PM +1100]: Greetings I have a customer who has mail server running dovecot with an IMAP account (Customers) which contains hundreds of folders (one per customer). Looks like this: Customers Fred Smith and Co Joe Blogss Cust-1 Cust-n They have a requirement to report monthly on the total number of emails added to each customers' folder during the month. Basically I need to be able to run some kind of command line query that will give me each of the sub-folder names and the number of emails added to the folder for that month (or other user-specified time period). Any ideas please? Will do that over imap or on the filesystem? Are you using maildir, mbox, dbox? We can do it over imap or on the server (FC6). They are using maildir. Rgds Nigel.
[Dovecot] Fixed a Duplicate?
Greetings We have recently switched from mbox to Maildir so that we can implement symlinks for a large email account that is shared (partially) between some 20 or so users. The setup is dovecot-1.0.3-6.fc6, procmail-3.22-17.1, sendmail-8.13.8-2. Procmail has a single recipe in /etc/procmailrc that simply says DEFAULT=$HOME/Maildir/. The problem is that I am seeing a lot of blank emails being created. For exaample, every time I open a folder from this shared account, I get either one or two emails being created on the spot. The are /always/ created with the current date and time stamp (i.e. now) and at the same time a tail -f of maillog shows something like this: May 19 09:10:05 sydsrv56 dovecot: IMAP(plans): Fixed a duplicate: dovecot-shared:2, - 1211152205.P10039Q1.sydsrv56 The only thing that appears to change is the last modified date and time of the two files, dovecot.index.log and dovecot.index.cache. Should I be maintaining separate index files or lock files for each user in this shared account? Currently the Maildir is shared and has the g+s bit set. Any ideas where I can start looking would be appreciated. Rgds Nigel. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Re: [Dovecot] Fixed a Duplicate?
Timo Sirainen wrote: On Mon, 2008-05-19 at 09:20 +1000, Nigel Allen wrote: For exaample, every time I open a folder from this shared account, I get either one or two emails being created on the spot. The are /always/ created with the current date and time stamp (i.e. now) and at the same time a tail -f of maillog shows something like this: May 19 09:10:05 sydsrv56 dovecot: IMAP(plans): Fixed a duplicate: dovecot-shared:2, - 1211152205.P10039Q1.sydsrv56 dovecot-shared file should exist in Maildir/ directory, while mails should exist in Maildir/new/ and Maildir/cur/ directory. I don't see how dovecot-shared could be moved to cur/ or new/ directory.. Or are your new/ or cur/ directories some weird symlinks? Hi Timo The file dovecot-shared does exist in the Maildir directory ~/Maildir/. I read that this file also has to exist in each folder under Maildir so I created them (as the folders where created outside of dovecot. I suspect that I have gone a little too far though. Here is the results of a find command plans/Maildir/. 60503/dovecot-shared plans/Maildir/. 60503/tmp/dovecot-shared plans/Maildir/. 60503/new/dovecot-shared plans/Maildir/.Lost Plans. 4938/cur/dovecot-shared plans/Maildir/.Lost Plans. 4938/dovecot-shared plans/Maildir/.Lost Plans. 4938/tmp/dovecot-shared plans/Maildir/.Lost Plans. 4938/new/dovecot-shared plans/Maildir/. 7849/dovecot-shared plans/Maildir/. 7849/tmp/dovecot-shared plans/Maildir/.Junk/cur/dovecot-shared plans/Maildir/.Junk/dovecot-shared plans/Maildir/.Junk/tmp/dovecot-shared plans/Maildir/.Junk/new/dovecot-shared plans/Maildir/. 58532.2008/cur/dovecot-shared plans/Maildir/. 58532.2008/dovecot-shared plans/Maildir/. 10075/dovecot-shared plans/Maildir/. 10075/tmp/dovecot-shared plans/Maildir/. 4743/dovecot-shared plans/Maildir/. 4743/tmp/dovecot-shared plans/Maildir/. 19128/cur/dovecot-shared plans/Maildir/. 19128/dovecot-shared plans/Maildir/. 19128/tmp/dovecot-shared plans/Maildir/. 19128/new/dovecot-shared plans/Maildir/. 52474/cur/dovecot-shared plans/Maildir/. 52474/dovecot-shared plans/Maildir/. 52474/tmp/dovecot-shared plans/Maildir/. 52474/new/dovecot-shared plans/Maildir/. 4260/dovecot-shared plans/Maildir/. 4260/tmp/dovecot-shared Should I remove the dovecot-shared files from all the cur and tmp and new? -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
[Dovecot] IMAP, Shared folders, symlinks and permissions
Greetings Using FC7, dovecot-1.0.3-6.fc6 and maildir I have a recurring problem with permissions. We have a (real) account on the system called custs. Within the email account for custs there exists some 300 folders, one for each customer. This worked okay originally with mbox. Everyone had access to their own email folders and they all had access to the custs account. They only problem is that to find one folder (customers)'s emails, you had to scroll through 300+ folders. For the people who need access to all of the custs' folders, there was no problem (apart from a real estate one of scrolling which sometimes caused people to drag and drop into the wrong folders). The problem is that around 16 staff need only access to a subset of customers (i.e. the ones they manage - around 20 each) while the rest of the staff need access to the lot. What we did was to convert everything to Maildir so that we could use symlinks. So far so good. We created symlinks from /home/custs/Maildir/customer1 to /home/manager1/Maildir/customer1 and from /home/custs/Maildir/customer2 to /home/manager2/Maildir/customer2. Again, so far, so good. Manager 1 gets access to Customer 1 and Manager 2 gets access to Customer 2. The problem comes when someone who ONLY has access to the custs account drops an email into Customer 1. The file dovecot-uidlist gets created and suddenly Manager 1 cannot see the folder. We changed (in desperation) the group owner of custs/Maildir to common (which everyone is a member of) and did a chmod g+s from the custs/Maildir down. e even set the permissions of the custs/Maildir/* to 777 to watch what was happening. It appears that the permissions on the file dovecot-uidlist is set to 600 every time someone drops an email into the folder. Then when someone else tries to access the folder they get a permission denied error on dovecot-uidlist. Can anyone explain to me how to: Change the way dovecot creates the dovecot-uid files so that the permissions are set to 660 or 666 or Set this up better so that we can share all these folders. Any suggestions, questions, comments will be (very) gratefully accepted. Rgds Nigel. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
[Dovecot] Sharing Folders - or views?
Hi All Running Dovecot v1.0.3 on FC 6. We have a Dovecot account which contains folders used by all staff. Think of the account as Customers and the folders as Customer-1, Customer-2, Customer-3 and so on. We currently have around 650 of these customer folders. The problem is that there are currently 12 members of staff who need to see a subset of these folders (i.e. the customers that they are the manager for) but who also need to see (sometimes) the entire range of customer folders. Ideally what they would like to see is this kind of layout: +Personal Folders Inbox Trash Copies + My Customers Cust-1 Cust 7 Cust-25 Cust 33 + All Customers Cust-1 Cust-2 Cust-3 Cust-4 Cust-5 Cust-6 Cust-7 etc I suppose we could achieve this with symlinks but thought I would ask in case there is a clever way to achieve the same end. Thanks and Regards Nigel. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.