Skip to content

Commit a7f96ca

Browse files
author
Marius Cramer
committed
Merge branch 'custom_tranport_fix' into 'master'
Custom tranport fix See merge request !121
2 parents a9e6315 + f63b730 commit a7f96ca

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

interface/web/mail/mail_transport_edit.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,22 @@ function onShowNew() {
7070
function onShowEnd() {
7171
global $app, $conf;
7272

73+
$types = array('smtp' => 'smtp', 'uucp' => 'uucp', 'slow' => 'slow', 'error' => 'error', 'custom' => 'custom', '' => 'null');
7374
$tmp_parts = explode(":", $this->dataRecord["transport"]);
7475
if(!empty($this->id) && !stristr($this->dataRecord["transport"], ':')) {
7576
$rec["type"] = 'custom';
7677
} else {
7778
if(empty($this->id) && empty($tmp_parts[0])) {
7879
$rec["type"] = 'smtp';
7980
} else {
80-
$rec["type"] = $tmp_parts[0];
81+
$rec["type"] = $types[$tmp_parts[0]] ? $tmp_parts[0] : 'custom';
8182
}
8283
}
83-
if(!empty($tmp_parts[2])) {
84+
if($rec["type"] == 'custom') {
85+
$dest = $this->dataRecord["transport"];
86+
} elseif(!empty($tmp_parts[2])) {
8487
$dest = @$tmp_parts[1].':'.@$tmp_parts[2];
85-
} elseif(!empty($tmp_parts[1])) {
88+
} elseif(!empty($tmp_parts[1]) || $this->dataRecord["transport"] == ":") {
8689
$dest = $tmp_parts[1];
8790
} else {
8891
$dest = $this->dataRecord["transport"];
@@ -95,7 +98,6 @@ function onShowEnd() {
9598
$rec["destination"] = @$dest;
9699
}
97100

98-
$types = array('smtp' => 'smtp', 'uucp' => 'uucp', 'slow' => 'slow', 'error' => 'error', 'custom' => 'custom', '' => 'null');
99101
$type_select = '';
100102
if(is_array($types)) {
101103
foreach( $types as $key => $val) {

0 commit comments

Comments
 (0)