Added provider xs4all

This commit is contained in:
M66B 2019-11-06 12:48:12 +01:00
parent 0ddec7ed46
commit 7d46638217
4 changed files with 23 additions and 3 deletions

View File

@ -58,10 +58,11 @@ import java.util.concurrent.Future;
public class EmailProvider {
public String name;
public List<String> domain;
public String link;
public int order;
public String type;
public int keepalive;
public boolean useip;
public String link;
public Server imap = new Server();
public Server smtp = new Server();
public UserType user = UserType.EMAIL;
@ -104,11 +105,12 @@ public class EmailProvider {
else if ("provider".equals(name)) {
provider = new EmailProvider();
provider.name = xml.getAttributeValue(null, "name");
provider.order = xml.getAttributeIntValue(null, "order", Integer.MAX_VALUE);
provider.keepalive = xml.getAttributeIntValue(null, "keepalive", 0);
String domain = xml.getAttributeValue(null, "domain");
if (domain != null)
provider.domain = Arrays.asList(domain.split(","));
provider.order = xml.getAttributeIntValue(null, "order", Integer.MAX_VALUE);
provider.keepalive = xml.getAttributeIntValue(null, "keepalive", 0);
provider.useip = xml.getAttributeBooleanValue(null, "useip", true);
provider.link = xml.getAttributeValue(null, "link");
provider.type = xml.getAttributeValue(null, "type");
String user = xml.getAttributeValue(null, "user");

View File

@ -242,6 +242,7 @@ public class FragmentIdentity extends FragmentBase {
etHost.setText(provider.smtp.host);
etPort.setText(Integer.toString(provider.smtp.port));
rgEncryption.check(provider.smtp.starttls ? R.id.radio_starttls : R.id.radio_ssl);
cbUseIp.setChecked(provider.useip);
break;
}
@ -357,6 +358,7 @@ public class FragmentIdentity extends FragmentBase {
etHost.setText(provider.smtp.host);
etPort.setText(position == 0 ? null : Integer.toString(provider.smtp.port));
rgEncryption.check(provider.smtp.starttls ? R.id.radio_starttls : R.id.radio_ssl);
cbUseIp.setChecked(provider.useip);
}
@Override
@ -470,6 +472,7 @@ public class FragmentIdentity extends FragmentBase {
etHost.setText(provider.smtp.host);
etPort.setText(Integer.toString(provider.smtp.port));
rgEncryption.check(provider.smtp.starttls ? R.id.radio_starttls : R.id.radio_ssl);
cbUseIp.setChecked(provider.useip);
}
@Override

View File

@ -268,6 +268,7 @@ public class FragmentQuickSetup extends FragmentBase {
String iprotocol = provider.smtp.starttls ? "smtp" : "smtps";
try (MailService iservice = new MailService(context, iprotocol, null, false, true, true)) {
iservice.setUseIp(provider.useip);
iservice.connect(provider.smtp.host, provider.smtp.port, MailService.AUTH_TYPE_PASSWORD, user, password);
}
@ -333,6 +334,7 @@ public class FragmentQuickSetup extends FragmentBase {
identity.auth_type = MailService.AUTH_TYPE_PASSWORD;
identity.user = user;
identity.password = password;
identity.use_ip = provider.useip;
identity.synchronize = true;
identity.primary = true;

View File

@ -372,4 +372,17 @@
port="587"
starttls="true" />
</provider>
<provider
name="XS4ALL"
link="https://www.xs4all.nl/service/diensten/email/installeren/e-mailinstellingen.htm"
useip="false">
<imap
host="imap.xs4all.nl"
port="993"
starttls="false" />
<smtp
host="smtp.xs4all.nl"
port="465"
starttls="false" />
</provider>
</providers>