Store (in mysql) & delete emails with attachments

FYI, I'm a perl newbie...

Here is what I want accomplished...

1) Setup a list of bad attachment types
2) Store all emails with bad attachments in mysql (only info needed is from, to, subject, body, & attachment(s))
3) Delete emails with bad attachments

I've seen some websites discuss how to read emails & how to retrieve the file name of the attachment, but I'm not sure how to incorporate into one big perl...  any help is appreciated...
MitchellSTLAsked:
Who is Participating?
 
TintinCommented:
Well, you can still run spamassassin on your side.  All you need to do is retrieve the mail via Net::POP3 or Net::IMAP modules and pipe to spamassassin.
0
 
ozoCommented:
From where do you get the emails that you want to delete?
0
 
TintinCommented:
What's your definition of a "bad attachment"?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
MitchellSTLAuthor Commented:
ozo - I would get the email from a pop3 / imap email account.  The server has sendmail installed & it works.

Tintin - I want to define bad attachments as having a certain filename extension...  i.e. *.bat, *.cmd, *.exe, *.scr, *.pif, *.exe, etc...  I would rather go by the filename's extension than the file's mime type...unless there is some huge advantage to do so.

Does that answer the question(s)?
0
 
TintinCommented:
More questions.

So some mail is retrieved via POP3 and some via IMAP.  How do you know which is which?

What are you actually trying to achieve?  If it is to stop potential email viruses/worms, then don't go by the filename extension, as almost all viruses use a false extension.
0
 
MitchellSTLAuthor Commented:
No it can be retrieved either way...  I have no preference on which protocol is used to read & purge messages.

I'm just trying to delete an email if those attachments are present...more of a spam control in my case.  The only time that I receive spam is usually when it has a virus attachment...

As for the filename extension, I don't care if it goes by filename or by mime type...

If this is more complex than I thought, I can give 500 points for #1 & #2 and 500 points for #3...but all three have to be combined together as on script....does that make sense?  (well it did when I typed it)


0
 
TintinCommented:
Why not implement a comprehensive spam solution?

I can highly recommend SpamAssassin (http://www.spamassassin.org/).  I use it myself and it kills about 99% of spam.  It's written in Perl and also has an API if you want to write your own stuff.
0
 
MitchellSTLAuthor Commented:
I'll check it out...  be back shortly..
0
 
MitchellSTLAuthor Commented:
I've asked my service provider (because I think they are already using it) & they will not allow me to use or customize it for my mailboxes.  They recommended client side spam management programs.  They recommended two of them...  The first one has to use outlook and/or outlook express (too insecure for me & can't use at work).  The second was a bloomba.com's proxy product.  Their product does not work with browser based email clients AND Bloomba was purchased by Yahoo.com on 20-Oct-2004.  I'm pleading them to let me do something local, but I never know what I'll get from them....
0
 
TintinCommented:
Do you have command line access on the mail server?
0
 
MitchellSTLAuthor Commented:
No I do not have command line access on the mail server...  My most recent email from them sounds as though they are sticking to their guns about me using client side spam tools...  So I think I'm back to my perl question/solution....

0
 
MitchellSTLAuthor Commented:
Okay... I'm willing to try, but I don't know how to go about it....  

[I did say I was a newbie at perl, right?]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.