>-----Message d'origine----- >De : [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] la part de Madhu >Envoy=E9 : jeudi 13 septembre 2007 07:48 >=C0 : xmail@xmailserver.org >Objet : [xmail] Filter to Delete Emails by size > > >Hi, >Anyone can help me a scheme to delete incoming mails that are=20 >lesser than a particular size? > >Best Regards, > >Madhu >
- Sample batch script for Win2K/XP/2003 supposing its name is fsizelessthan.cmd in directory c:\xmail\filters : @echo off rem reject message if file size (first argument is file name) less = than second argument in bytes if %~z1 LSS %2 ( exit 19 ) else ( exit 0 ) To use it for filessize less than 10000 bytes add the line in filters.post-data.tab : "cmd /X /Q /C c:\xmail\filters\fsizelessthan.cmd" "$FILE" "10000" This is a "rapid" response, the test is done on the file size, so = includes complete smtp headers, not only the message DATA size. - Equivalent unix shell script (if no errors ! i'm not a bash/sh script specialist, please guys correct me if wrong :-) ) supposing the batch is fsizelessthan in directory /xmail/filters : #!/bin/bash # reject message if file size (first argument is file name) less than second argument in bytes if ["{file size $1}" -lt "$2"] then exit 19 else exit 0 To use it for filessize less than 10000 bytes add the line in filters.post-data.tab : "/xmail/filters/fsizelessthan" "$FILE" "10000" NOT TESTED AT ALL :) Francis - To unsubscribe from this list: send the line "unsubscribe xmail" in the body of a message to [EMAIL PROTECTED] For general help: send the line "help" in the body of a message to [EMAIL PROTECTED]