Skip to content

Commit 6d852dc

Browse files
authored
fix: send id in all imap api (#91)
* fix: send id in all imap api * also include in get_email_count
1 parent da5cefe commit 6d852dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mcp_email_server/emails/classic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ async def get_email_count(
213213

214214
# Login and select inbox
215215
await imap.login(self.email_server.user_name, self.email_server.password)
216+
await _send_imap_id(imap)
216217
await imap.select(_quote_mailbox(mailbox))
217218
search_criteria = self._build_search_criteria(
218219
before, since, subject, from_address=from_address, to_address=to_address
@@ -673,6 +674,7 @@ async def append_to_sent(
673674
await imap._client_task
674675
await imap.wait_hello_from_server()
675676
await imap.login(incoming_server.user_name, incoming_server.password)
677+
await _send_imap_id(imap)
676678

677679
# Try to find and use the Sent folder
678680
for folder in sent_folder_candidates:
@@ -729,6 +731,7 @@ async def delete_emails(self, email_ids: list[str], mailbox: str = "INBOX") -> t
729731
await imap._client_task
730732
await imap.wait_hello_from_server()
731733
await imap.login(self.email_server.user_name, self.email_server.password)
734+
await _send_imap_id(imap)
732735
await imap.select(_quote_mailbox(mailbox))
733736

734737
for email_id in email_ids:

0 commit comments

Comments
 (0)