Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Store (in mysql) & delete emails with attachments

Posted on 2004-10-27
14
Medium Priority
?
158 Views
Last Modified: 2010-03-05
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...
0
Comment
Question by:MitchellSTL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
14 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 12428104
From where do you get the emails that you want to delete?
0
 
LVL 48

Expert Comment

by:Tintin
ID: 12428359
What's your definition of a "bad attachment"?
0
 

Author Comment

by:MitchellSTL
ID: 12432958
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 48

Expert Comment

by:Tintin
ID: 12439914
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
 

Author Comment

by:MitchellSTL
ID: 12443713
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
 
LVL 48

Expert Comment

by:Tintin
ID: 12454577
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
 

Author Comment

by:MitchellSTL
ID: 12464286
I'll check it out...  be back shortly..
0
 

Author Comment

by:MitchellSTL
ID: 12466681
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
 
LVL 48

Expert Comment

by:Tintin
ID: 12469202
Do you have command line access on the mail server?
0
 

Author Comment

by:MitchellSTL
ID: 12472846
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
 
LVL 48

Accepted Solution

by:
Tintin earned 2000 total points
ID: 12479108
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
 

Author Comment

by:MitchellSTL
ID: 12504460
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question