View Single Post
  #39 (permalink)  
Old 06-09-2009, 02:48 PM
maremester maremester is offline
New Member
 
Posts: 3
Default Modify your "disclaimer" script for check only "From: @your_domain.com"

Quote:
In that case, you must to set "dflit" filter to all incomming and outgoing messages, and need to modify your "disclaimer" script for check only "From: @your_domain.com" and set an disclaimer for this email... external emails "From: @another_domains.com" don't set an disclaimer in your "disclaimer" script...
__________________
Daniel Eugenin
IT Linux: Professional OpenSource
Can you tell me how to do that.
My "disclaimer" script is:
Code:
  #!/bin/sh
  INSPECT_DIR=/var/spool/filter
  SENDMAIL=/opt/zimbra/postfix/sbin/sendmail
  FOLDER_DISCLAIMER=/opt/zimbra/postfix/conf
  
  # Exit codes from <sy***its.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; }
  
  TEXT_DISCLAIMER=`grep "[a|A-z|Z]" ${FOLDER_DISCLAIMER}/disclaimer.txt | grep -v "_" | tail -2 | head -1`
  
  cat > in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
  
  nohup grep "${TEXT_DISCLAIMER}" in.$$ > /dev/null 2>&1
  
  if [ ! "$?" = 0 ]; then
  /usr/bin/altermime --input=in.$$ --disclaimer=${FOLDER_DISCLAIMER}/disclaimer.txt --disclaimer-html=${FOLDER_DISCLAIMER}/disclaimer.html \
  --xheader="X-Copyrighted-Material: Please visit www.company.com/privacy.htm" || { echo Message content rejected; exit $EX_UNAVAILABLE; }
  fi
  
  $SENDMAIL -i "$@" < in.$$
  
  exit $?
Thanks.
Reply With Quote