Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

snfscan-standalone.in 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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=DATADIR/PACKAGE_NAME
  7. SNIFFER_EXE=PREFIX/sbin/SNFClient
  8. SENDMAIL="/usr/sbin/sendmail -G -i"
  9. MSGFILE=$INSPECT_DIR/`date +%Y%m%d%H%M%S`_$$_$RANDOM.msg
  10. # Define Exit codes from <sysexits.h>
  11. EX_OK=0
  12. EX_TEMPFAIL=75
  13. EX_UNAVAILABLE=69
  14. # Clean up when when aborting.
  15. trap "rm -f *$MSGFILE" 1 2 3 15
  16. # Move to our filter directory where we perform our inspections.
  17. cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
  18. # Copy the message to a temp file for processing.
  19. cat > $MSGFILE || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
  20. # Scan the mesage w/ SNF. SNFServer will inject headers.
  21. $SNIFFER_EXE $MSGFILE # Scan the message
  22. $SENDMAIL "$@" < $MSGFILE # Reinject the message
  23. rm -f $MSGFILE # Remove the temp file
  24. # All done.
  25. exit $EX_OK;