update_config_0.3.x-0.4.py
changeset 24 48ea255e8a85
parent 20 55146c78b3fb
--- a/update_config_0.3.x-0.4.py	Sat Apr 26 02:49:34 2008 +0000
+++ b/update_config_0.3.x-0.4.py	Mon Apr 28 21:33:28 2008 +0000
@@ -11,7 +11,8 @@
 cf.readfp(cff)
 cff.close()
 
-if not cf.has_option('misc', 'transport') or not cf.has_section('services'):
+if not cf.has_option('misc', 'transport') or not cf.has_section('services') \
+or cf.has_option('maildir', 'base'):
     cff = file('/usr/local/etc/vmm.cfg', 'w')
     if not cf.has_option('misc', 'transport'):
         cf.set('misc', 'transport', 'dovecot:')
@@ -19,5 +20,9 @@
         cf.add_section('services')
         for service in ['smtp', 'pop3', 'imap', 'managesieve']:
             cf.set('services', service, 'true')
+    if cf.has_option('maildir', 'base'):
+        domdir = cf.get('maildir', 'base')
+        cf.remove_option('maildir', 'base')
+        cf.set('domdir', 'base', domdir)
     cf.write(cff)
     cff.close()