problem

Hi Everyone ,

I have some queries about parsing a e-mail message
stored in unix mail box.
I am facing a small problem with this program.
My original problem definition is that :

" Mails come from Internet to my Unix Inbox with attachments. I need to read each message and separate the attachments from it. "

All the mails are stored in a single file ( for example in
/var/mail/nagesh ).
The scope is to detach the attachments from each message and store in any directory.
I have written the necessary perl script which reads each message from the unix mail box and detaches the attachments into a directory. ( I have used perl MIME::Parser )

As you know whenever we send a mail from a client mail software , it adds some parameters to the header , body and the attachment of the mail.
For example when i send a mail from outlook express with a
attachment named "Syllabus.txt" then the parameters for the attachment looks like
this :

Content-Type: text/plain;
name="Syllabus.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Syllabus.txt"

But here is my problem.
I have sent an e-mail with an attachment from my local outlook express client to the Production Unix Mail box .
And when i opened the message on the unix mail box
i was able to find Content-Type , Content-Transfer-Encoding ,
and Content-Disposition parameters but
the parameters "name" and "filename" were missing.

I don't know why is this happening .
As these two parameters are missing , i am unable to detach the attachments with their original file name .

Does anyone of you have the idea of why this is happening ???
Or is it the problem of any setting on the receiving End ???
Your help will be greatly appreciated.

Thanks,
Nagesh.

I don't know what this problem exactly is. But when I wrote some own shell/perl scripts for incomming e-mails [virus scanning], everything has worked exept Outlook e-mails.

All e-mail klients write attachements parameter to single line in header but Outlook to several lines delimited by tab from begining of the line.

I had to rewrite all by header parsing ...

Having difficulty detaching a attachment from unix email - can anyone suggest something ?

I am working on a script that assembles mime mail. To help me, I have a subdirectory with mime mail messages from several sources, including outlook.

Every Outlook mime attachment that I have goes like this:

Content-Type: text/plain;
        name="accesses.txt"
Content-Disposition: attachment;
        filename="accesses.txt"

This is the issue that Rado1x mentioned. Other mailers would have done that in two lines rather than four. But the Microsoft technique is legal. Your detachment program simply must handle this case.

If you really have just lines 1 and 3 (and therefore no names), maybe the program could generate a name.

If you have no source to the detachment program, maybe you can write a script that will copy the mail, but add a filename to attachments with no name. (Or join the two lines, depending on which problem you have.) Then just run the script as a intermediate procedure.

Hi Nagesh
My name is harish.I am also working on a same kind of script.It will be really helpfull if you share your perl script with me.Please reply with your suggestion.
Thanks
Harish Kumar