spam killing with poplib
A.M. Kuchling
amk at amk.ca
Sat Sep 20 20:54:43 EDT 2003
On Sat, 20 Sep 2003 14:39:49 -0700,
Dave Kuhlman <dkuhlman at rexx.com> wrote:
> Almost all the spam I'm receiving has an attachment whose file
> type is one of .exe, .bat, .com, .scr, .pif, and a few others. Is
> there a way for your Python script to check for that? How do you
> do that in Python.
If you're using Exim as a mail server, you can compile Exim with Python as
an extension language (elspy.sf.net). Rejecting all messages with
executable attachments is then a matter of creating an exim_local_scan.py
file containing:
from elspy import execontent_simple
def local_scan (fd, headers, info):
# Trash executables
execontent_simple.local_scan(fd, headers, info)
# For now, do no other scanning
return
--amk
More information about the Python-list
mailing list