Wednesday, January 30, 2013

replace uw-imapd with dovecot

Because of the problems with corrputed mailboxes or mails when accesing the debian mailserver with uw-imapd from the iPhone i decieded to switch to dovecot.

The installation was easy. After starting aptitude i chose dovecot-imapd and aptitude removed the old uw-imapd automatical.
For authentication the dovecot uses linux logins and passwords, so nothing must be changed.
The mails were stored from uw-imapd here:

/var/mail/%user%
/home/%user%/

So the mails were directly in the home directory.
I creat a subdirectory called "mail" and moved every directory and mbox file into it.
Now the mails were here:

/home/%user/mail/

Then i modified these two lines at /etc/dovecot/dovecot.conf:

mail_location = mbox:~/mail/:INBOX=/var/mail/%u
mail_full_filesystem_access = yes

After this the eMail Server works fine with dovecot.

Sunday, January 20, 2013

iPhone corrupts mbox file of uwimap

Using a debian mailserver (postfix and uwimap) with the iPhone
corrupt the mbox file of the user.
The first bytes of the file are overwritten and sometimes
deleted mails appears again.

The problem is the imap implementation of apple (iPhone, MacOS >=10.5) and a bug in the uwimapd. It searchs for the mlock in the wrong directory.

I try to fix the problem this way:
chmod -R 01777 /var/mail/
cp /usr/bin/mlock /usr/sbin/

The damaged file i open with a textedtior like joe
and fixed the overwritten mail header. After this i export
it with achmbox into a new file.
The old mbox i replace with the new file.

Please no comments to the security of the chmod !