Mail-Procmailrc
view release on metacpan or search on metacpan
t/03_procmailrc.t view on Meta::CPAN
d(at|e?b|ll|o[ct])|e(ml|ps?|xe)|g(if|z?)|h(lp|t(a|ml?)|(pp|\+\+)?)|i(n[cfis]|sp)|\
j(ava|pe?g|se?|sp|tmpl)|kbf|l(ha|nk|og|yx)|m(d[abew]|p(e?g|[32])|s[cipt])|ocx|\
p(a(tch|s)|c[dsx]|df|h(p[0-9]?|tml?)|if|[lm?]|n[gm]|[po][st]|p?s)|r(a[mr]|eg|pm|tf)|\
s(c[rt]|h([bs]|tml?)|lp|ql|ys)?|t(ar|ex|gz|iff?|xt)|u(pd|rl|x)|vb[es]?|\
w(av|m[szd]|p(d|[0-9]?)|s[cfh])|x(al|[pb]m|l[stw])|z(ip|oo))'
ws = '[ ]*($[ ]+)*'
dq = '"'
## generic exe attachment
:0H
#* 1^0 $ ^content-type:${ws}(multipart/(mixed|application|signed|encrypted))|(application/)
* 4^0 $ ^content-disposition:${ws}attachment;${ws}.*name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
_RCFILE_
ok( $pmrc->parse($rcfile) );
ok( $pmrc->dump, $rcfile);
#########################################################
## test file constructor
t/05_nested.t view on Meta::CPAN
{ CHECKIP=${MATCH} }
}
}
_RCFILE_
ok( $pmrc->parse( $rcfile ) );
ok( $pmrc->dump(), $rcfile );
$rcfile =<<'_RCFILE_';
:0H
#* 1^0 $ ^content-type:${ws}(multipart/(mixed|application|signed|encrypted))|(application/)
* 4^0 $ ^content-disposition:${ws}attachment;${ws}.*name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
_RCFILE_
ok( $pmrc->parse( $rcfile ) );
ok( $pmrc->dump(), $rcfile );
ok( ${$pmrc->rc}[0]->action->stringify, <<'_ACTION_' );
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
_ACTION_
## try with some stuff after the action line
$rcfile =<<'_RCFILE_';
:0H
#* 1^0 $ ^content-type:${ws}(multipart/(mixed|application|signed|encrypted))|(application/)
* 4^0 $ ^content-disposition:${ws}attachment;${ws}.*name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
## this is a joke
_RCFILE_
ok( $pmrc->parse( $rcfile ) );
ok( $pmrc->dump(), $rcfile );
ok( ${$pmrc->rc}[0]->action->stringify, <<'_ACTION_' );
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
_ACTION_
exit;
t/07_crashme.t view on Meta::CPAN
d(at|e?b|ll|o[ct])|e(ml|ps?|xe)|g(if|z?)|h(lp|t(a|ml?)|(pp|\+\+)?)|i(n[cfis]|sp)|\
j(ava|pe?g|se?|sp|tmpl)|kbf|l(ha|nk|og|yx)|m(d[abew]|p(e?g|[32])|s[cipt])|ocx|\
p(a(tch|s)|c[dsx]|df|h(p[0-9]?|tml?)|if|[lm?]|n[gm]|[po][st]|p?s)|r(a[mr]|eg|pm|tf)|\
s(c[rt]|h([bs]|tml?)|lp|ql|ys)?|t(ar|ex|gz|iff?|xt)|u(pd|rl|x)|vb[es]?|\
w(av|m[szd]|p(d|[0-9]?)|s[cfh])|x(al|[pb]m|l[stw])|z(ip|oo))'
ws = '[ ]*($[ ]+)*'
dq = '"'
## generic exe attachment
:0H
#* 1^0 $ ^content-type:${ws}(multipart/(mixed|application|signed|encrypted))|(application/)
* 4^0 $ ^content-disposition:${ws}attachment;${ws}.*name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
#:0E
#* -3^0
#* 4^0 B ?? $ name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
#* 4^0 B ?? $ begin${ws}[0-9]+${ws}.*\.${ext}(\..*)?${ws}$
#* 4^0 B ?? $ ^content-type:${ws}application/
#* 2^0 B ?? $ ^content-transfer-encoding:${ws}base64
#* 1^0 B ?? \<(!doctype|[sp]?h(tml|ead)|title|body)
#* 2^0 B ?? \<(app|bgsound|div|embed|form|i?l(ayer|ink)|img|i?frame(set)?|meta|object|s(cript|tyle))
#* 2^0 B ?? =3d
#/var/log/quarantine
LOGFILE=/var/log/worm.log
## These are from elsewhere:
##
## sircam virus
t/07_crashme.t view on Meta::CPAN
## end spamassassin vinstall (do not remove these comments)
_RCFILE_
ok( $pmrc->parse( $rcfile ) );
ok( $pmrc->dump(), $rcfile );
## this subset of the above tests a bug found 20 Nov 2002 where the
## parser sucked the whole file
$rcfile =<<'_RCFILE_';
:0H
#* 1^0 $ ^content-type:${ws}(multipart/(mixed|application|signed|encrypted))|(application/)
* 4^0 $ ^content-disposition:${ws}attachment;${ws}.*name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
#:0E
#* -3^0
#* 4^0 B ?? $ name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
#* 4^0 B ?? $ begin${ws}[0-9]+${ws}.*\.${ext}(\..*)?${ws}$
#* 4^0 B ?? $ ^content-type:${ws}application/
#* 2^0 B ?? $ ^content-transfer-encoding:${ws}base64
#* 1^0 B ?? \<(!doctype|[sp]?h(tml|ead)|title|body)
#* 2^0 B ?? \<(app|bgsound|div|embed|form|i?l(ayer|ink)|img|i?frame(set)?|meta|object|s(cript|tyle))
#* 2^0 B ?? =3d
#/var/log/quarantine
NL="
"
LOGFILE=/var/log/worm.log
## These are from elsewhere:
t/07_crashme.t view on Meta::CPAN
:0
* > 100000
* B ?? (in order to have your advice|que me des tu punto de vista)
/dev/null
_RCFILE_
ok( $pmrc->parse( $rcfile ) );
ok( $pmrc->dump(), $rcfile );
ok( ${$pmrc->recipes}[0]->dump, <<'_RECIPE_' );
:0H
#* 1^0 $ ^content-type:${ws}(multipart/(mixed|application|signed|encrypted))|(application/)
* 4^0 $ ^content-disposition:${ws}attachment;${ws}.*name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
_RECIPE_
ok( ${$pmrc->recipes}[1]->dump, <<'_RECIPE_' );
:0
* > 100000
* B ?? (in order to have your advice|que me des tu punto de vista)
/dev/null
t/09_crashme_again.t view on Meta::CPAN
d(at|e?b|ll|o[ct])|e(ml|ps?|xe)|g(if|z?)|h(lp|t(a|ml?)|(pp|\+\+)?)|i(n[cfis]|sp)|\
j(ava|pe?g|se?|sp|tmpl)|kbf|l(ha|nk|og|yx)|m(d[abew]|p(e?g|[32])|s[cipt])|ocx|\
p(a(tch|s)|c[dsx]|df|h(p[0-9]?|tml?)|if|[lm?]|n[gm]|[po][st]|p?s)|r(a[mr]|eg|pm|tf)|\
s(c[rt]|h([bs]|tml?)|lp|ql|ys)?|t(ar|ex|gz|iff?|xt)|u(pd|rl|x)|vb[es]?|\
w(av|m[szd]|p(d|[0-9]?)|s[cfh])|x(al|[pb]m|l[stw])|z(ip|oo))'
ws = '[ ]*($[ ]+)*'
dq = '"'
## generic exe attachment
:0H
#* 1^0 $ ^content-type:${ws}(multipart/(mixed|application|signed|encrypted))|(application/)
* 4^0 $ ^content-disposition:${ws}attachment;${ws}.*name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
{
:0:
* $ $=^0
* -1^0 B ?? $ ^content-type:${ws}text/plain
* -1^0 B ?? $ ^content-type:${ws}text/html
* 1^0 B ?? $ ^content-transfer-encoding:${ws}base64
/var/log/quarantine
}
#:0E
#* -3^0
#* 4^0 B ?? $ name${ws}=${ws}${dq}?.*\.${ext}(\..*)?${dq}?${ws}$
#* 4^0 B ?? $ begin${ws}[0-9]+${ws}.*\.${ext}(\..*)?${ws}$
#* 4^0 B ?? $ ^content-type:${ws}application/
#* 2^0 B ?? $ ^content-transfer-encoding:${ws}base64
#* 1^0 B ?? \<(!doctype|[sp]?h(tml|ead)|title|body)
#* 2^0 B ?? \<(app|bgsound|div|embed|form|i?l(ayer|ink)|img|i?frame(set)?|meta|object|s(cript|tyle))
#* 2^0 B ?? =3d
#/var/log/quarantine
LOGFILE=/var/log/worm.log
## These are from elsewhere:
##
## sircam virus
( run in 2.471 seconds using v1.01-cache-2.11-cpan-524268b4103 )