Changed the smtphost preference to be identity based instead of global.
This commit is contained in:
Родитель
84bfaebbed
Коммит
ae858d3d61
|
@ -74,10 +74,6 @@ public class Main {
|
|||
props.put("mail.directory", prefs.getString("mail.directory", ""));
|
||||
System.out.println(props.get("mail.directory"));
|
||||
|
||||
// JavaMail's smtp-transport needs to know where it has to deliver it's e-mails.
|
||||
// I'm not sure this belongs here, but for now, it works.
|
||||
props.put("mail.host", prefs.getString("mail.smtp.host", "localhost"));
|
||||
|
||||
Session session = Session.getDefaultInstance(props, new DialogAuthenticator());
|
||||
System.out.println(session);
|
||||
BerkeleyStore store = new BerkeleyStore(session);
|
||||
|
|
|
@ -534,7 +534,10 @@ public class CompositionPanel extends GeneralPanel {
|
|||
}
|
||||
|
||||
try {
|
||||
mSession.getTransport("smtp").send(msg); // send the message.
|
||||
Properties props = mSession.getProperties();
|
||||
props.put("mail.host", prefs.getString("mail.identity-" + ident + ".smtphost", "localhost"));
|
||||
Session newSession = Session.getInstance(props,null);
|
||||
newSession.getTransport("smtp").send(msg); // send the message.
|
||||
} catch (MessagingException exc) {
|
||||
exc.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class Prefs {
|
|||
//static final String kPopPassword = "pop.password";
|
||||
static final String kPopLeaveOnServer = "pop.leaveMailOnServer";
|
||||
static final String kMailDirectory = "mail.directory";
|
||||
static final String kSMTPHost = "mail.smtp.host";
|
||||
static final String kSMTPHost = "mail.identity-0.smtphost";
|
||||
static final String kStoreList = "mail.storelist";
|
||||
|
||||
static final String kLocalProtocol = "berkeley";
|
||||
|
|
Загрузка…
Ссылка в новой задаче