LMTP over quota-reject

without taking mail and chacking over LMTP see:


# If  enabled,  lmtpd returns a permanent failure code when a user's
# mailbox is over quota.  By  default,  the  failure  is  temporary,
# causing the MTA to queue the message and retry later.

lmtp_over_quota_perm_failure: 1

Cyrus 2.1.x to 2.2.x migration (debian)

This is one of the ways to do it.


  • stop all cyrus proccesses
  • create a full backup of the mailbox spooldir en: /var/spool/cyrus/mail
  tar cvfz /safeplace/cyrus-mailboxspool-backup.tgz /var/spool/cyrus/mail
  • dump mboxlist in textfile as cyrus user
 su - cyrus -c "/usr/sbin/ctl_mboxlist -d > /tmp/mailboxes-dump.txt"
  • create a backup of /var/lib/cyrus just in case everything goes to ..

Whole Cyrus backup guide



Cyrus extra

Working with BerkeleyDB

Testing performances

in your cyrus dbd dir do:

 db_stat -m

Twicking DBD settings


# Sample BDB configuration file.
# Please adjust as necessary!
# See for hints and tips
# even if you are not using openldap.

# cache
# use "db4.2_stat -m" to measure cache performance
# see
# syntax: gigabytes_of_cache additional_bytes_of_cache number_of_caches
set_cachesize 0 524288 1
# buffer size for transaction log
# The default of 32Kbytes is too small
# see
set_lg_bsize 524288

# other options you may be interested in

# set_lg_dir: configure a separate directory for the transaction logs
# For optimum performance, these should reside on a different disk
# see

# set_lg_max: configure the maximum size of the transaction log file, in bytes
# See
# Note that lg_max must at least be 4x the size of lg_bsize. The default is 10Mb. 

example (2-8GB RAM)

set_cachesize 2 0 8
set_lg_regionmax 268435456
set_lg_bsize 67108864

DB_CONFIG from one of the largest cyrus sites

set_cachesize 0 2097152 1
set_lg_regionmax 2097152
set_lg_bsize 2097152
set_lg_max 16777216
set_tx_max 100

rehasing DB

Stop cyrus server, run db_recover -h /var/lib/imap/db and start cyrus


DBERROR db4: 21 lockers

Getting something like this

 Sep 25 16:39:34 localhost cyrus/lmtp[1544]: DBERROR db4: 558 lockers

see this:

Sieve filtering

Filtering Mailing Lists

require "fileinto";
if header :contains "X-BeenThere" "some-list" {
  fileinto "INBOX.some-list";

Marking Messages As Read

require [ "fileinto", "imapflags" ];
if header :contains "X-BeenThere" "some-list" {
 if header :contains "From" 
  addflag "\\Seen";  
fileinto "INBOX.some-list";


Spamassassin-learn / Spam-folder purge

echo "spam fooSpam"
/usr/bin/sa-learn --spam $SPOOLDIR/d/user/dwight/Spam/*.
echo "ham dwight/Trash"
/usr/bin/sa-learn --ham $SPOOLDIR/d/user/dwight/Trash/*.
/usr/bin/sa-learn --rebuild
su cyrus -c '/usr/lib/cyrus-imapd/ipurge -f -d 14 user/dwight/Trash'
su cyrus -c '/usr/lib/cyrus-imapd/ipurge -f -d 1 user/dwight/Spam'
cyrus.txt · Last modified: 2012/10/15 11:58 by zagi
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready