1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

make it possible to define Providers that don't require

username+password auth
This commit is contained in:
Jesse Vincent 2011-02-07 22:07:31 -05:00
parent 028d07e59d
commit 2aee63e242

View File

@ -205,15 +205,25 @@ public class AccountSetupBasics extends K9Activity
null, null); null, null);
String outgoingUsername = mProvider.outgoingUsernameTemplate; String outgoingUsername = mProvider.outgoingUsernameTemplate;
URI outgoingUriTemplate = mProvider.outgoingUriTemplate;
if (outgoingUsername != null) {
outgoingUsername = outgoingUsername.replaceAll("\\$email", email); outgoingUsername = outgoingUsername.replaceAll("\\$email", email);
outgoingUsername = outgoingUsername.replaceAll("\\$user", userEnc); outgoingUsername = outgoingUsername.replaceAll("\\$user", userEnc);
outgoingUsername = outgoingUsername.replaceAll("\\$domain", domain); outgoingUsername = outgoingUsername.replaceAll("\\$domain", domain);
URI outgoingUriTemplate = mProvider.outgoingUriTemplate;
outgoingUri = new URI(outgoingUriTemplate.getScheme(), outgoingUsername + ":" outgoingUri = new URI(outgoingUriTemplate.getScheme(), outgoingUsername + ":"
+ passwordEnc, outgoingUriTemplate.getHost(), outgoingUriTemplate.getPort(), null, + passwordEnc, outgoingUriTemplate.getHost(), outgoingUriTemplate.getPort(), null,
null, null); null, null);
} else {
outgoingUri = new URI(outgoingUriTemplate.getScheme(),
null, outgoingUriTemplate.getHost(), outgoingUriTemplate.getPort(), null,
null, null);
}
mAccount = Preferences.getPreferences(this).newAccount(); mAccount = Preferences.getPreferences(this).newAccount();
mAccount.setName(getOwnerName()); mAccount.setName(getOwnerName());
mAccount.setEmail(email); mAccount.setEmail(email);