ajfoote
04-19-2004, 12:11 AM
Use Procmail To Stop Viruses
If you are like me than you get tons of those virus email with an attachment each day. These are a real pain, the fill your inbox, and waste your time.
Why not just delete them on the server level before they even reach your inbox!
If you have Procmail enabled in your site just add the following, it's best to add this at the "top" since Procmail does commands in order... this should be the first one if you have others.
What is does is scan every email with an attachment that is under 150k (the viruses are like this) and if the file has the zip, exe, pif, etc extensions it deletes the email before it ever reaches you inbox.
#################################
:0
* < 150000
* ! ^Content-Type: text/plain
{
:0B
* ^(Content-(Type|Disposition):.*|[ ]*(file)?)name=("[^"]*|[^ ]*)\.(bat|cmd|com|zip|exe|js|pif|vbs|scr|wsf)
/dev/null
}
#################################
Note, if for some reason people send you EXE attachment and/or Zip files under 150k then you can removes the file extensions from the array.
Also, you can change the 150k to whatever you want but I head that scanning large attachments will use a lot resourses... besides these virus are rarely over 150k in size, most seam to be around 40K to 75K.
If you are like me than you get tons of those virus email with an attachment each day. These are a real pain, the fill your inbox, and waste your time.
Why not just delete them on the server level before they even reach your inbox!
If you have Procmail enabled in your site just add the following, it's best to add this at the "top" since Procmail does commands in order... this should be the first one if you have others.
What is does is scan every email with an attachment that is under 150k (the viruses are like this) and if the file has the zip, exe, pif, etc extensions it deletes the email before it ever reaches you inbox.
#################################
:0
* < 150000
* ! ^Content-Type: text/plain
{
:0B
* ^(Content-(Type|Disposition):.*|[ ]*(file)?)name=("[^"]*|[^ ]*)\.(bat|cmd|com|zip|exe|js|pif|vbs|scr|wsf)
/dev/null
}
#################################
Note, if for some reason people send you EXE attachment and/or Zip files under 150k then you can removes the file extensions from the array.
Also, you can change the 150k to whatever you want but I head that scanning large attachments will use a lot resourses... besides these virus are rarely over 150k in size, most seam to be around 40K to 75K.