Dovecot: Problem receiving double and triple emails

jim.thornton

Verified User
Joined
Jan 1, 2008
Messages
334
I little while ago my VPS provider converted my DA installation to use Dovecot.

Recently, I had WHMCS install their software for me.

I don't think this problem is being caused by either program however I keep receiving multiple emails now. It is serverwide, not domain specific.

The only other thing that is weird is that I have recently had some file ownership's go wacky. All (or a Lot) of the files within the /usr/local/directadmin directory (and below it) where somehow changed to the owner of sshd. I don't know how this was changed as I don't think it was me that did it.

As a remedy, I ran the following commands:

# cd /usr/local/directadmin
# chown diradmin $(find ./ -user sshd)

This seemed to fix the login problems that I was having at the time. As a precaution, Chatwzrd suggest I run:

# /usr/local/directadmin/scripts/set_permissions.sh all

and I saw it going through all of the mail folders. Maybe it changed something so that Dovecot can not delete the emails off of the server when we check our emails via POP3.

Any help resolving this is appreciated.
 
Hello,

The double emails can be attributed to running the dovecot convertor multiple times without deleting the original emails first.
Make sure that you run the delete command after the conversion is done:
http://help.directadmin.com/item.php?id=143 (very last command) so that you don't get duplicates if you run it again.

I'm not too sure about the files being owned by sshd.. possibly if the update.tar.gz was extracted with the same UID.. and the permissions were not reset, that would explain it.

The set_permissions.sh does go through everything, but doesn't copy any files around, so it's likely not the cause of the duplciate emails (see above).

John
 
Thank you... I have not run the converter multiple times though (at least I don't think I have).

The system was converted to dovecot on May 31st. It has been running flawlessly up until about 2 or 3 days ago. The duplicates almost seem like Thunderbird/Outlook is not flagging the emails as Read after they are downloaded. One of the accounts I have configured to save emails for 7 days before deleting them, but the others are set to delete the messages after they are downloaded.

Is there anything else that might cause duplicate emails, or is the dovecot converter run by cron job or something?
 
In Dovecot, generally not; with mbox it's possible to get duplicate emails if the mailbox is very large.

It's possible (though unlikely) that the index files used by Dovecot are damaged (but usually when they are Dovecot won't work at all); you can delete ALL of them and they'll be recreated (at some expense of time) the next time someone logs into the account.

Jeff
 
Would this solution delete all of the emails in the account too? If not, can you please give me directions on how to do this?
 
No, it just deletes the indexes.
Code:
$ su -
# cd /home/USERNAME/imap/DOMAIN/mailboxname/Maildir
# rm -f dovecot*
# exit
$ exit
Remember that I do not guarantee anything unless I do it myself; I've looked over my post and it appears I haven't made a mistake, but if you or I make a mistake you could delete your entire mailbox for this user. Specifically do NOT put a space before the * character or you WILL delete the contents of the mailbox.

Jeff
 
There is no Maildir in that path for any of the domains. In the .../DOMAIN/mailboxname there is only one directory that is called 'mail'.

All of the mailbox names are the same for all the domains... 'only mail'

The only place I saw the directory 'Maildir' was in /home/USERNAME
 
Specifically do NOT put a space before the * character or you WILL delete the contents of the mailbox.

No, it won't delete them :) cur, new and tmp are folders, not files, so you should use -rf if you want to delete them too.
 
Martynas,

okay, so I was being cautious :).

zincoxide,

A DirectAdmin Dovecot/Maildir installation should have the layout I mentioned if you have any email users at all; the location you mentioned is only for the site user mailbox.

Do you have email users? Or only email for the site user mailbox?

Jeff
 
I not sure. I was having problems with my email server and my provider installed Dovecot for me because I was working on 2 or 3 days without emails. I couldn't get the answer to the problem and I needed the emails up and running as fast as possible.

Is there a way that I can go in and check the settings that you just asked me?
 
I'm sorry, I don't know where to check this.

I logged in as a user (into their panel) and there was nothing there that said mailboxes. The only thing I saw was "mail accounts".

What am I doing wrong?
 
You can login as user to the control panel and you'll see something like this:

E-mail management
- E-mail accounts

Click on it

You'll see an overview with Account, Login, ....

I think you'll need a Login like:
[email protected]
not just the name (without @domain.com....)

HTH,
Fossie
 
I know where to find the mailboxes under Email accounts. For some reason though my directory setup is not the same as given above.

However... The problem seems to have corrected itself. Weird.

I think that it might be caused my roundcube. Maybe I'll try AtMail.
 
Back
Top