#!/bin/sh
domainname=$1
username=$2
qmailpath="/var/qmail/mailnames/$domainname/$username"
echo ":0:" > /$qmailpath/.procmailrc
echo "* ^X-Spam-Status: Yes" >> /$qmailpath/.procmailrc
echo "spam@$domainname" >> /$qmailpath/.procmailrc
echo ":0:" >> /$qmailpath/.procmailrc
echo "*" >> /$qmailpath/.procmailrc
echo "./Maildir/" >> /$qmailpath/.procmailrc
chmod 700 $qmailpath/.procmailrc
chown popuser:popuser $qmailpath/.procmailrc
#copy old .qmail
mv -f $qmailpath/.qmail $qmailpath/.qmail.old
echo "| if [ -z "$SA" ]; then export SA=1; /usr/local/psa/bin/psa-spamc -f -u $2@$1 -U /tmp/spamd_light.sock > spamcheck$$; /var/qmail/bin/qmail-local "$USER" "$HOME" "$LOCAL" "" "" "$HOST" "$SENDER" "$DEFAULT" < spamcheck$$; retval=$?; rm -f spamcheck$$; [ $retval = 0 ] && exit 99; exit $retval; fi" > $qmailpath/.qmail
echo "| true" >> $qmailpath/.qmail
echo "|/usr/bin/procmail -m .procmailrc" >> $qmailpath/.qmail
chmod 700 $qmailpath/.qmail
chown popuser:popuser $qmailpath/.qmail
echo user1@domain1.de | awk '{split($0,a,"@"); print a[1]; print a[2];}'
We use essential cookies to make this site work, and optional cookies to enhance your experience.