[Dovecot] dsync backup; compressed to uncompressed
I need to backup some of the mailboxes on our system. We are currently using mdbox with zlib compression plugin.
The backups need to be maildir without compression. How can I accomplish this using dsync?
The following just causes each msg file in maildir to be compressed as well. dsync -f -u user1 backup maildir:/var/tmp/user1
While this just causes the dsync to fail while spewing a bunch of errors because it can no longer read the compressed mdbox files. dsync -f -u user1 -o mail_plugins= backup maildir:/var/tmp/user1
# doveconf -n # 2.2.4: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-279.19.1.el6.x86_64 x86_64 CentOS release 6.3 (Final) auth_debug = yes auth_debug_passwords = yes auth_default_realm = domain1.net auth_master_user_separator = * auth_mechanisms = plain login auth_verbose = yes auth_verbose_passwords = plain debug_log_path = /var/log/dovecot-debug.log disable_plaintext_auth = no dotlock_use_excl = no lda_mailbox_autocreate = yes lock_method = dotlock mail_access_groups = mail mail_debug = yes mail_fsync = always mail_location = mdbox:~/mail:INDEX=~/index mail_plugins = quota zlib mail_privileged_group = mail managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date mbox_read_locks = dotlock mbox_write_locks = dotlock mdbox_rotate_interval = 1 weeks mdbox_rotate_size = 20 M mmap_disable = yes namespace { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { auto = subscribe special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } prefix = separator = / type = private } passdb { args = /etc/dovecot/dovecot-sql-master.conf.ext driver = sql master = yes pass = yes } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } plugin { autosubscribe = Trash autosubscribe2 = Junk autosubscribe3 = Drafts autosubscribe4 = Sent autosubscribe5 = INBOX mail_max_userip_connections = 10 managesieve_max_line_length = 65536 quota = dict:User quota::file:%h/dovecot.quota quota2_rule = Trash:storage=+10%% quota3_rule = Junk:storage=+20%% quota_rule = *:storage=100M:messages=100000 recipient_delimiter = + sieve_before = /var/opt/mail/global.sieve/ zlib_save = gz zlib_save_level = 9 } pop3_reuse_xuidl = yes protocols = imap pop3 sieve lmtp service auth { inet_listener auth { port = 113 } unix_listener auth-userdb { user = nobody } } service lmtp { inet_listener lmtp { port = 24 } process_min_avail = 10 service_count = 1 } service managesieve-login { inet_listener sieve { port = 4190 } process_min_avail = 0 service_count = 1 vsz_limit = 64 M } ssl = no ssl_cert = </etc/pki/dovecot/certs/dovecot.pem ssl_key = </etc/pki/dovecot/private/dovecot.pem userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lda { mail_plugins = quota zlib sieve } protocol imap { mail_plugins = quota zlib imap_quota } protocol sieve { mail_max_userip_connections = 10 mail_plugins = quota zlib managesieve_max_line_length = 65536 managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date } protocol lmtp { mail_plugins = quota zlib sieve }
Ok, I think I found an answer. I don't know if it's the right one...
I duplicated my dovecot.conf to backup.conf. I then removed this part from plugin {} zlib_save = gz zlib_save_level = 9
I then add "-c backup.conf" to my dsync command. This appears to allow dsync to read the compressed mdbox accounts, but when it writes the backup in maildir format, everything is uncompressed.
-----Original Message----- From: dovecot-bounces@dovecot.org [mailto:dovecot-bounces@dovecot.org] On Behalf Of Michael Smith (DF) Sent: Wednesday, January 29, 2014 12:04 PM To: 'dovecot@dovecot.org' Subject: [Dovecot] dsync backup; compressed to uncompressed
I need to backup some of the mailboxes on our system. We are currently using mdbox with zlib compression plugin.
The backups need to be maildir without compression. How can I accomplish this using dsync?
The following just causes each msg file in maildir to be compressed as well. dsync -f -u user1 backup maildir:/var/tmp/user1
While this just causes the dsync to fail while spewing a bunch of errors because it can no longer read the compressed mdbox files. dsync -f -u user1 -o mail_plugins= backup maildir:/var/tmp/user1
# doveconf -n # 2.2.4: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-279.19.1.el6.x86_64 x86_64 CentOS release 6.3 (Final) auth_debug = yes auth_debug_passwords = yes auth_default_realm = domain1.net auth_master_user_separator = * auth_mechanisms = plain login auth_verbose = yes auth_verbose_passwords = plain debug_log_path = /var/log/dovecot-debug.log disable_plaintext_auth = no dotlock_use_excl = no lda_mailbox_autocreate = yes lock_method = dotlock mail_access_groups = mail mail_debug = yes mail_fsync = always mail_location = mdbox:~/mail:INDEX=~/index mail_plugins = quota zlib mail_privileged_group = mail managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date mbox_read_locks = dotlock mbox_write_locks = dotlock mdbox_rotate_interval = 1 weeks mdbox_rotate_size = 20 M mmap_disable = yes namespace { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { auto = subscribe special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } prefix = separator = / type = private } passdb { args = /etc/dovecot/dovecot-sql-master.conf.ext driver = sql master = yes pass = yes } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } plugin { autosubscribe = Trash autosubscribe2 = Junk autosubscribe3 = Drafts autosubscribe4 = Sent autosubscribe5 = INBOX mail_max_userip_connections = 10 managesieve_max_line_length = 65536 quota = dict:User quota::file:%h/dovecot.quota quota2_rule = Trash:storage=+10%% quota3_rule = Junk:storage=+20%% quota_rule = *:storage=100M:messages=100000 recipient_delimiter = + sieve_before = /var/opt/mail/global.sieve/ zlib_save = gz zlib_save_level = 9 } pop3_reuse_xuidl = yes protocols = imap pop3 sieve lmtp service auth { inet_listener auth { port = 113 } unix_listener auth-userdb { user = nobody } } service lmtp { inet_listener lmtp { port = 24 } process_min_avail = 10 service_count = 1 } service managesieve-login { inet_listener sieve { port = 4190 } process_min_avail = 0 service_count = 1 vsz_limit = 64 M } ssl = no ssl_cert = </etc/pki/dovecot/certs/dovecot.pem ssl_key = </etc/pki/dovecot/private/dovecot.pem userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lda { mail_plugins = quota zlib sieve } protocol imap { mail_plugins = quota zlib imap_quota } protocol sieve { mail_max_userip_connections = 10 mail_plugins = quota zlib managesieve_max_line_length = 65536 managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date } protocol lmtp { mail_plugins = quota zlib sieve }
On 29.1.2014, at 15.30, Michael Smith (DF) <msmith@datafoundry.com> wrote:
Ok, I think I found an answer. I don't know if it's the right one...
I duplicated my dovecot.conf to backup.conf. I then removed this part from plugin {} zlib_save = gz zlib_save_level = 9
I then add "-c backup.conf" to my dsync command. This appears to allow dsync to read the compressed mdbox accounts, but when it writes the backup in maildir format, everything is uncompressed.
Or you could just use doveadm -o plugin/zlib_save= to override the setting.
participants (2)
-
Michael Smith (DF)
-
Timo Sirainen