[Dovecot] Courier to dovecot migrations
Dear All,
I saw some topics discussed in forums about this, but none with my problems :(
Currently we have a mailserver postfix with courier-imap-4.1.1, and courier-pop3 and courier-authlib.
Our Maildir's are written in the users home directory (ex: ~/Maildir)
I'm now migrating the mailserver to other cluster and installing with dovecot. We're also moving the Maildir's to other directory (ex: /opt/mailboxes/%u)
I've ran your perl script courier-dovecot-migrate-1.0.pl which worked just great (as far as I can tell from the OK messages) .. but when configuring my mail client for this account I get the following:
Mar 16 09:49:27 magenta dovecot: auth(default): master out: USER 69 scanner system_user=scanner uid=734 gid=100 home=/home/scanner
Mar 16 09:49:27 magenta dovecot: imap-login: Login: user=<scanner>, method=PLAIN, rip=::ffff:192.168.1.210, lip=::ffff:192.168.1.110
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): Effective uid=734, gid=100, home=/home/scanner
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): maildir: data=/opt/mailboxes/scanner
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): maildir: root=/opt/mailboxes/scanner, index=/opt/mailboxes/scanner, control=, inbox=
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): stat(/opt/mailboxes/scanner/cur) failed: Permission denied
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): stat(/opt/mailboxes/scanner/cur) failed: Permission denied
[root@magenta ~]# ls -la /opt/mailboxes/
total 36
drwxrwx--- 4 root dovecot 4096 Mar 15 11:49 .
drwxr-xr-x 6 root dovecot 4096 Mar 9 2009 ..
drwxrwx--- 2 root root 16384 Feb 10 15:55 lost+found
drwx------ 9 scanner users 4096 Mar 15 11:56 scanner
The second problem is between postfix / dovecot.. When I send an email to this user I get the following:
Mar 16 09:52:11 magenta postfix/local[19065]: warning: connect #1 to subsystem private/dovecot: Connection refused
Mar 16 09:52:12 magenta postfix/local[19064]: warning: connect #5 to subsystem private/dovecot: Connection refused
I've the following on my /etc/postfix/main.cf
## deliver with dovecot
dovecot_destination_recipient_limit = 1
mailbox_transport = dovecot
smtpd_sasl_auth_enable = yes
smtpd_client_restrictions = permit_sasl_authenticated
I hope you can give me a hand on this :) If you need further information, please let me know (perhaps I forgot something)
Best Regards Daniel
--
Daniel Grilo
Partner of Grupo PDM
Av. Conde Valbom 30, 3o
1050-068 Lisboa (Portugal)
web: http://www.pdmfc.com
Tel: +351 21 357 20 29 // mobile: +351 91 388 94 39 (ext: 716)
Fax: +351 21 357 20 31
Your mode of life will be changed for the better because of good news soon.
Well, I've been all day yesterday solving this .. and of course a simple [root@magenta ~]# chmod a+rx /opt/mailboxes/
allows me to see the mails from scanner user.
The only problem now is when sending mails to that user I still get a warning: connect #3 to subsystem private/dovecot: Connection refused
I don't think I can set postfix to deliver directly to maildir instead of passing through dovecot ? I don't know if the home_mailbox directive allows us to use vars like %u ? or can you see anything wrong in my confs !?
--
Daniel Grilo
Partner of Grupo PDM
Av. Conde Valbom 30, 3o
1050-068 Lisboa (Portugal)
web: http://www.pdmfc.com
Tel: +351 21 357 20 29 // mobile: +351 91 388 94 39 (ext: 716)
Fax: +351 21 357 20 31
FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #13 A: Doc, Happy, Bashful, Dopey, Sneezy, Sleepy, & Grumpy Q: Who were the Democratic presidential candidates?
Daniel Grilo wrote:
Dear All,
I saw some topics discussed in forums about this, but none with my problems :(
Currently we have a mailserver postfix with courier-imap-4.1.1, and courier-pop3 and courier-authlib.
Our Maildir's are written in the users home directory (ex: ~/Maildir)
I'm now migrating the mailserver to other cluster and installing with dovecot. We're also moving the Maildir's to other directory (ex: /opt/mailboxes/%u)
I've ran your perl script courier-dovecot-migrate-1.0.pl which worked just great (as far as I can tell from the OK messages) .. but when configuring my mail client for this account I get the following:
Mar 16 09:49:27 magenta dovecot: auth(default): master out: USER 69 scanner system_user=scanner uid=734 gid=100 home=/home/scanner
Mar 16 09:49:27 magenta dovecot: imap-login: Login: user=<scanner>, method=PLAIN, rip=::ffff:192.168.1.210, lip=::ffff:192.168.1.110
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): Effective uid=734, gid=100, home=/home/scanner
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): maildir: data=/opt/mailboxes/scanner
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): maildir: root=/opt/mailboxes/scanner, index=/opt/mailboxes/scanner, control=, inbox=
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): stat(/opt/mailboxes/scanner/cur) failed: Permission denied
Mar 16 09:49:27 magenta dovecot: IMAP(scanner): stat(/opt/mailboxes/scanner/cur) failed: Permission denied
[root@magenta ~]# ls -la /opt/mailboxes/
total 36
drwxrwx--- 4 root dovecot 4096 Mar 15 11:49 .
drwxr-xr-x 6 root dovecot 4096 Mar 9 2009 ..
drwxrwx--- 2 root root 16384 Feb 10 15:55 lost+found
drwx------ 9 scanner users 4096 Mar 15 11:56 scanner
The second problem is between postfix / dovecot.. When I send an email to this user I get the following:
Mar 16 09:52:11 magenta postfix/local[19065]: warning: connect #1 to subsystem private/dovecot: Connection refused
Mar 16 09:52:12 magenta postfix/local[19064]: warning: connect #5 to subsystem private/dovecot: Connection refused
I've the following on my /etc/postfix/main.cf
## deliver with dovecot
dovecot_destination_recipient_limit = 1
mailbox_transport = dovecot
smtpd_sasl_auth_enable = yes
smtpd_client_restrictions = permit_sasl_authenticated
I hope you can give me a hand on this :) If you need further information, please let me know (perhaps I forgot something)
Best Regards Daniel
Daniel Grilo put forth on 3/16/2010 5:08 AM:
Well, I've been all day yesterday solving this .. and of course a simple [root@magenta ~]# chmod a+rx /opt/mailboxes/
allows me to see the mails from scanner user.
The only problem now is when sending mails to that user I still get a warning: connect #3 to subsystem private/dovecot: Connection refused
I don't think I can set postfix to deliver directly to maildir instead of passing through dovecot ? I don't know if the home_mailbox directive allows us to use vars like %u ? or can you see anything wrong in my confs !?
What version of Postfix?
Do you have the following in main.cf? Postfix must know where to find the Dovecot delivery agent. In your main.cf snippet you tell Postfix to deliver to Dovecot but you don't tell how. You need the how:
mailbox_command = /usr/local/libexec/dovecot/deliver # or mailbox_command = /usr/libexec/dovecot/deliver # or mailbox_command = /usr/lib/dovecot/deliver # or wherever it was installed in your system.
Get dovecot LDA working. There's no reason you can't. But, to answer your other question, yes, you can have Postfix drop mail directly into maildirs. Both questions are answered here. Hit the web page, as all the parameters are hot linked to more thorough usage information.
http://www.postfix.org/local.8.html
MAILBOX DELIVERY The default per-user mailbox is a file in the UNIX mail spool directory (/var/mail/user or /var/spool/mail/user); the location can be specified with the mail_spool_direc- tory configuration parameter. Specify a name ending in / for qmail-compatible maildir delivery.
Alternatively, the per-user mailbox can be a file in the
user's home directory with a name specified via the
home_mailbox configuration parameter. Specify a relative
path name. Specify a name ending in / for qmail-compatible
maildir delivery.
Mailbox delivery can be delegated to an external command
specified with the mailbox_command_maps and mailbox_com-
mand configuration parameters. The command executes with
the privileges of the recipient user (exceptions: sec-
ondary groups are not enabled; in case of delivery as
root, the command executes with the privileges of
default_privs).
Mailbox delivery can be delegated to alternative message
transports specified in the master.cf file. The mail-
box_transport_maps and mailbox_transport configuration
parameters specify an optional message transport that is
to be used for all local recipients, regardless of whether
they are found in the UNIX passwd database. The fall-
back_transport_maps and fallback_transport parameters
specify an optional message transport for recipients that
are not found in the aliases(5) or UNIX passwd database.
In the case of UNIX-style mailbox delivery, the local(8)
daemon prepends a "From sender time_stamp" envelope header
to each message, prepends an X-Original-To: header with
the recipient address as given to Postfix, prepends an
optional Delivered-To: header with the final envelope
recipient address, prepends a Return-Path: header with the
envelope sender address, prepends a > character to lines
beginning with "From ", and appends an empty line. The
mailbox is locked for exclusive access while delivery is
in progress. In case of problems, an attempt is made to
truncate the mailbox to its original length.
In the case of maildir delivery, the local daemon prepends
an optional Delivered-To: header with the final envelope
recipient address, prepends an X-Original-To: header with
the recipient address as given to Postfix, and prepends a
Return-Path: header with the envelope sender address.
-- Stan
On Tue, Mar 16, 2010 at 10:08:16AM +0000, Daniel Grilo wrote:
Well, I've been all day yesterday solving this .. and of course a simple [root@magenta ~]# chmod a+rx /opt/mailboxes/
allows me to see the mails from scanner user.
The only problem now is when sending mails to that user I still get a warning: connect #3 to subsystem private/dovecot: Connection refused
I don't think I can set postfix to deliver directly to maildir instead
of passing through dovecot ? I don't know if the home_mailbox directive allows us to use vars like %u
? or can you see anything wrong in my confs !?
Hi,
to diagnose, can you provide full output of 'dovecot -n' plus the dovecot LDA excerpexcerptom Postfix's 'master.cf'?
Regards Thomas
Many thanks for you fast replies.
I believe I was sleeping yesterday :)
the mailbox_command to dovecot/deliver worked like charm.
By the way, do you know if there is a way to migrate the password db from authlib in dovecot in someway? Because we had different password for users in ssh and IMAP Either that or I will have to make dovecot pam to use some database and reset all users passwords :-)
Tks again, Daniel
--
Daniel Grilo
Partner of Grupo PDM
Av. Conde Valbom 30, 3o
1050-068 Lisboa (Portugal)
web: http://www.pdmfc.com
Tel: +351 21 357 20 29 // mobile: +351 91 388 94 39 (ext: 716)
Fax: +351 21 357 20 31
Tomorrow, you can be anywhere.
Thomas Leuxner wrote:
On Tue, Mar 16, 2010 at 11:41:47AM +0100, Thomas Leuxner wrote:
Hi,
to diagnose, can you provide full output of 'dovecot -n' plus the dovecot LDA excerpexcerptom Postfix's 'master.cf'?
Regards Thomas
... ouch... Of course this should read: excerpt from 'master.cf' :)
participants (3)
-
Daniel Grilo
-
Stan Hoeppner
-
Thomas Leuxner