Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

snfscan-spamassasin 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. # 20080314 _M Simplified from sniffer script.
  3. # This version simply creates a temp file, scans it w/ SNFClient and
  4. # sends it on it's way - presumably with headers injected.
  5. # Setup These Variable. The rest of the script should be fine as is.
  6. INSPECT_DIR=/var/spool/snfilter/msg
  7. SNIFFER_EXE=/var/spool/snfilter/SNFClient.exe
  8. SENDMAIL="/usr/sbin/sendmail -i"
  9. SPAMC="/usr/bin/spamc"
  10. MSGFILE=$INSPECT_DIR/`date +%Y%m%d%H%M%S`_$$_$RANDOM.msg
  11. # Define Exit codes from <sysexits.h>
  12. EX_OK=0
  13. EX_TEMPFAIL=75
  14. EX_UNAVAILABLE=69
  15. # Clean up when when aborting.
  16. trap "rm -f *$MSGFILE" 1 2 3 15
  17. # Move to our filter directory where we perform our inspections.
  18. cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
  19. # Copy the message to a temp file for processing.
  20. cat > $MSGFILE || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
  21. # Scan the mesage w/ SNF. SNFServer will inject headers.
  22. $SNIFFER_EXE $MSGFILE # Scan the message
  23. $SPAMC < $MSGFILE -e $SENDMAIL "$@" # Reinject the message through SpamAssasin
  24. rm -f $MSGFILE # Remove the temp file
  25. # All done.
  26. exit $EX_OK;