Obambu

From miki
Revision as of 21:07, 29 September 2024 by Mip (talk | contribs)
Jump to navigation Jump to search

Obambu (https://obambu.com) is our new email server for domain immie.org.

Configuration

Dynamic aliases

  • Dynamic aliases are setup as global email filters.
  • Example:
  • Filter name: Starts with mpe.
  • Rules: Any recipient, matches regex.
^mip\..*@immie\.org$
  • Action: Deliver to folder
/immie.org/mpe
  • It's important to use Any Recipient instead of To, so that the match is done on the email address, and not the complete To: header that might include some extra characters (like "ABC" <abc@xyz.com>).

Email migration

We use offlineimap to transfer mail from Gandi.net in a local Maildir, and then to Obambu server.

  • offlineimap configuration (file ~/.offlineimaprc):
[general]
accounts = MpeGandi

#### MPE #################

[Account MpeGandi]
localrepository = LocalMpe
remoterepository = RemoteMpeGandi

[Account MpeObambu]
localrepository = LocalMpe
remoterepository = RemoteMpeObambu

[Repository LocalMpe]
type = Maildir
localfolders = ~/imap.noidx/mpe

[Repository RemoteMpeGandi]
type = IMAP
remotehost = mail.gandi.net
starttls = yes
ssl = no
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
remoteport = 143
remoteuser = user@domain.org
remotepass = XXXXXXXXXXX
readonly = True

[Repository RemoteMpeObambu]
type = IMAP
remotehost = cp5.obambu.com
starttls = yes
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
remoteport = 993
remoteuser = user@domain.org
remotepass = XXXXXXXXXXXXXX
readonly = False

Before sending mails to obambu:

  • Remove the Trash folder.
  • Add INBOX. to all folders without such prefix.
This is mandatory because Obambu uses a different folder structure.

Tips

Send emails to test mail filters

This use sendmail from postfix:

#!/bin/bash

# Send the email
# We test both bare address and address with name ("ABC" <abc@xyz.com>).
send_mail()
{
    recipient=$1
    filter=$2

    echo recipient: $recipient / filter: $filter

    /usr/sbin/sendmail -t <<EOF
From: michael.peeters@noekeon.org
To: $recipient
Subject: Test email for filter: $filter

This is a test email to check that the filter
at server level works correctly.

If this mail shouldn't be sent to you, tell me ;-)

Test email for filter: $filter
EOF

    /usr/sbin/sendmail -t <<EOF
From: michael.peeters@noekeon.org
To: "Some Name Here" <$recipient>
Subject: Test email for filter: $filter

This is a test email to check that the filter
at server level works correctly.

If this mail shouldn't be sent to you, tell me ;-)

Test email for filter: $filter
EOF
}

prefix="mpe."; send_mail "${prefix}anything@immie.org" "starts with $prefix"
prefix="mip."; send_mail "${prefix}anything@immie.org" "starts with $prefix"