[Dovecot] UIDL conversion courier -> dovecot

Will Yardley dovecot.org at veggiechinese.net
Fri Oct 25 04:00:10 EEST 2013


I've got a weird split setup where POP3 is currently handled by Courier
(courier-imap-3.0.2 distribution), and IMAP is currently handled by the
RHEL 5 version of Dovecot (1.0.7)

I'm trying to figure out a way to convert the POP3 UIDLs (in cases where
the courierpop3dsizelist is newer than dovecot-uidlist, at least) to
something that Dovecot will read, or to configure Dovecot's pop3 to use
a UIDL format that will work, as mentioned in the migration wiki. We
have some "squeaky wheel" users who don't have their POP clients set to
delete messages, and are likely to complain about re-downloading their
several GB of mail.

Thus far, the migration scripts haven't seemed to work properly, maybe
because of the versions I'm using. I'm not sure whether the Courier
versions there refer to Courier MTA version or Courier IMAP version, but
adjusting the UIDL format to %v-%u (as suggested for early Courier 3 /
Dovecot 1.0) hasn't worked (I saw %u-%v online, but that also didn't
work). Since the Courier system doesn't seem to report validity, I also
tried just '%u' - this works *if* I delete the header line as well as
rename the courierpop3dsizelist to dovecot-uidlist, but I still don't
get the exact same UIDLs as before.

I'm willing to write my own migration tool, or to adapt the existing
one, but I could use some assistance knowing how to do the translation.

Dovecot -n for that instance is below, slightly sanitized, obviously I
can change pop3_uidl_format; I also tried getting rid of
pop3_reuse_xuidl:

Basically, to give a concreate example, the Courier system seems to use
the filename as the UIDL, with this courierpop3dsizelist:
/2 45 1382654636
1199751891.13891_0.water-ox:2,Sa 2412 0:1382654636
1199927364.22870_0.fire-ox:2,S 2440 0:1382654636
1199936486.3332_0.wood-ox:2,Sa 2074 0:1382654636
1199985712.27745_0.water-ox:2,RS 4007 0:1382654636
1199993867.23139_0.fire-ox:2,S 1550 0:1382654636

producing this UIDL output:
UIDL
+OK
1 1199751891.13891_0.water-ox
2 1199927364.22870_0.fire-ox
3 1199936486.3332_0.wood-ox
4 1199985712.27745_0.water-ox
5 1199993867.23139_0.fire-ox
[...]

Dovecot's dovecot-uidlist:
3 V1199747645 N606
562 W2412 :1199751891.13891_0.water-ox:2,Sa
563 W2440 :1199927364.22870_0.fire-ox:2,S
564 W2074 :1199936486.3332_0.wood-ox:2,Sa
565 W4007 :1199985712.27745_0.water-ox:2,RS
566 W1550 :1199993867.23139_0.fire-ox:2,S

producing:
UIDL
+OK
1 1199747645-562
2 1199747645-563
3 1199747645-564
4 1199747645-565
5 1199747645-566

(or, if I change the format to just %u):
+OK
1 650
2 651
3 652
4 653
5 654

# dovecot --version
1.0.7

# 1.0.7: /etc/dovecot.d/XXX.cfg
base_dir: /var/run/dovecot/pop-its
syslog_facility: local4
protocols: pop3 pop3s
listen: *:110
ssl_listen: *:995
ssl_ca_file: /etc/pki/dovecot/certs/XX.pem
ssl_cert_file: /etc/pki/dovecot/certs/XXXX.pem
ssl_key_file: /etc/pki/dovecot/private/XXXX.key
disable_plaintext_auth: yes
login_dir: /var/run/dovecot/pop-its/login
login_executable: /usr/libexec/dovecot/pop3-login
login_greeting_capability: yes
login_processes_count: 4
login_max_processes_count: 512
verbose_proctitle: yes
mail_location:
maildir:/var/spool/maildir/%1Ln/%Ln:INDEX=/var/spool/dovecot/indexes/%1Ln/%Ln
mail_debug: yes
mmap_disable: yes
maildir_copy_with_hardlinks: yes
mail_executable: /usr/libexec/dovecot/pop3
mail_plugin_dir: /usr/lib/dovecot/pop3
pop3_reuse_xuidl: yes
pop3_uidl_format: %v-%u
pop3_client_workarounds: outlook-no-nuls oe-ns-eoh
namespace:
  type: private
  separator: .
  prefix: Mail.
  inbox: yes
auth default:
  mechanisms: plain login
  passdb:
    driver: ldap
    args: /etc/dovecot.conf-ldap
  userdb:
    driver: static
    args: uid=vmail gid=mail home=/var/spool/maildir/%1Ln/%Ln
  socket:
    type: listen
    master:
      path: /var/run/dovecot/pop-its/auth-master
      mode: 384
      user: vmail
      group: mail


TIA!

/wby



More information about the dovecot mailing list