converting sppol and config dirs from 2.1.x to 2.2.x (WAS: cyrus 2.2.3 & virtual)

Edward Rudd eddie at omegaware.com
Tue Mar 23 14:24:33 EST 2004


First shutdown cyrus-imapd.

The current directory structure for user jon_doecom is like this (with
hashimapspool: off)

seendb: /var/lib/imap/user/j/jon_doecom.seen
subdb: /var/lib/imap/user/j/jon_doecom.sub
spool: /var/spool/imap/user/jon_doecom/
quota: /var/lib/imap/quota/j/user.jon_doecom
sieve: /var/lib/imap/sieve/j/jon_doecom/

For the virtual domain support to find everything.. The directory
structures need to be like this.. (mapping jon_doecom -> jon at doe.com)

seendb: /var/lib/imap/domain/d/doe.com/user/j/jon.seen
subdb: /var/lib/imap/domain/d/doe.com/user/j/jon.sub
spool: /var/spool/imap/domain/doe.com/user/jon/
quota: /var/lib/imap/domain/d/doe.com/quota/j/user.jon
sieve: /var/lib/imap/sieve/domain/d/doe.com/j/jon/

Now a few files need to have their data updated as well.
the mailboxes.db needs to be dumped by using the ctl_mboxlist 9which
needs to be run as the cyrus user).. Now i'm assuming Simon Matter's RPM
here.. you may have to find the ctl_mboxlist program on  your system..

su - cyrus
/usr/lib/cyrus-imapd/ctl_mboxlist -d > mailboxes.txt

Then you need to edit the mailboxes.txt file so that it goes from this

user.jon_doecom	default	jon_doecom	lrswipcda	
user.jon_doecom.somefolder	default	jon_doecom	lrswipcda	

To this

doe.com!user.jon	default	jon at doe.com	lrswipcda	
doe.com!user.jon.somefolder	default	jon at doe.com	lrswipcda	

Note that there are tabs between everything not spaces. and a trailing
tab at the end of the line, and an exlamation mark between the domain
and the user.

Next you will have to update the jon_doecom.sub file (renaming to
jon.sub in the new directory) so that it goes from this

user.jon_doecom
user.jon_doecom.somefolder

To this

doe.com!user.jon
doe.com!user.jon.somefolder

Once all that is done for all the users.. set the virtdomains: userid in
imapd.conf and start up cyrus-imapd.

You will probably have to fix up your SQL database so that the full
username (user at dom.tld) is stored in the username field.. OR split it up
into username and domain.. then you'll have to change your query to use
%p for the part before the @ and %r for the part after the @.. Make sure
you are using the 2.1.17 release of cyrus-sasl as well.

If you follow all of the instructions above,every should go smoothly,
with a few exceptions.. domains that begin with a number do not end up
in a numbered hash directory.. ie..
3somesite.tld does not go in a 3/3somesite.tld.. it actually goes into
the q directory q/3somesite.tld.. I haven't investigated that much
further to figure out where all of the numbers go..

If you adept at perl programming you may download my partially started
conversion script here
http://svn.outoforder.cc/svn/mailserver/trunk/cyrus-spool.pl
Note it currently doesn't actually make any changes.. it only shows what
would be done. It still has a bit of work to do before it's finished.

On Tue, 2004-03-23 at 01:36, Paul Dorneanu wrote:
> Hello Edward,
> 
> finally someone answered to my problem.
> 
> Here's what I have:
> configdirectory: /var/lib/imap
> partition-default: /var/spool/imap
> sievedir: /var/lib/imap/sieve
> sendmail: /usr/sbin/sendmail
> lmtpsocket: /var/spool/postfix/lmtp
> 
> admins: cyrus
> allowanonymouslogin: no
> sieveuserhomedir: no
> hashimapspool: no
> allowplaintext: yes
> servername: ns1.holman.net
> 
> sasl_pwcheck_method: auxprop
> sasl_sql_engine: mysql
> sasl_sql_hostnames: 127.0.0.1
> sasl_sql_user: user
> sasl_sql_passwd:  ***
> sasl_sql_database: mail_db
> sasl_sql_select: select password from users where username='%u'
> sasl_sql_verbose: yes
> sasl_verbose: yes
> sasl_mysql_verbose: yes
> sasl_mech_list: PLAIN
> 
> tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem
> tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem
> tls_ca_file: /usr/share/ssl/certs/ca-bundle.crt
> 
> deleteright: c
> poptimeout: 3
> verbose: yes
> 
> ---------------------------
> I use something like user_domaintld and I want to be able to have 
> user at domain.tld
> 
> An update script will be great. Although, I did not found what there is 
> to convert.
> 
> Thanks for the help.
> 
> 
> Edward Rudd wrote:
> 
> >Oh yeah. this is a fun problem to solve..
> >I went through this on my systems a few weeks ago..
> >you need to move all your mailboxes around, quota files, subscription
> >files, and sieve scripts, update the mailboxes.db, and update each users
> >.sub (subscription) file. And of course this all depends on how you have
> >your mailboxes currently setup.
> >  
> >
> 
-- 
Edward Rudd <eddie at omegaware.com>
Website http://outoforder.cc/

---
Home Page: http://asg.web.cmu.edu/cyrus
Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list