Skip to content

Instantly share code, notes, and snippets.

@casperbiering
Created December 9, 2016 12:15
Show Gist options
  • Save casperbiering/35c7a7be9bf810343f807a1365fd3151 to your computer and use it in GitHub Desktop.
Save casperbiering/35c7a7be9bf810343f807a1365fd3151 to your computer and use it in GitHub Desktop.

/etc/postfix/master.cf

redirect2admin    unix  -       n       n       -       -       pipe
  flags=F user=www-data argv=/bin/bash /etc/postfix/redirect2admin.bash

/etc/postfix/main.cf

header_checks = pcre:/etc/postfix/header_checks
smtpd_sender_restrictions = check_sender_access pcre:/etc/postfix/check_sender_access

/etc/postfix/header_checks

if /^From:/
/@domain1.com\b/ DUNNO
/@domain2.com\b/ DUNNO

/@/ FILTER redirect2admin:redirect2admin
endif

/etc/postfix/check_sender_access

/@domain1.com$/ OK
/@domain2.com$/ OK

/@/ FILTER redirect2admin:redirect2admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment