Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imap_fetch_overview options #487

Open
michal-rumpel opened this issue Dec 14, 2020 · 5 comments
Open

imap_fetch_overview options #487

michal-rumpel opened this issue Dec 14, 2020 · 5 comments

Comments

@michal-rumpel
Copy link

Hi,

I would welcome if the Mailbox::getMessageSequence() method had another parameter (optional) that I could use to set the third parameter ($options) of the imap_fetch_overview() method.

I only need to select a certain sequence of emails from a large number of emails in the folder.

It is currently not possible to view emails without knowing their id :(

$overview = \imap_fetch_overview($this->resource->getStream(), $sequence, \FT_UID);

many thanks

M

@Slamdunk
Copy link
Collaborator

I'm sorry may you give us an example of sequence that you'd like to search for, that you cannot use right now?

@michal-rumpel
Copy link
Author

I'm sorry may you give us an example of sequence that you'd like to search for, that you cannot use right now?

Hi,
I need something like this

$overview = \imap_fetch_overview($this->resource->getStream(), $sequence, 0);
where $sequence (example "1:100") in this case means selection according to the order of the emails (I don't know uid emails)

So method Mailbox::getMessageSequence() will have another optional parameter.
public function getMessageSequence(string $sequence, int $options = \FT_UID): MessageIteratorInterface

in my case, the method call will look like this
$mailbox->getMessageSequence("1:100", 0)

see spec. https://www.php.net/manual/en/function.imap-fetch-overview.php

many thanks

@Slamdunk
Copy link
Collaborator

After digging further, it seems to me that our implementation of imap_fetch_overview is useless, since we are throwing away the brief summary it returns to call imap_fetchstructure on every message of it.

I think we should do a BC break and introduce a MessageOverview to benefit from imap_fetch_overview call, and in the same time allow different signatures of getMessageSequence altogether.

@Slamdunk Slamdunk added this to the 2.0 milestone Dec 16, 2020
@michal-rumpel
Copy link
Author

Can I ask for an estimate of when the change will be ready? Thanks

@Slamdunk
Copy link
Collaborator

It depends on two factors:

  1. How much time you can invest on coding it and pushing a PR
  2. How much money you can invest on me doing it for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants