Hi there,
Finding this confusing to be bluntly honest with you.
I have virtualmin running on CentOS 6.10, it's dkim-milter and postfix, what I have quite essentially done is made it append a disclaimer specific to a domain and had some trouble with getting the correct email domain so the disclaimer was even picked up as such so that it placed it at the end of the email.
/etc/postfix/disclaimer
Code:
#!/bin/sh
# Localize these.
INSPECT_DIR=/var/spool/filter
SENDMAIL=/usr/sbin/sendmail
# For multiple domains:
DOMAIN_A_ADDRESSES=/etc/postfix/domain_a_addresses
DOMAIN_B_ADDRESSES=/etc/postfix/domain_b_addresses
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15
# Start processing.
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit
$EX_TEMPFAIL; }
cat >in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
from_domain=`grep -m1 "^From: " in.$$ | cut -f 2 -d "@" | cut -d ">" -f 1`
# hsmedia.co.uk domain name disclaimer
if [ `grep -wi ^${from_domain}$ ${DOMAIN_A_ADDRESSES}` ]; then
/usr/bin/altermime --input=in.$$ \
--disclaimer=/etc/postfix/domain_a_disclaimer.txt \
--disclaimer-html=/etc/postfix/domain_a_disclaimer.txt.html || \
{ echo Message content rejected; exit $EX_UNAVAILABLE; }
fi
if [ `grep -wi ^${from_domain}$ ${DOMAIN_B_ADDRESSES}` ]; then
/usr/bin/altermime --input=in.$$ \
--disclaimer=/etc/postfix/domain_b_disclaimer.txt \
--disclaimer-html=/etc/postfix/domain_b_disclaimer.txt.html || \
{ echo Message content rejected; exit $EX_UNAVAILABLE; }
fi
$SENDMAIL "$@" <in.$$
exit $?
Then the master.cf file contains:
Code:
<below every submission and smtp it has this below (since I am running two virtual hosts on virtualmin all using their own dedicated IPs:>
-o content_filter=dfilt:
Right at the bottom is:
Code:
dfilt unix - n n - - pipe
flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}
Though I doubt the master.cf is the problem, I am just not sure about where to go from here really and get this working, did amazing getting the disclaimer working though, thought this was too easy haha
Any help is hugely appreciated in advance,
Jeremy,