Skip to content

Commit

Permalink
Fixing mail accounts creation
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Dec 25, 2022
1 parent 5538a7e commit 1017fe2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/org/luwrain/app/mail/Hooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ Map<String, MailAccount> server(String mailAddr)
final Map<String, MailAccount> accounts = new HashMap<>();
final Object
smtp = getMember(res, "smtp"),
pop3 = getMember(res, "pop3");
pop3 = getMember(res, "pop3");
if (!isNull(smtp))
accounts.put("smtp", getAccount(smtp));
if (!isNull(pop3))
if (!isNull(pop3))
accounts.put("pop3", getAccount(pop3));
for(Map.Entry<String, MailAccount> e: accounts.entrySet())
{
e.getValue().setLogin(mailAddr);
e.getValue().setTitle(e.getKey().toUpperCase() + " (" + mailAddr + ")");
}
return accounts;
}

Expand Down Expand Up @@ -111,6 +116,8 @@ static MailAccount getAccount(Object obj)
flags.add(MailAccount.Flags.SSL);
if (tls)
flags.add(MailAccount.Flags.TLS);
flags.add(MailAccount.Flags.ENABLED);
flags.add(MailAccount.Flags.DEFAULT);
account.setFlags(flags);
return account;
}
Expand Down

0 comments on commit 1017fe2

Please sign in to comment.