Installation

The easiest way to install Mailur is to run bin/install script.

Replace example.com everywhere with name of your server.

Pre-requirements: a server or LXC container with CentOS 7.
Default username and password: demo / demo

# prepare code
yum install -y git
git clone https://github.com/naspeh/mailur.git /opt/mailur
cd /opt/mailur

# run script
bin/install

Open http://example.com:5000 in the browser.

Customization

Change config in bin/env that looks like:

#!/bin/sh
# used for creation of virtual mailboxes
# use a space separator for multiple users
user=demo

# comment next line if you modify "/etc/dovecot/passwd.users"
pass={plain}demo

# used in "bin/deploy" for nginx and certbot
domain=example.com

# used as password for dovecot master users
# used as "doveadm_password"
secret=5969dd9f462f403b8a2866f6d79fa399

# used by cli/web application
export MLR_DOMAIN=$domain
export MLR_SECRET=$secret
export MLR_MASTER=root:$secret
export MLR_SIEVE=sieve:$secret
export MLR_IMAP_OFF=''

and run bin/install again, it's safe to run multiple times.

Deploy with https

Ensure proper $domain is set in bin/env.

Run bin/deploy. It will deploy all stuff behind nginx with free SSL certificate from Let's Encrypt.

Open https://example.com in the browser.

IMAPS will be available on server too.

Import & send emails

. bin/activate

# using Gmail
mlr remote demo set {username} {password} --imap=imap.gmail.com --smtp=smtp.gmail.com

# or using general IMAP/SMTP server
mlr remote demo set {username} {password} --imap=mail.example.com --smtp=mail.example.com

# initial import
mlr remote demo --parse

# and install systemd service to import new messages
user=demo bin/install-idle-sync

Note: I use two-factor authentication for Gmail with app password for Mailur.

Master-master replication

I use two servers with master-master replication enabled.

For that for each user you should add userdb_mail_replica parameter with your second server in /etc/dovecot/passwd.users like:

demo:{plain}demo::::::userdb_mail_replica=tcps:replica.example.com