You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Patrick Han <pa...@sensestream.com> on 2002/07/09 18:28:26 UTC

How to Extract Attachment from an Incoming Mail

Dear all,

I am new to JAMES and this mailing list.  Please excuse me if I ask silly questions. :)

I am currently developing a mailet that should intercept with an incoming mail and save the attachment (This will always be an image, mostly in .jpg) to a local directory residing on the mail server.  However, I have gone through the JAMES and Mailet API and found various methods to extract almost all parameters of a mail but the actual email attachment!

I have also searched all over the Web to look for related topic but most of the searching result I got is related to how to send attachment via email, not to extract attachment from an email.

Does anyone has any clue on how I can proceed with this task?  Thanks in advance!

Pat

Re: How to Extract Attachment from an Incoming Mail

Posted by Sam Kirkpatrick <sa...@waterglenweb.com>.
Attached is some sample code you could use as a starting point.  It is a watered-down version of a mailet I am using to do something
similar.  It doesn't do anything useful as is, but you should be able to adapt it for your needs.

I intend to contribute a more functional version at some point in the future, but alas my current mailet is not generic enough to
share yet.

Sam


----- Original Message -----
From: "Patrick Han" <pa...@sensestream.com>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, July 09, 2002 10:28 AM
Subject: How to Extract Attachment from an Incoming Mail


Dear all,

I am new to JAMES and this mailing list.  Please excuse me if I ask silly questions. :)

I am currently developing a mailet that should intercept with an incoming mail and save the attachment (This will always be an
image, mostly in .jpg) to a local directory residing on the mail server.  However, I have gone through the JAMES and Mailet API and
found various methods to extract almost all parameters of a mail but the actual email attachment!

I have also searched all over the Web to look for related topic but most of the searching result I got is related to how to send
attachment via email, not to extract attachment from an email.

Does anyone has any clue on how I can proceed with this task?  Thanks in advance!

Pat


RE: How to Extract Attachment from an Incoming Mail

Posted by Danny Angus <da...@apache.org>.
check out
javax.mail.internet.MimeMessage
and
javax.mail.internet.MimeMultipart
look for examples of their use in James
Mail with att.s is MimeMultipart and the disposition of an attachment part
is "attachment" cf "inline"
d.

> -----Original Message-----
> From: Patrick Han [mailto:patrick.han@sensestream.com]
> Sent: 09 July 2002 17:28
> To: james-dev@jakarta.apache.org
> Subject: How to Extract Attachment from an Incoming Mail
>
>
> Dear all,
>
> I am new to JAMES and this mailing list.  Please excuse me if I
> ask silly questions. :)
>
> I am currently developing a mailet that should intercept with an
> incoming mail and save the attachment (This will always be an
> image, mostly in .jpg) to a local directory residing on the mail
> server.  However, I have gone through the JAMES and Mailet API
> and found various methods to extract almost all parameters of a
> mail but the actual email attachment!
>
> I have also searched all over the Web to look for related topic
> but most of the searching result I got is related to how to send
> attachment via email, not to extract attachment from an email.
>
> Does anyone has any clue on how I can proceed with this task?
> Thanks in advance!
>
> Pat
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>