Skip to content

Instantly share code, notes, and snippets.

@ithoq
Created November 29, 2016 16:57
Show Gist options
  • Save ithoq/c7a89b5290cf89c0ec76beb4f6b9c1f4 to your computer and use it in GitHub Desktop.
Save ithoq/c7a89b5290cf89c0ec76beb4f6b9c1f4 to your computer and use it in GitHub Desktop.
Postfix / Dovecot / Roundcube / Sieve

Postfix / Dovecot / Roundcube / Sieve

Installation

pkg install dovecot-pigeonhole

Postfix

master.cf

# Dovecot LDA for delivery
dovecot     unix        -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}
#

main.cf

dovecot_destination_recipient_limit = 1
virtual_transport = dovecot

Dovecot

mkdir -p /usr/local/etc/dovecot/sieve/global

dovecot/conf.d/10-mail.conf

mail_home = /var/mail/virtual/%u/sieve
mail_location = maildir:/var/mail/virtual/%u

dovecot/conf.d/15-lda.conf

protocol lda {
    mail_plugins = $mail_plugins sieve
}

dovcot/conf.d/20-managesieve.conf

protocols = $protocols sieve

dovecot/conf.d/90-sieve.conf

plugin {
    sieve = /var/mail/virtual/%u/sieve/dovecot.sieve
    sieve_global_path = /usr/local/etc/dovecot/sieve/default.sieve
    sieve_dir = /var/mail/virtual/%u/sieve
    sieve_global_dir = /usr/local/etc/dovecot/sieve/global/
}

Roundcube

roundcube/config/config.inc.php

$config['plugins'] = array(
    'archive',
    'zipdownload',
    'managesieve',
);

roundcube/plugins/managesieve/config.inc.php

$config['managesieve_host'] = '<mail server>';
$config['managesieve_usetls'] = true;
$config['managesieve_default'] = '/usr/local/etc/dovecot/sieve/global';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment