Skip to content

Instantly share code, notes, and snippets.

@Niemi
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Niemi/c7535dff8a4030c5d293 to your computer and use it in GitHub Desktop.
Save Niemi/c7535dff8a4030c5d293 to your computer and use it in GitHub Desktop.
pki mail.jitter.local certificate "/etc/ssl/mail.jitter.local.crt"
pki mail.jitter.local key "/etc/ssl/private/mail.jitter.local.key"
pki mail.jitter.eu certificate "/etc/ssl/mail.jitter.eu.crt"
pki mail.jitter.eu key "/etc/ssl/private/mail.jitter.eu.key"
queue encryption key "singthesongofthecredentialspostedtogithublalala"
queue compression
expire 6d
bounce-warn 1h, 1d, 5d
# tables
table aliases "file:/etc/mail/aliases"
table cred "file:/etc/mail/cred"
table incoming "file:/etc/mail/incoming"
# blacklist
table reject_sender "file:/etc/mail/reject_sender"
# what we handle internally
table d_local { "jitter.local", "*.jitter.local", "jitter.eu", "*.jitter.eu", "interpol8.net", "*.interpol8.net" }
# and from the bad internetz
table d_final { "jitter.eu", "interpol8.net" }
# have googles
table d_google { "gmail.com", "googlemail.com", "google.com" }
# have a folder for each
table sort_recipient { "google@jitter.eu", "billing@jitter.eu", "alert@jitter.eu" }
# the dangerous internetz
listen on lo0 tls hostname mail.jitter.eu pki mail.jitter.eu no-dsn tag "ext"
# the dangerous internet with authentication
listen on lo0 smtps pki mail.jitter.eu auth <incoming> tag "auth"
# local
listen on lo1 smtps pki mail.jitter.local auth <incoming> mask-source tag "auth"
listen on lo1 tls pki mail.jitter.local auth-optional <incoming> tag "int"
# blacklist em out
reject from any sender <reject_sender>
# incoming
accept tagged "auth" from any for domain <d_local> alias <aliases> deliver to mda "/usr/local/libexec/dovecot/dovecot-lda -e -f %{sender} -a %{rcpt} -d %{user.username}"
accept tagged "ext" from any for any recipient <sort_recipient> alias <aliases> deliver to mda "/usr/local/libexec/dovecot/dovecot-lda -e -f %{sender} -a %{rcpt} -d %{user.username} -m INBOX.%{rcpt.user:lowercase|strip}"
accept tagged "ext" from any for domain <d_final> alias <aliases> deliver to mda "/usr/local/libexec/dovecot/dovecot-lda -e -f %{sender} -a %{rcpt} -d %{user.username}"
accept tagged "int" from any for domain <d_local> alias <aliases> deliver to mda "/usr/local/libexec/dovecot/dovecot-lda -e -f %{sender} -a %{rcpt} -d %{user.username} -m INBOX.internal"
accept from local for local alias <aliases> deliver to mda "/usr/local/libexec/dovecot/dovecot-lda -e -f %{sender} -a %{rcpt} -d %{user.username} -m INBOX.local"
# real ey's
accept tagged "auth" from any for domain <d_google> relay via tls+auth://tom@smtp.gmail.com as "@gmail.com" auth <cred> hostname "mail.jitter.eu" verify
accept tagged "auth" from any for ! domain <d_local> relay via tls+auth://ses@email-smtp.eu-west-1.amazonaws.com as "@jitter.eu" auth <cred> hostname "mail.jitter.eu" verify
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment