imap_tools
imap_tools copied to clipboard
Performance Improvement for fetching results.
Emails often come with a ton of headers, but most users only care about a few key ones like from
, to
, or subject
. While our current code includes a headers_only
option, it doesn't let users specify exactly which headers they want to see.
Here's the good news: IMAP servers can provide much faster, more efficient responses if they're told upfront which headers you're interested in. By allowing users to supply a specific list of headers, we can reduce unnecessary data fetching and speed up the process! No longer will the code spend a long time parsing headers that aren't relevant to the user.
Of course, this will mean some changes to the API. Instead of fetching all headers, users will be able to supply the message_parts
directly in the FETCH
command. It will also require adjustments to how we handle the server's response, as the current code assumes two elements in the response.
Would it be possible to update the API to allow users to provide a list of headers or other message attributes they care about?
This could significantly enhance performance and user experience.