Merge "Honor the sendmail.smtpUser from gerrit.config on upgrade"
This commit is contained in:
@@ -28,12 +28,14 @@ import com.google.inject.Singleton;
|
|||||||
class InitSendEmail implements InitStep {
|
class InitSendEmail implements InitStep {
|
||||||
private final ConsoleUI ui;
|
private final ConsoleUI ui;
|
||||||
private final Section sendemail;
|
private final Section sendemail;
|
||||||
|
private final SitePaths site;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
InitSendEmail(final ConsoleUI ui, final SitePaths site,
|
InitSendEmail(final ConsoleUI ui, final SitePaths site,
|
||||||
final Section.Factory sections) {
|
final Section.Factory sections) {
|
||||||
this.ui = ui;
|
this.ui = ui;
|
||||||
this.sendemail = sections.get("sendemail");
|
this.sendemail = sections.get("sendemail");
|
||||||
|
this.site = site;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -49,7 +51,9 @@ class InitSendEmail implements InitStep {
|
|||||||
true);
|
true);
|
||||||
|
|
||||||
String username = null;
|
String username = null;
|
||||||
if ((enc != null && enc != Encryption.NONE) || !isLocal(hostname)) {
|
if (site.gerrit_config.exists()) {
|
||||||
|
username = sendemail.get("smtpUser");
|
||||||
|
} else if ((enc != null && enc != Encryption.NONE) || !isLocal(hostname)) {
|
||||||
username = username();
|
username = username();
|
||||||
}
|
}
|
||||||
sendemail.string("SMTP username", "smtpUser", username);
|
sendemail.string("SMTP username", "smtpUser", username);
|
||||||
|
|||||||
Reference in New Issue
Block a user