Click to See Complete Forum and Search --> : Email Filtering


chammock
12-07-2000, 08:52 AM
A definite newbie here. It was suggested on the General Board that I also post this here.

I was told that an application I am working on will be running on a Linux box. My need is to have an email server running on the box to accept emails from the field. The emails will have a .txt file attached that I need to filter to different directories based on the 'From' email address. I have no control over the email attachment files and they could possibly have duplicate names. So I also need to better understand how and where the attachments are initially stored as they come in and is there a chance of one file overwriting another if they have the same name.

I am investigating ProcMail as an option suggested in another post.

Does this sound doable? Can you point me to some resources?

Thanks so much!

klamath
12-07-2000, 03:02 PM
This should definately be doable. Procmail is a good choice -- there are lots (hundreds) of pages on setting up procmail and doing fancy stuff with it.

You might also consider piping the mail straight to a script which would handle it. If you have a dedicated email address, this might be simpler. For example, in /etc/aliases:

submit:"|/usr/local/bin/handle_mail.pl"

Where 'submit' is the email address the stuff gets sent to and handle_mail.pl is a Perl script which takes the mail on STDIN and does whatever you need with it. There are lots of Perl modules for handling mail - you can find them @ CPAN.

------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Better Bulletin Board (http://bbb.sourceforge.net)

knute
12-07-2000, 03:21 PM
If you are worried about duplicate file names, simply append the date/time to the name, then if you have 4 copies of general.txt they could be general07122000180000.txt
general07122000180001.txt
general07122000192345.txt
and general07122000224556.txt...
Just a thought... Wouldn't work for a dos platform though...

------------------
Knute
Email: knuteh@yahoo.com
ICQ: 53979509
GAIM: knutehall