Fixes #12161
Reported-by: Michael Tremer michael.tremer@ipfire.org Signed-off-by: Peter Müller peter.mueller@ipfire.org --- html/cgi-bin/mail.cgi | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/html/cgi-bin/mail.cgi b/html/cgi-bin/mail.cgi index 25589046e..8c1b2d4e4 100755 --- a/html/cgi-bin/mail.cgi +++ b/html/cgi-bin/mail.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2015 IPFire Team alexander.marx@ipfire.org # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -110,8 +110,8 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ #SaveButton on configsite
$dma{'SMARTHOST'} = $cgiparams{'txt_mailserver'}; $dma{'PORT'} = $cgiparams{'txt_mailport'}; - $dma{'STARTTLS'} = '' if ($cgiparams{'mail_tls'}); - $dma{'SECURETRANSFER'} = '' if exists $dma{'STARTTLS'}; + $dma{'STARTTLS'} = '' if ($cgiparams{'mail_tls'}{'explicit'}); + $dma{'SECURETRANS'} = '' if ($cgiparams{'mail_tls'}{'explicit'} || $cgiparams{'mail_tls'}{'implicit'}); $dma{'SPOOLDIR'} = "/var/spool/dma"; $dma{'FULLBOUNCE'} = ''; $dma{'MAILNAME'} = "$mainsettings{'HOSTNAME'}.$mainsettings{DOMAINNAME}"; @@ -140,8 +140,6 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'email testmail'}"){ #Testmail button on
#FUNCTIONS sub configsite{ - - #If update set fieldvalues new if($cgiparams{'update'} eq 'on'){ $mail{'USEMAIL'} = 'on'; @@ -156,7 +154,9 @@ sub configsite{ } #find preselections $checked{'usemail'}{$mail{'USEMAIL'}} = 'CHECKED'; - $checked{'mail_tls'}{'on'} = 'CHECKED' if exists $dma{'STARTTLS'}; + $selected{'mail_tls'}{'explicit'} = 'selected' if exists $dma{'STARTTLS'}; + $selected{'mail_tls'}{'implicit'} = 'selected' if exists $dma{'SECURETRANS'} and not $dma{'STARTTLS'}; + $selected{'mail_tls'}{'disabled'} = 'selected' if not exists ($dma{'SECURETRANS'} and $dma{'STARTTLS'}); #Open site &Header::openpage($Lang::tr{'email settings'}, 1, ''); @@ -226,7 +226,13 @@ END </tr> <tr> <td>$Lang::tr{'email tls'}</td> - <td><input type='checkbox' name='mail_tls' $checked{'mail_tls'}{'on'}></td> + <td> + <select name='mail_tls'> + <option value='implicit' $selected{'mail_tls'}{'implicit'}>$Lang::tr{'email tls implicit'}</option> + <option value='explicit' $selected{'mail_tls'}{'explicit'}>$Lang::tr{'email tls explicit'}</option> + <option value='disabled' $selected{'mail_tls'}{'disabled'}>$Lang::tr{'disabled'}</option> + </select> + </td> </tr> END if (! -z $dmafile && $mail{'USEMAIL'} eq 'on' && !$errormessage){
Signed-off-by: Peter Müller peter.mueller@ipfire.org --- langs/de/cgi-bin/de.pl | 6 ++++-- langs/en/cgi-bin/en.pl | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 80579e7cc..2ef7b673b 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -933,8 +933,10 @@ 'email subject' => 'IPFire Test-E-Mail', 'email success' => 'Test-E-Mail erfolgreich versendet', 'email testmail' => 'Testnachricht senden', -'email text' => 'Testnachricht vom IPFire Mailversand.', -'email tls' => 'TLS aktivieren', +'email text' => 'Testnachricht vom IPFire-Mailversandsystem.', +'email tls' => 'Transportverschlüsselungsmodus', +'email tls explicit' => 'explizit (STARTTLS)', +'email tls implicit' => 'implizit (TLS)', 'email usemail' => 'Mailversand aktivieren', 'emailreportlevel' => 'E-Mail-Reportlevel', 'empty' => 'Dieses Feld kann leer bleiben', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1f81108f1..24790d689 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -975,7 +975,9 @@ 'email success' => 'Test message successfully sent', 'email testmail' => 'Send test mail', 'email text' => 'Test mail from IPFire Mail Service', -'email tls' => 'Use TLS', +'email tls' => 'TLS mode', +'email tls explicit' => 'explicit (STARTTLS)', +'email tls implicit' => 'implicit (TLS)', 'email usemail' => 'Activate Mail Service', 'emailreportlevel' => 'E-mailreportlevel', 'emerging pro rules' => 'Emergingthreats.net Pro Rules',
Hi,
Unfortunately this does not execute. I cannot even load the page without submitting the form:
I have this in my errors log file:
exists argument is not a HASH or ARRAY element or a subroutine at /srv/web/ipfire/cgi-bin/mail.cgi line 159. [Mon Feb 03 15:49:48.783276 2020] [cgid:error] [pid 5562:tid 128451449181952] [client 192.168.190.117:61657] End of script output before headers: mail.cgi, referer: https://192.168.190.1:444/
Best, -Michael
On 31 Jan 2020, at 16:31, Peter Müller peter.mueller@ipfire.org wrote:
Fixes #12161
Reported-by: Michael Tremer michael.tremer@ipfire.org Signed-off-by: Peter Müller peter.mueller@ipfire.org
html/cgi-bin/mail.cgi | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/html/cgi-bin/mail.cgi b/html/cgi-bin/mail.cgi index 25589046e..8c1b2d4e4 100755 --- a/html/cgi-bin/mail.cgi +++ b/html/cgi-bin/mail.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2015 IPFire Team alexander.marx@ipfire.org # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -110,8 +110,8 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ #SaveButton on configsite
$dma{'SMARTHOST'} = $cgiparams{'txt_mailserver'}; $dma{'PORT'} = $cgiparams{'txt_mailport'};
$dma{'STARTTLS'} = '' if ($cgiparams{'mail_tls'});
$dma{'SECURETRANSFER'} = '' if exists $dma{'STARTTLS'};
$dma{'STARTTLS'} = '' if ($cgiparams{'mail_tls'}{'explicit'});
$dma{'SPOOLDIR'} = "/var/spool/dma"; $dma{'FULLBOUNCE'} = ''; $dma{'MAILNAME'} = "$mainsettings{'HOSTNAME'}.$mainsettings{DOMAINNAME}";$dma{'SECURETRANS'} = '' if ($cgiparams{'mail_tls'}{'explicit'} || $cgiparams{'mail_tls'}{'implicit'});
@@ -140,8 +140,6 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'email testmail'}"){ #Testmail button on
#FUNCTIONS sub configsite{
- #If update set fieldvalues new if($cgiparams{'update'} eq 'on'){ $mail{'USEMAIL'} = 'on';
@@ -156,7 +154,9 @@ sub configsite{ } #find preselections $checked{'usemail'}{$mail{'USEMAIL'}} = 'CHECKED';
- $checked{'mail_tls'}{'on'} = 'CHECKED' if exists $dma{'STARTTLS'};
$selected{'mail_tls'}{'explicit'} = 'selected' if exists $dma{'STARTTLS'};
$selected{'mail_tls'}{'implicit'} = 'selected' if exists $dma{'SECURETRANS'} and not $dma{'STARTTLS'};
$selected{'mail_tls'}{'disabled'} = 'selected' if not exists ($dma{'SECURETRANS'} and $dma{'STARTTLS'});
#Open site &Header::openpage($Lang::tr{'email settings'}, 1, '');
@@ -226,7 +226,13 @@ END </tr> <tr> <td>$Lang::tr{'email tls'}</td>
<td><input type='checkbox' name='mail_tls' $checked{'mail_tls'}{'on'}></td>
<td>
<select name='mail_tls'>
<option value='implicit' $selected{'mail_tls'}{'implicit'}>$Lang::tr{'email tls implicit'}</option>
<option value='explicit' $selected{'mail_tls'}{'explicit'}>$Lang::tr{'email tls explicit'}</option>
<option value='disabled' $selected{'mail_tls'}{'disabled'}>$Lang::tr{'disabled'}</option>
</select>
</td>
</tr>
END if (! -z $dmafile && $mail{'USEMAIL'} eq 'on' && !$errormessage){ -- 2.16.4
Hello Michael,
thanks for your reply.
That's funny, I am able to reproduce this on a fresh installation, although it works fine on my testing machine. Will come back with a second version of this patchset... :-/
Thanks, and best regards, Peter Müller
Hi,
Unfortunately this does not execute. I cannot even load the page without submitting the form:
I have this in my errors log file:
exists argument is not a HASH or ARRAY element or a subroutine at /srv/web/ipfire/cgi-bin/mail.cgi line 159. [Mon Feb 03 15:49:48.783276 2020] [cgid:error] [pid 5562:tid 128451449181952] [client 192.168.190.117:61657] End of script output before headers: mail.cgi, referer: https://192.168.190.1:444/
Best, -Michael
On 31 Jan 2020, at 16:31, Peter Müller peter.mueller@ipfire.org wrote:
Fixes #12161
Reported-by: Michael Tremer michael.tremer@ipfire.org Signed-off-by: Peter Müller peter.mueller@ipfire.org
html/cgi-bin/mail.cgi | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/html/cgi-bin/mail.cgi b/html/cgi-bin/mail.cgi index 25589046e..8c1b2d4e4 100755 --- a/html/cgi-bin/mail.cgi +++ b/html/cgi-bin/mail.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2015 IPFire Team alexander.marx@ipfire.org # +# Copyright (C) 2007-2020 IPFire Team info@ipfire.org # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -110,8 +110,8 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ #SaveButton on configsite
$dma{'SMARTHOST'} = $cgiparams{'txt_mailserver'}; $dma{'PORT'} = $cgiparams{'txt_mailport'};
$dma{'STARTTLS'} = '' if ($cgiparams{'mail_tls'});
$dma{'SECURETRANSFER'} = '' if exists $dma{'STARTTLS'};
$dma{'STARTTLS'} = '' if ($cgiparams{'mail_tls'}{'explicit'});
$dma{'SPOOLDIR'} = "/var/spool/dma"; $dma{'FULLBOUNCE'} = ''; $dma{'MAILNAME'} = "$mainsettings{'HOSTNAME'}.$mainsettings{DOMAINNAME}";$dma{'SECURETRANS'} = '' if ($cgiparams{'mail_tls'}{'explicit'} || $cgiparams{'mail_tls'}{'implicit'});
@@ -140,8 +140,6 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'email testmail'}"){ #Testmail button on
#FUNCTIONS sub configsite{
- #If update set fieldvalues new if($cgiparams{'update'} eq 'on'){ $mail{'USEMAIL'} = 'on';
@@ -156,7 +154,9 @@ sub configsite{ } #find preselections $checked{'usemail'}{$mail{'USEMAIL'}} = 'CHECKED';
- $checked{'mail_tls'}{'on'} = 'CHECKED' if exists $dma{'STARTTLS'};
$selected{'mail_tls'}{'explicit'} = 'selected' if exists $dma{'STARTTLS'};
$selected{'mail_tls'}{'implicit'} = 'selected' if exists $dma{'SECURETRANS'} and not $dma{'STARTTLS'};
$selected{'mail_tls'}{'disabled'} = 'selected' if not exists ($dma{'SECURETRANS'} and $dma{'STARTTLS'});
#Open site &Header::openpage($Lang::tr{'email settings'}, 1, '');
@@ -226,7 +226,13 @@ END </tr> <tr> <td>$Lang::tr{'email tls'}</td>
<td><input type='checkbox' name='mail_tls' $checked{'mail_tls'}{'on'}></td>
<td>
<select name='mail_tls'>
<option value='implicit' $selected{'mail_tls'}{'implicit'}>$Lang::tr{'email tls implicit'}</option>
<option value='explicit' $selected{'mail_tls'}{'explicit'}>$Lang::tr{'email tls explicit'}</option>
<option value='disabled' $selected{'mail_tls'}{'disabled'}>$Lang::tr{'disabled'}</option>
</select>
</td>
</tr>
END if (! -z $dmafile && $mail{'USEMAIL'} eq 'on' && !$errormessage){ -- 2.16.4