Symptoms
- Plesk Obsidian is used;
- After switching from Courier IMAP to Dovecot emails are duplicated into POP3 account.
Cause
Product issue:
- #PPPM-11776 “Read email messages fetched via the POP3 protocol are no longer marked as new after switching from Courier 5 to Dovecot.”
Fixed in:- Plesk Obsidian 14 April 2020 (Linux)
Resolution
Please consider updating your server:
Workaround
If update is not possible for some reason you may try the following
workaround
PLESK_ERROR: The workaround should be applied during maintenance time with no active connections via POP3. Otherwise, the messages will be downloaded.
Warning: Path to the maildir-migrate-dovecot
in the next steps apply to CentOS/RHEL-based servers. In case of Debian/Ubuntu, the path to the file is /usr/lib64/plesk-9.0/maildir-migrate-dovecot
. Make sure to edit the part accordingly in steps 2-5 (substituting /lib/ part with /lib64/)
-
Create a backup of
/var/qmail/mailnames/
directory:# mkdir /root/mailnames_backup
# cp -a /var/qmail/mailnames/* /root/mailnames_backup
-
After switching from Courier to Dovecot, the
maildir-migrate-dovecot
file will appear:# ls -lt /usr/lib/plesk-9.0/maildir-migrate-dovecot
-rwxr-x— 1 root root 33861 Mar 26 12:44 /usr/lib/plesk-9.0/maildir-migrate-dovecot -
Make a copy of this file:
# cp -p /usr/lib/plesk-9.0/maildir-migrate-dovecot /usr/lib/plesk-9.0/maildir-migrate-dovecot_orig
-
Open
/usr/lib/plesk-9.0/maildir-migrate-dovecot
file in text editor and edit it in the following way:# diff /usr/lib/plesk-9.0/maildir-migrate-dovecot /usr/lib/plesk-9.0/maildir-migrate-dovecot_orig
174c174
< if ( $pop3_hdr =~ /^/[23] (d+) (d+)$/ ) {
—
> if ( $pop3_hdr =~ /^/2 (d+) (d+)$/ ) {
197c197
< my ( $full_fname, $fsize, $uid, $uidv, $_is_utf8 );
—
> my ( $full_fname, $fsize, $uid, $uidv );
199,203c199
< if ( /^([^ ]+) (d+) (d+):(d+):(d+)$/ ) {
< # v3
< ( $full_fname, $fsize, $uid, $uidv, $_is_utf8 ) = ( $1, $2, $3, $4, $5 );
< }
< elsif ( /^([^ ]+) (d+) (d+):(d+)$/ ) {
—
> if ( /^([^ ]+) (d+) (d+):(d+)$/ ) { -
After this run the command below:
# /usr/lib/plesk-9.0/maildir-migrate-dovecot –convert –to-dovecot –recursive –overwrite /var/qmail/mailnames