#!/bin/sh # First argument of this script is the package name # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list # Applying patches (if any) apply_patches ${1} && cd ${LFS_TMP}/${1} && make \ BASENAME=/usr \ LOCKINGTEST=/tmp \ install && make install-suid && cat > /etc/procmailrc << "EOF" && # /etc/procmailrc # SHELL=/bin/sh PATH=/bin:/usr/bin:/usr/sbin MAILDIR=/var/mail LOGFILE=/var/log/procmail.log LOG="--- Logging ${LOGFILE} for ${LOGNAME}, " #DEFAULT=$MAILDIR/${LOGNAME} VERBOSE=yes # The default internal egrep of procmailrc igore case. ################################## # Clam AV ################################## # A recipe to match a From line: :0 * ^Subject: Virus intercepted clamav # All mail destined to spam@yourdomain and to ham@yourdomain should go # directly to the spam-sure and ham mail folders respectively. # This rule is usefull because we don't need to setup a spam or # ham account on the mail server. :0 * ^To:.*spam@_DOMAIN_ spam-sure :0 * ^To:.*ham@_DOMAIN_ ham ################################## # SpamAssassin ################################## # The condition line ensures that only messages smaller than 250 kB # (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam # isn't bigger than a few k and working with big messages can bring # SpamAssassin to its knees. # # The lock file ensures that only 1 spamassassin invocation happens # at 1 time, to keep the load down. # :0fw: spamassassin.lock * < 256000 | /usr/bin/spamassassin # All mail tagged as spam (eg. with a score higher than the set threshold) # is moved to "spam". :0: * ^X-Spam-Status: Yes spam ################################## # Last resort rule ################################## # Accept all the rest to your default mailbox :0: ${DEFAULT} EOF DOMAIN1=$(echo ${DOMAIN} | sed "s!\(.*\)\.\(.*\)!\1!") && DOMAIN2=$(echo ${DOMAIN} | sed "s!\(.*\)\.\(.*\)!\2!") && sed -i -e "s!_DOMAIN_!${DOMAIN1}\\\.${DOMAIN2}!g" /etc/procmailrc # Return last error exit $?