boguszip
This commit is contained in:
parent
20bd3ca2e2
commit
fc46abdd9c
1 changed files with 13 additions and 3 deletions
|
|
@ -5,9 +5,9 @@ rfork n
|
||||||
|
|
||||||
# exit status matching:
|
# exit status matching:
|
||||||
#
|
#
|
||||||
# *discard* - is really bad, refuse the message
|
# $discard - is really bad, refuse the message
|
||||||
# *accept* - is really good, leave attachment alone
|
# $accept - is really good, leave attachment alone
|
||||||
# * - rewrite attachment to have .suspect extension
|
# anything else - rewrite attachment to have .suspect extension
|
||||||
#
|
#
|
||||||
|
|
||||||
# magic exit statuses known to vf
|
# magic exit statuses known to vf
|
||||||
|
|
@ -21,6 +21,15 @@ if(! ~ $#* 1){
|
||||||
exit usage
|
exit usage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# some idiot virus is sending around attachments marked as .zip
|
||||||
|
# that are completely bogus and just say %TS_ZIP_ATTACH%
|
||||||
|
# as the base64 encoding of the zip file. gmail rejects all zip
|
||||||
|
# attachments when we forward them, so nip this one here.
|
||||||
|
if(grep -s '^%TS_ZIP_ATTACH%$' $1 && ~ `{wc -l <$1} 1 2 3 4 5 6 7 8 9 10){
|
||||||
|
echo bogus zip file!
|
||||||
|
exit $discard
|
||||||
|
}
|
||||||
|
|
||||||
upas/unvf < $1 >$1.unvf
|
upas/unvf < $1 >$1.unvf
|
||||||
file=$1.unvf
|
file=$1.unvf
|
||||||
fn sigexit { rm $file }
|
fn sigexit { rm $file }
|
||||||
|
|
@ -40,6 +49,7 @@ case *Ascii* *text* *'c program'* *'rc executable'*
|
||||||
exit $accept
|
exit $accept
|
||||||
|
|
||||||
case *'zip archive'*
|
case *'zip archive'*
|
||||||
|
|
||||||
# >[2=1] because sometimes we get zip files we can't parse
|
# >[2=1] because sometimes we get zip files we can't parse
|
||||||
# but the errors look like
|
# but the errors look like
|
||||||
# unzip: reading data for philw.doc.scr failed: ...
|
# unzip: reading data for philw.doc.scr failed: ...
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue