You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/mail-mta/courier/files/set-mime

29 lines
741 B

#!/bin/sh
# this has to be called with a list of configuration files to apply the
# changes
# example: ./set-mime /etc/courier/esmtpd /etc/courier/esmtpd-ssl
files=$*
chk_badmime='##NAME: BOFHBADMIME:0'
pos_badmime='##NAME: NOADDMSGID:0'
ins_badmime='\
##NAME: BOFHBADMIME:0\
#\
# set BOFHBADMIME\
# to \"reject\" to return mail with invalid MIME header\
# to \"wrap\" to wrap mail with invalid MIME header in an attachmant\
# to \"accept\" to pass mail with invalid MIME header untouched\
\
BOFHBADMIME=accept\
'
for f in ${files}
do
if ! grep -q "${chk_badmime}" "${f}"
then
echo "adding parameter ${chk_badmime} to ${f}"
cat ${f} | sed -e"/${pos_badmime}/ i ${ins_badmime}" > "${f}.tmp" && mv -f "${f}.tmp" "${f}"
fi
done