LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Mail challenge in script (https://www.linuxquestions.org/questions/linux-general-1/mail-challenge-in-script-486746/)

anil3 09-25-2006 05:18 AM

Mail challenge in script
 
Hello there.

I have a challenge:

In my job I have to keep track of all my collegues that are out travelling. To help me, our travelling agency sends me an email every time someone orders a new journey. (which is appx 1500 times a year)

Now I made a script that reads a mail I have stored as a text file and picks up the name of the traveller, all fligts he/she will embark on and lists this nicely in a table in a web form. The problem is that I have to copy and paste each mail into a file manually.

Next I do is to start my apache, open my homepage and voila - there it is - a complete table with all my collegues due to travel or travelling.

I have managed to set up getmail so it picks up all mails and store them where I want them - so far so good. My challenge is that these textfiles are almost unreadable due to all the =20. I therefore need a mail client that can read a file like this in a readable format, and just send it to a file.

So to recap what I want to do:
1.
getmail connects to mail server, picks up all mail and store them locally on my PC - each one as a separate file. Works fine

2.
use a mail client to iterate alle files to read each file stored by getmail, and echo it to a new file as a readable file.
I can view a mail file with mutt and the content is readable. The problem is that I want to dump the screen output to a file and I want this to be done by a script. To day I have almost 6000 mails in my inbox that is waiting for my script to do the work.

3. pick up the readable textfile and then make my webtable - works fine

Anyone who knows a mail client I can use for this? If you know one please tell me about it.:confused:

kloss 09-25-2006 06:14 AM

Does the following work?

Code:

mimedecode <foo | recode ISO8859-15 >bar

anil3 09-25-2006 08:04 AM

Hmm
 
I'm not sure because I'm on a Fedora 5 and the mimedecode is a debian thing.

If you know it will work on FC5 I think this is bulls eye for me.

kloss 09-25-2006 09:13 AM

Maybe you can try to 'alien --to-rpm' the package...


All times are GMT -5. The time now is 08:13 AM.