thunderbird-android
thunderbird-android copied to clipboard
Add support for ID command to support 163.com
Is your feature request related to a problem? Please describe. I got rejected receiving mails using imap. I was trying to log in to 163 email server when this happens.
Describe the solution you'd like I was told that the email client app should return its identity to allow connecting to the email server.
The developer of that email server provides the following code:
Properties props = new Properties();
props.setProperty("mail.store.protocol", "imap");
props.setProperty("mail.imap.host", "imap.163.com");
props.setProperty("mail.imap.port", "143");
HashMap IAM = new HashMap();
//IMAP ID: key, value pair. E.g. name,version,vendor,support-email
IAM.put("name","myname");
IAM.put("version","1.0.0");
IAM.put("vendor","myclient");
IAM.put("support-email","[email protected]");
Session session = Session.getInstance(props);
IMAPStore store = (IMAPStore) session.getStore("imap");
//user account and password
store.connect("[email protected]", "password");
store.id(IAM);
The developer provides the following link to explain context: https://javaee.github.io/javamail/docs/api/index.html?com/sun/mail/imap/IMAPStore.html
Could you evaluate if this situation is a valid case to make it more secure/compatible with imap server?
This code can be used to fool 163 before k9 supports the id command,
com.fsck.k9.mail.store.imap.RealImapConnection#open
if (hasCapability("ID")) {
executeSimpleCommand("ID (\"name\" \"k-9\" \"version\" \"6.000\")");
}
@AoEiuV020 Could you please make a PR for this? I think it's helpful since a large number of people use 163 mails in China.
The custom option of FairEmail supports 163.com.Although FairEmail is not listed in the support list, the custom option is available after adding 163.com.Can it be used as a reference?