Skip to content

Instantly share code, notes, and snippets.

@AntonTyutin
Last active January 21, 2022 14:56
Show Gist options
  • Save AntonTyutin/0b8631cbc4d9707fdc1c330d723d2764 to your computer and use it in GitHub Desktop.
Save AntonTyutin/0b8631cbc4d9707fdc1c330d723d2764 to your computer and use it in GitHub Desktop.
Postfix mailcatcher configuration
# ====================== /etc/postfix/main.cf =========================
# ...
catcher_destination_recipient_limit = 1
virtual_mailbox_domains = reply.domain.com
virtual_transport = catcher
virtual_mailbox_maps =
virtual_alias_maps =
recipient_delimiter = +
# ===================== /etc/postfix/master.cf =========================
# ...
catcher unix - n n - - pipe
flags=ODRhu user=user argv=/path/to/mailcatcher.sh
${sender} ${user} ${extension}
# ===================== /path/to/mailcatcher.sh ========================
#!/bin/sh
PATH=/bin:/usr/bin:/usr/sbin
FROM="$1"
USER="$2"
CHANNEL="$3"
logger -p local0.info -t "postfix/mailcatcher[$$]" "Caught reply from $FROM to channel $CHANNEL"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment