Hi, I'm trying to convert users from a sendmail server to a postfix/dovecot server. All works fine but one of the last things is to rescue the messages in /var/mail/<user> on the old server. This seems very straitforward using the convert plugin but with the settings from the wiki, nothing happens when the user logs in. Do I need a private namespace for this as suggested elsewhere in the wiki? I experimented with mb2md.pl and that seems to do what we need but having the old mail converted upon login is much more attractive. In that way we hope that we can also find some 'dead' users. TIA Egbert Jan
Egbert wrote on 29.07.2010:> Hi, > I'm trying to convert users from a sendmail server to a postfix/dovecot > server. All works fine but one of the last things is to rescue the > messages in /var/mail/<user> on the old server. This seems very > straitforward using the convert plugin but with the settings from the > wiki, nothing happens when the user logs in. Do I need a private > namespace for this as suggested elsewhere in the wiki?No hint in the logfile? Maybe a permission problem or Dovecot can't find any emails? If nothing is logged maybe it helps when you set "mail_debug=yes" in dovecot.conf? Btw: it seems that in the upcoming Dovecot 2.0 version there's no convert plugin available anymore - with 2.0 you can use "dsync" to convert emails between different mailbox formats. -- Daniel
Op 30-7-2010 21:44, Timo Sirainen schreef:> Instead of using convert plugin, you could run mb2md.pl also as post-login script. Probably easier.. http://wiki.dovecot.org/PostLoginScriptingThanks for your advice, Timo. Much appreciated. Running a script sounds like a good solution. The script runs as root which might simplifiy things ;-) Are things like %d, %u, %n also available? I have to build the argument list for mb2md.pl in that script. Egbert Jan
On 31.7.2010, at 10.17, Egbert wrote:> Are things like %d, %u, %n also available? I have to build the argument list for mb2md.pl in that script.You have $USER environment that contains user at domain.
Op 30-7-2010 21:44, Timo Sirainen schreef:> Instead of using convert plugin, you could run mb2md.pl also as post-login script. Probably easier.. http://wiki.dovecot.org/PostLoginScriptingIndeed this seems to work. Thanks. One problem: The login is denied the first time (user/passw not correct). The /var/mail/<user> IS converted though. Cannot find any hint where to look in the logs... A second attempt logs the user in and the converted messages are displayed as unread. In dovecot.conf: protocol imap { #mail_executable = /usr/lib/dovecot/imap mail_executable = /home/egbert/script.sh The script in /home/egbert: #!/bin/sh # # no mbox in homedir, only in /var/mail /home/egbert/mb2md.pl -S -W -s /var/mail/egbert -d $PWD # # make copied messages ownd by vmail chown vmail:vmail $PWD/cur/* # # disable double conversion mv /var/mail/egbert /var/mail/egbert-converted # # continue to run imap exec /usr/lib/dovecot/imap "$@" $PWD = /home/vmail/vandenbussche.nl/egbert All is hardcoded for testing; I will use suhstrings of $USER to make this more general. Since the script runs as root, it is not very importand how /var/mail ownerships looks like. Egbert Jan