Reading Mail attachments using unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Reading Mail attachments using unix
# 1  
Old 11-14-2011
Data Reading Mail attachments using unix

Smiliehi all,

please somebody can help me out in reading the pop3 mail attachments or saving it locally

i have a mail account where i receive .csv attachments i need to read that attachments and process them.

any sample code can be much appriciated
Moderator's Comments:
Mod Comment Removed email

Smilie
# 2  
Old 11-14-2011
what is your mail-client?
where is your problem (save or parse attachment) ?
what is your goal after saving the your attachment ?
# 3  
Old 11-15-2011
bt(btitish telecom) has provided a mail account where we receive .csv attachments.through programing we need to read the attahments and insert the data into our data base tables..
iam new new to UNIX and i knew very basic things only..
what i need here is i need to connect to the mail box for every 3 mins and save the attachments of all the mails in the inbox to a folder then delete all the mails from inbox.

it will be greateful if u can provide me some sample code ...
# 4  
Old 11-15-2011
Quote:
Originally Posted by srikanthkadapal
bt(btitish telecom) has provided a mail account where we receive .csv attachments.through programing we need to read the attahments and insert the data into our data base tables..
iam new new to UNIX and i knew very basic things only..
what i need here is i need to connect to the mail box for every 3 mins and save the attachments of all the mails in the inbox to a folder then delete all the mails from inbox.

it will be greateful if u can provide me some sample code ...
hi,srikanthkadapal

firstly you must read some documents related this ssue.
i havent tried it before.but i think you can do it after some packages installs and configure these.

-> first stage (fetchmail)
you can use fetchmail for check a pop3 account and download mail from remote IMAP and POP servers and/or save it into local mailboxes(if we desire this).
* if it is not installed on the system then install appropriate fetchmail pckg.
* configure to your account settings in "~./fetchmailrc"
*
Code:
# fetchmail -d 180 # (for 3 mins)

for these you can look this page
Using fetchmail

-> second stage (procmail+metamail)
* install procmail (it is simply a mda for forwarding mails to separate folders)
* install metamail (for decode,display and save non-text mails and/or and find the correct program for mime based files (for ex..if your attachment is a jpg then it calls convenient jpg viewer on your system but we dont use this now)
and for these you can look at this page
Howto: receive mail and save attachment with fetchmail, procmail and metamail | /home/tom

i hope this will be helpfull..

regards
ygemici
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding Attachments to mail

Hi, I need to send a mail with html code in body and an attachment along with the body and subject. The html code must display a table with data in it in the mail. I have tried the 'sendmail' command, but I am am able to display the table in the mail and unable to attach an attachment. ... (5 Replies)
Discussion started by: Durga Prasad NK
5 Replies

2. Shell Programming and Scripting

unix email attachments in web mail

Hi, Request you to please help on my issue. My issue is: We are able to send the log files as an email attachment. We are able to get the attachment in our inbox. But when we try to see in web mail, instead of the attachment, junk characters are displaying. Appreciate your help. Regards,... (10 Replies)
Discussion started by: gi.srinivas
10 Replies

3. Shell Programming and Scripting

e-mail with multiple binary attachments!

Hi, I have to send email from UNIX with multiple excel attachments and the sender name needs to be customized (sender name need not to be UNIX user). I have checked many ways from this forum and other sources. But, nothing did work for me. Please help me! thanks, Raja. (1 Reply)
Discussion started by: smr_rashmy
1 Replies

4. UNIX for Advanced & Expert Users

Mail attachments getting corrupted...

Hi , Whenever I try to send mails with attachments to external email Id's the attachment is not encoded properly which appears along with body (text) of the mail. The attachement is always getting corrupted. Can anyone please suggest a solution. Regards, Sandipan (1 Reply)
Discussion started by: Sandipan
1 Replies

5. Solaris

mail with attachments

I want to send a mail with three attachments, but nothing happened. I tried it with mail and mailx. Are there special options for these commands or is it not possible to send mails under Solaris with attachments? Must there be special adjustments in the environment? Can anyone give an... (6 Replies)
Discussion started by: ninjadan
6 Replies

6. AIX

Send mail attachments and have a mail body

Hi, How can I send mail attachments from shell script (AIX) and have a mail body as well ? Thanks in advance. (1 Reply)
Discussion started by: shibajighosh
1 Replies

7. UNIX for Dummies Questions & Answers

sending attachments in mail

Hi , i have tried the following command to send an email with an attachment its working fine but i am getting mail with the embeded content inside the mail that too truncated. i wanted it as an attachment. /usr/lib/sendmail -F "MAC SIA" address "rajendra@abc.com.sg" -t <... (6 Replies)
Discussion started by: rajendragora
6 Replies

8. UNIX for Dummies Questions & Answers

Can you e-mail files as attachments from unix to windows?

Another question if you guys don't mind, if you do this: cat * |mailx -s xxxxx <email> it will send files to a email address displayed as sdout, is there a quick way to send files to a e-mail address but as a attachement? Say if I renamed files to .xls on unix, and sent them to a e-mail... (4 Replies)
Discussion started by: nj78
4 Replies

9. UNIX for Dummies Questions & Answers

file name got cut when using mail attachments

I am using the following command to send a zip file as an attachment to my internet email-id. uuencode ABC_DEFG_HIJ.zip ABC_DEFG_HIJ.zip | mail -s "attachment from shell" pal@yahoo.com Eventhough i have given the attached file as 'ABC_DEFG_HIJ.zip', when i receive the mail in my internet... (3 Replies)
Discussion started by: Pal
3 Replies

10. UNIX for Dummies Questions & Answers

mail attachments

I'm writing scripts on HP-UX. Is there a way to attach a file to a mail message. I don't want to imbed the data in the mail message. (1 Reply)
Discussion started by: Multithreaded
1 Replies
Login or Register to Ask a Question