Skip to content

Commit d15cc45

Browse files
authored
Merge branch 'master' into Cypht-delay-send-later-scheduled-sending
2 parents a2d23b3 + 7984a58 commit d15cc45

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

modules/core/handler_modules.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,21 @@ public function process() {
10701070
'srv_setup_stepper_smtp_server_id' => $smtpServerId
10711071
] = $form;
10721072

1073+
/*
1074+
* Connect to SMTP server if user wants to send emails
1075+
*/
1076+
if($isSender){
1077+
if (!$this->module_is_supported('smtp')) {
1078+
Hm_Msgs::add("SMTP module is not enabled",'danger');
1079+
return;
1080+
}
1081+
$this->smtp_server_id = connect_to_smtp_server($smtpAddress, $profileName, $smtpPort, $email, $password, $smtpTls, 'smtp', $smtpServerId);
1082+
if(!isset($this->smtp_server_id)){
1083+
Hm_Msgs::add("Could not save server", 'danger');
1084+
return;
1085+
}
1086+
}
1087+
10731088
/*
10741089
* When JMAP selected only configure JMAP
10751090
*/
@@ -1169,6 +1184,15 @@ public function process() {
11691184
$this->out('just_saved_credentials', true);
11701185
Hm_Msgs::add("Server saved");
11711186
}
1187+
1188+
if ($createProfile && $this->smtp_server_id && ($this->imap_server_id || $this->jmap_server_id)) {
1189+
if (!$this->module_is_supported('profiles')) {
1190+
Hm_Msgs::add("Profiles module is not enabled", "danger");
1191+
return;
1192+
}
1193+
1194+
add_profile($profileName, $profileSignature, $profileReplyTo, $profileIsDefault, $email, $imapAddress, $email, $this->smtp_server_id, $this->imap_server_id ?? $this->jmap_server_id, $this);
1195+
}
11721196
}
11731197
}
11741198
}

0 commit comments

Comments
 (0)