imap
imap copied to clipboard
Parser for eml files?
Is it possible to use Your library as parser of eml files? Now I'm using https://github.com/php-mime-mail-parser/php-mime-mail-parser
But it would be great to use only one library.
Theoretically yes, an EML file can be treated like an EmbeddedMessage.
Would you be so kind to create PR containing a proof-of-concept?
I think It's not possible right now. EmbeddedMessage
extends AbstractPart
at the end which needs Imap resource as constructor param. All interesting methods are in AbstractPart
class (as I think).
You are right, I was referring that there is only one raw imap call in the whole EmbeddedMessage logic to serve the BasicMessageInterface API, and that call is easily overwritable to work with an EML file.
So it's not possible to use those methods without IMAP resource? Are You planning to adjust Your lib to use eml parser?
It is possible, and I think pretty straightforward, to get what you ask.
Not soon though. I'll tag it in 1.2 milestone.
Would be great.
Whe do You expect deliver it??
I don't know yet, I have personal issues that keep me off coding.
maybe a timeframe? I need to publish my project by the end of the year so by 15th I need to start testing. Will it be ready within 2 weeks??
This is a free and open source software developed for free and maintained in our spare time, we can't guarantee any timeframe, so we don't give them.
I understad - I'll use different parser :/
Any news on that?
Not yet
Is it actual? Do you need some help with PR?
I'd like to be honest: I'm not working on this and I haven't even planned to.
Any PR is welcome: I think it should be easy to get a parser that returns a BasicMessageInterface
implementation for a generic message.
Tests are mandatory: start the basic feature against tests/fixtures/plain_only.eml
and submit a PR, after discussing the general approach a more comprehensive data set can be tested too.
Ok. Lets discuss an implementation of this feature. I see it, as a separate class, maybe EmlParser with method parseEml() that have one param - path to eml object and returns instance of new class - ParsedMessage (implements BasicMessageInterface)
Right?
Another idea: are you realy want to get own implementation of eml parser, maybe better will be integration of https://github.com/php-mime-mail-parser/php-mime-mail-parser to get BasicMessageInterface object?
WDYT?
https://github.com/php-mime-mail-parser/php-mime-mail-parser is a front-end for the Mailparse extension.
I think it would be good to use that extension too.
A less pretty but still valid idea is to provide an EML parser that just parses the headers with imap_rfc822_parse_headers function, leaving the raw body. This wouldn't require any other third-party library/extension.