Simple server-side e-mail aggregation setup

fr33domlover bc37ec3a05 README -> 6 years ago
AUTHORS d3733eb3b7 Put all files in a git repo 7 years ago
COPYING d3733eb3b7 Put all files in a git repo 7 years ago
INSTALL 38c96183ec doc: Update documentation and add TODOs 7 years ago bc37ec3a05 README -> 6 years ago
TODO e1746ffdf9 doc: Add TODO for RSS aggregation 7 years ago
doar.cron 156da6c355 cron: Don't send success reports to server admin, only errors 7 years ago bbf5ee578f script: Add support for comments in 'account_list' 7 years ago a542d3b319 Fix obvious bugs found during first run 7 years ago
mpoprc 25d9a8cb05 config: Default to SMTP instead of LMTP 7 years ago d3733eb3b7 Put all files in a git repo 7 years ago

doar - simple mail aggregation setup based on 'mpop' and 'msmtp'


'doar' is a simple cron job and a per-user config file, meant for use by mail servers. It allows users to specify external e-mail accounts from which their mail will automatically be collected by the server and put into their local inbox. The advantages of doing so are:

  • Easier transition to a new e-mail provider
  • One account, one address, one password to remember
  • Access all mail from all providers remotely and uniformly using a single provider

But these are not specific to 'doar'. What 'doar' aims to do is provide a simple, configurable and lightweight mechanism for mail aggregation, which can be used with any mail server and without dependency on specific UI. Possible UIs for mail users to configure 'doar':

  • SSH (perhaps limited, if general SSH access isn't given otherwise)
  • e-mail (send specially formatted e-mail to a special system account)
  • web interface with CGI
  • script or GUI on the user's machine, which internally may use mail or SSH or some messaging over HTTP/XMPP/etc.

Folder Structure

Each user can have a folder '~/.config/doar'. That folder contains the following files:

  • 'account_defs': definitions of external POP accounts in mpop format
  • 'account_list': one-per-line list of accounts to actually pull from

The system contains server-wide config as follows:

  • cron job
  • script that runs on cron job
  • beginning of mpoprc which will be prepended to each 'account_defs'

It's possible to configure msmtp using a config file just like mpop, but I currently prefer to use command-line options since for this use case the configuration is trivial and requires parameters passed from mpop.

Suggested locations for the files:

  • /etc/cron.d/doar
  • /usr/bin/doar or /usr/local/bin/doar
  • /etc/doar/mpoprc


See the file 'INSTALL'.

Account Configuration

Each user on your server can participate in e-mail aggregation by creating the files 'account_defs' and 'account_list', mentioned above. If it's not a personal home server, and you have users who are not you, make sure they understand how to fill these files. In order to NOT participate, a user simply needs to remove or rename at least one of these files.

'account_defs' should preferrably have only user read-write permissions, to minimize the risk something unwanted reads the passwords and account details. mpop can also be configured to get the password by running a command, e.g. decrypt a gpg-signed file which contains the password or maybe fetch it from a system keyring.

It should be written in mpop configuration syntax, and only define accounts. In other words, it's contains just account definition blocks and should more or less like this:

account jdoe_riseup
user jdoe
password 7b87B78BG87g68G

account jdoe2_riseup : jdoe_riseup
user jdoe2
password f%dc56cdf%^4v77v57l
tls_starttls off

account fr33mail
host pop.fr33mail.libre
user johndoe
password 4dc%f7H9nny&hbTCE4D45

account i2p
port 7890
user jekyll
password cDe$5^7*9knBgT
tls off

Comments are allowed just like in any mpop configuration file.

'account_list' is a vertical list of account names, i.e. one per line. Lines starting with '#' are ignored and blank lines are allowed, so there's place for comments. Example:

### list of external e-mail accounts to pull from into this server


# note for myself:
# I stopped using jdoe2 account but keeping it just in case