[Dovecot] Convert plugin
Hi, I'm trying to get old mail from /var/mail/<user>, where <user> is the (sometimes) huge mailfile, not a directory, converted to the maildir INBOX in ~/Maildir. Users have no ~/mail directory; they were supposed to use pop3 only.
I'm trying the example from the wiki:
plugin { convert_mail = mbox:~/mail:INBOX=/var/mail/%n }
but have still not succeded. I tried /var/mail/<user> where <user> is a file and /var/mail/<user>/<user> where user is first a diredtory en the second <user> a file. I also used the filename 'inbox', since the logging suggested that to me. Other logging seems to indicate that the right maildir++ info is composed.
I'm in vor any advise! TIA Egbert Jan (NL)
Here is dovecot -n:
# 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-25-server x86_64 Ubuntu 10.04.1 LTS log_path: /var/log/dovecot/error.log info_log_path: /var/log/dovecot/info.log log_timestamp: %Y-%m-%d %H:%M:%S protocols: imap pop3 imaps pop3s managesieve listen: *, [::] ssl_cert_file: /etc/ssl/certs/ssl-mail.pem ssl_key_file: /etc/ssl/private/ssl-mail.key ssl_cipher_list: ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM disable_plaintext_auth: no verbose_ssl: yes login_dir: /var/run/dovecot/login login_executable(default): /usr/lib/dovecot/imap-login login_executable(imap): /usr/lib/dovecot/imap-login login_executable(pop3): /usr/lib/dovecot/pop3-login login_executable(managesieve): /usr/lib/dovecot/managesieve-login mail_max_userip_connections(default): 10 mail_max_userip_connections(imap): 10 mail_max_userip_connections(pop3): 3 mail_max_userip_connections(managesieve): 10 first_valid_uid: 200 mail_privileged_group: mail mail_location: maildir:~/Maildir mail_debug: yes mbox_write_locks: fcntl dotlock mail_executable(default): /usr/lib/dovecot/imap mail_executable(imap): /usr/lib/dovecot/imap mail_executable(pop3): /usr/lib/dovecot/pop3 mail_executable(managesieve): /usr/lib/dovecot/managesieve mail_plugins(default): convert autocreate mail_plugins(imap): convert autocreate mail_plugins(pop3): mail_plugins(managesieve): mail_plugin_dir(default): /usr/lib/dovecot/modules/imap mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3 mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve imap_client_workarounds(default): outlook-idle delay-newmail imap_client_workarounds(imap): outlook-idle delay-newmail imap_client_workarounds(pop3): imap_client_workarounds(managesieve): pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh pop3_client_workarounds(managesieve): lda: postmaster_address: postmaster deliver_log_format: msgid=%m: %$ rejection_reason: Your message to <%t> was automatically rejected:%n%r auth_socket_path: /var/run/dovecot/auth-master auth default: mechanisms: plain login realms: kader.hcc.nl hobby.nl cache_size: 1024 verbose: yes debug: yes passdb: driver: pam args: failure_show_msg=yes cache_key=%u dovecot passdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: passwd args: mail=maildir:~/Maildir userdb: driver: sql args: /etc/dovecot/dovecot-sql.conf socket: type: listen client: path: /var/spool/postfix/private/dovecot-auth mode: 432 user: postfix group: postfix master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: vmail plugin: convert_mail: mbox:~/mail:INBOX=/var/mail/%n convert_skip_broken_mailboxes: yes autocreate: Trash autocreate2: Sent autocreate3: Drafts autocreate4: Spam autosubscribe: Trash autosubscribe2: Sent autosubscribe3: Drafts autosubscribe4: Spam
On Wed, 2010-10-06 at 22:01 +0200, Egbert Jan van den Bussche wrote:
I'm trying the example from the wiki:
plugin { convert_mail = mbox:~/mail:INBOX=/var/mail/%n }
but have still not succeded.
Did you figure it out already? The problem is that you have no ~/mail/ directory, convert plugin doesn't then do anything because it thinks the mails are already converted. Either you need to create those dirs, or maybe it's easier to just use one of the scripts and do all the users at once some weekend.
On 10/15/2010 1:10 PM, Timo Sirainen wrote:
I'm trying the example from the wiki:
plugin { convert_mail = mbox:~/mail:INBOX=/var/mail/%n }
but have still not succeded. Did you figure it out already? The problem is that you have no ~/mail/
On Wed, 2010-10-06 at 22:01 +0200, Egbert Jan van den Bussche wrote: directory, convert plugin doesn't then do anything because it thinks the mails are already converted. Either you need to create those dirs, or maybe it's easier to just use one of the scripts and do all the users at once some weekend.
Be sure your mail in /home/username is stored in mail and not Mail. Otherwise change the ~/mail to ~/Mail and it will work. This is what mine was. Also check the /var/mail/%n portion. Mine was stored in /var/spool/mail/%n.
Donny B.
Op 15-10-2010 20:15, Donny Brooks schreef:
On 10/15/2010 1:10 PM, Timo Sirainen wrote:
I'm trying the example from the wiki:
plugin { convert_mail = mbox:~/mail:INBOX=/var/mail/%n }
but have still not succeded. Did you figure it out already? The problem is that you have no ~/mail/
On Wed, 2010-10-06 at 22:01 +0200, Egbert Jan van den Bussche wrote: directory, convert plugin doesn't then do anything because it thinks the mails are already converted. Either you need to create those dirs, or maybe it's easier to just use one of the scripts and do all the users at once some weekend.
Be sure your mail in /home/username is stored in mail and not Mail. Otherwise change the ~/mail to ~/Mail and it will work. This is what mine was. Also check the /var/mail/%n portion. Mine was stored in /var/spool/mail/%n.
Donny B.
Thanks Timo and Donny.
Still not figured out how to make this happen in a reliable way. But I'm learning every day...
This probably means that I have to build a temporary /home/user/mail/ structure for about 500+ users to satisfy the convert plugin. Maybe a fake mailstore file with just one message in that directory. The bulk mail is then still the file in /var/mail/<username>. Alternatively I could just move the big file from /var/mail/ to ~/mail. (Probably with the name 'ínbox'?).
On the new system home dir expands to:
/var/vmail/<domain>/<user>
and the mail dir is:
/var/vmail/<domain>/
These remote users on the old mail system were supposed to use pop3 ONLY but some of them found out about imap... and we had the service running. So their mail just kept growing in the file /var/mail/username. Because they are not system users pur-sang they have no real /home/username/mail directory at all. All they could do was fetch their mail with pop3; no local store with fancy folder structure.
When convert runs, under which user is it? root? vmail (virt. users have all vmail:vmail) I suppose since it is after login (which is root by default IIRC) has run?
TNX Egbert Jan
Op 15-10-2010 20:15, Donny Brooks schreef:
On 10/15/2010 1:10 PM, Timo Sirainen wrote:
I'm trying the example from the wiki:
plugin { convert_mail = mbox:~/mail:INBOX=/var/mail/%n }
but have still not succeded. Did you figure it out already? The problem is that you have no ~/mail/
On Wed, 2010-10-06 at 22:01 +0200, Egbert Jan van den Bussche wrote: directory, convert plugin doesn't then do anything because it thinks the mails are already converted. Either you need to create those dirs, or maybe it's easier to just use one of the scripts and do all the users at once some weekend.
Be sure your mail in /home/username is stored in mail and not Mail. Otherwise change the ~/mail to ~/Mail and it will work. This is what mine was. Also check the /var/mail/%n portion. Mine was stored in /var/spool/mail/%n.
Donny B.
OK! I can confirm that the idea to move the big old mailbox files to ~/mail works fine. The emails are flagged as new but that is not a real problem (not of mine at least). I do see a new problem though... As long as the user has not logged in to the new mailserver, his home dir is not created yet (and mail dir neither) so I cannot place his old mailstore in that location.
I will do the test again with a dummy home dir like /var/dummy/%n/ with the old mail store in there called inbox. All owned by vmail:vmail. This is something I can write a script for to do the conversion from /var/mail/<user mailstore> on the ols server to /var/dummy/%n/inbox.
CU EJ
participants (3)
-
Donny Brooks
-
Egbert Jan van den Bussche
-
Timo Sirainen