You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am adding this just for the future reference, so that folks that run into this problem like I did, know what to do, without losing a few hours of their life :)
After working properly for months, our script stopped fetching emails. The error we started getting was the above one, "imap_fetchheader(): Bad message number". After spending a few hours looking back and forth through the code, and laravel-imap library, I finally tried one stupid thing, and it worked. I hope it works for you too.
The exception was happening in the Query class.. This is the code in question, that was presenting with this issue:
Hi @todorowww ,
thanks for your post! You could also set the message_key inside the config file :) Depending on the given "server features" you can choose between id, number and list.
Message key identifier option:
You can choose between 'id', 'number' or 'list'
'id' - Use the MessageID as array key (default, might cause hickups with yahoo mail)
'number' - Use the message number as array key (isn't always unique and can cause some interesting behavior)
'list' - Use the message list number as array key (incrementing integer (does not always start at 0 or 1)
Update: I've added a link to this issue inside the readme.md
I am adding this just for the future reference, so that folks that run into this problem like I did, know what to do, without losing a few hours of their life :)
After working properly for months, our script stopped fetching emails. The error we started getting was the above one, "imap_fetchheader(): Bad message number". After spending a few hours looking back and forth through the code, and laravel-imap library, I finally tried one stupid thing, and it worked. I hope it works for you too.
The exception was happening in the Query class.. This is the code in question, that was presenting with this issue:
Adding imap.option "message_key", and setting it to "number", resolved the issue.
Et voilà, works like a charm, emails started being processed again.
I tested this with the latest laravel-imap version, 1.4.2, running on:
Linux, Server - PHP 7.1.3
Virual Box, Linux - PHP 7.2.19
The text was updated successfully, but these errors were encountered: