Hi,
I'm trying to write a script that can read an RFC882 formatted file. Be it as an attachment as part of another email or a static file and was wondering if anyone has had any experience or can point me in the right direction?
Cheers
RFC822/.eml attachments
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: RFC822/.eml attachments
Have you read RFC 2822, 2045 and 2046? They'll give you a lot of help if you try to convert the ABNF into regex. What specifically do you need to parse out? The possibilities are endless if you want to parse anything and everything.mchaggis wrote:Hi,
I'm trying to write a script that can read an RFC882 formatted file. Be it as an attachment as part of another email or a static file and was wondering if anyone has had any experience or can point me in the right direction?
Cheers
EDIT | I should mention I'm releasing a library soon which will parse RFC 2822 compliant messages into Swift message objects.
Re: RFC822/.eml attachments
I would like to parse them in the same way I would a normal email message. Basically, I want to be able to extract attachments contained with in and also display the text/html portions of the message.
Once I can do that, I can do everything I will need to do with the content of the message.
I have seen some people suggest that extract the RFC822 attachment and then using the PHP imap functions append it to a mailbox and then read it as if it was a normal message. However, this does not solve the processing of a file and it throws extract complications in that I would have to choose a folder to put it in, or generate a temp folder, but this may cause additional issues.
Cheers
Once I can do that, I can do everything I will need to do with the content of the message.
I have seen some people suggest that extract the RFC822 attachment and then using the PHP imap functions append it to a mailbox and then read it as if it was a normal message. However, this does not solve the processing of a file and it throws extract complications in that I would have to choose a folder to put it in, or generate a temp folder, but this may cause additional issues.
Cheers