Enough-Software / enough_mail

IMAP, POP3 and SMTP clients for Dart developers. Contains both low level as well as a high level API.
Mozilla Public License 2.0
105 stars 55 forks source link

pls support imap id extension some imap server need this to identify #168

Closed inits closed 3 years ago

inits commented 3 years ago

this is sample code

from imapclient import IMAPClient

server = IMAPClient("imap.163.com", ssl=True, port=993)
server.login("<user>", "<passwd>")

server.id_({"name": "IMAPClient", "version": "2.1.0"})

messages = server.select_folder('INBOX')

https://www.ietf.org/rfc/rfc2971.txt

robert-virkus commented 3 years ago

Can you name any servers that need clients to identify?

inits commented 3 years ago

Can you name any servers that need clients to identify?

https://mail.163.com/ this email server need this

robert-virkus commented 3 years ago

This is now implemented but not yet released.

Lowlevel example:

if (imapClient.serverInfo.supportsId) {
   final clientId = Id(name: 'my app', version: '1.0');
   final serverId = await imapClient.id(clientId: clientId);
   print(serverId);
}

Highlevel example:

final clientId = Id(name: 'my app', version: '1.0');
final mailClient = MailClient(account, clientId: clientId);
// MailClient will now automatically send the client ID to ID-enabled mail services. 
await mailClient.connect();
// Access the server ID with mailClient.serverId after connecting:
print(mailClient.serverId);