Askja Mail Migration
Includes:
- Move of SMTP, POP3(S), IMAP(S), Webmail from bob to eve
- Migration from courier to dovecot
- New ManageSieve implementation (compatible with Exim): PySieved
Preparations
- Create virtualhost on eve with new name, but correct directory setup (mail2 vs. mail)
- Copy exim config
- Copy roundcube config
- Create and test dovecot config
- Setup regular sync of maildirs, use rsync
- Setup database connection towards bob
- Exim
- Exim domfiles script
- Dovecot
- Roundcube
- Create Pysieved plugin to implement custom storage based on Exim plugin
- Replace CRLF with LF so Exim does not fail with syntax error
- Facilitate .active link to be in filter directory
- Python exception on compiled regex with flags
- Make filter test work with dropped privileges (add -C /dev/null to exim command line).
- Setup proper pysieved auth and userdb using dovecot
- Implement trigger mechanism for admin tasks
- mitglied
- domain
- account create/delete
- Exim domain list update
- Run queue handler as own user
- Implement proper backup/sync of mail data from eve to other host
- Using rdiff-backup
- Backups are stored on alice in a new btrfs
- Setup proper packet filter on eve
- Brainstorm over additional items to be done during night work
- Setup daily statistics mailing on eve
Night work
- Stop Maildir sync from bob (/etc/cron.d/syncit)
- Remove mail.askja.de from /etc/apache2/httpd.conf on bob
- Stop Services on bob
- /etc/init.d/exim4 stop
- /etc/init.d/courier-imap stop
- /etc/init.d/courier-imap-ssl stop
- /etc/init.d/courier-pop stop
- /etc/init.d/courier-pop-ssl stop
- /etc/init.d/sieved stop
- /etc/init.d/apache2 reload
- Stop Services on eve
- /etc/init.d/exim4 stop
- /etc/init.d/dovecot stop
- Initiate final maildir sync manually
- Remove IP addresses on bob
- ip a d 83.137.103.136 dev eth0
- ip -6 a d 2001:6f8:122b:200::2 dev lo
- IPv4 from /etc/network/interfaces eth0
- IPv6 from /etc/network/ipv6.addresses
- Add IP addresses on eve
- ip a a 83.137.103.136/26 dev eth0
- ip -6 a a 2001:6f8:122b:200::2 dev lo
- IPv4 to /etc/network/interfaces eth0
- IPv6 to /etc/network/interfaces lo
- Add routing for IPv6 on alice and bob
- ip -6 r a 2001:6f8:122b:200::2 via 2001:6f8:122b:255::4
- Edit exim config on eve (change to values on bob)
- primary_hostname
- local_interfaces
- OUTGOING_INTERFACES
- Modify /usr/local/bin/exim_createdomfiles on eve to create correct DBs
- Create domfiles based on database
- Copy SSL cert/keys for exim
- Edit dovecot config: listen
- Edit /data/system/mail.askja.de/[ws][ws][wl]/apache*.conf to match IP addresses, host names
- Wait for Maildir sync to end
- Migrate courier meta data to dovecot format
- for d in /data/*/*.*/mail/*; do /root/courier-dovecot-migrate.pl --convert --recursive --to-dovecot $d; done
- (re)start services on eve
- /etc/init.d/exim4 start
- /etc/init.d/dovecot start
- /etc/init.d/apache2 restart
- Edit Exim config on bob
- Update addresses to bob's own addresses
- Remove localdomains
- Disable domain file creation on bob
- Update packet filter rules on bob
- Allow Port 25 on bob's IP address
- Disallow any other mail related access from outside on bob
- Restart services on bob (with changed config)
- Re-enable admin.askja.de in Apache
Post-Migration / Clean-up
- Remove courier state files from Maildirs on eve
- Disable daily statistics mailing on bob
- Move roundcube database?
- Move mail.askja.de to new IPv6 address and update routing
- Add IP to listen addresses in exim and dovecot
- Add new IP to DNS
- Change reverse DNS to new name (after TTL)
- Use new address in outgoing interfaces (after TTL)
- Remove old IP from DNS
- Remove old IP from exim and dovecot configuration (after TTL)
- Remove redundant routing from bob and alice
- Remove maildirs on bob
- Remove Courier stuff on bob
- Migrate database and admin interface to eve
- Implement database replication
- Migrate database to LDAP
- Move other backups on alice into the btrfs