From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: Re: [PATCH 1/2] mail.cgi: add support for implicit TLS usage Date: Mon, 03 Feb 2020 17:52:00 +0000 Message-ID: <31bbf48a-aec8-d228-b4ee-9b32e7e066a5@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4595726404341737019==" List-Id: --===============4595726404341737019== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=C3=BCller > Hi, >=20 > Unfortunately this does not execute. I cannot even load the page without su= bmitting the form: >=20 > I have this in my errors log file: >=20 > 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 12845144918195= 2] [client 192.168.190.117:61657] End of script output before headers: mail.c= gi, referer: https://192.168.190.1:444/ >=20 > Best, > -Michael >=20 >> On 31 Jan 2020, at 16:31, Peter M=C3=BCller w= rote: >> >> Fixes #12161 >> >> Reported-by: Michael Tremer >> Signed-off-by: Peter M=C3=BCller >> --- >> 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 = # >> +# Copyright (C) 2007-2020 IPFire Team = # >> # = # >> # 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'}"){ #Sav= eButton on configsite >> >> $dma{'SMARTHOST'} =3D $cgiparams{'txt_mailserver'}; >> $dma{'PORT'} =3D $cgiparams{'txt_mailport'}; >> - $dma{'STARTTLS'} =3D '' if ($cgiparams{'mail_tls'}); >> - $dma{'SECURETRANSFER'} =3D '' if exists $dma{'STARTTLS'}; >> + $dma{'STARTTLS'} =3D '' if ($cgiparams{'mail_tls'}{'explicit'}); >> + $dma{'SECURETRANS'} =3D '' if ($cgiparams{'mail_tls'}{'explicit'} || $c= giparams{'mail_tls'}{'implicit'}); >> $dma{'SPOOLDIR'} =3D "/var/spool/dma"; >> $dma{'FULLBOUNCE'} =3D ''; >> $dma{'MAILNAME'} =3D "$mainsettings{'HOSTNAME'}.$mainsettings{DOMAINNAM= E}"; >> @@ -140,8 +140,6 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'email testmail= '}"){ #Testmail button on >> >> #FUNCTIONS >> sub configsite{ >> -=09 >> - >> #If update set fieldvalues new >> if($cgiparams{'update'} eq 'on'){ >> $mail{'USEMAIL'} =3D 'on'; >> @@ -156,7 +154,9 @@ sub configsite{ >> } >> #find preselections >> $checked{'usemail'}{$mail{'USEMAIL'}} =3D 'CHECKED'; >> - $checked{'mail_tls'}{'on'} =3D 'CHECKED' if exists $dma{'STARTTLS'}; >> + $selected{'mail_tls'}{'explicit'} =3D 'selected' if exists $dma{'STARTTL= S'}; >> + $selected{'mail_tls'}{'implicit'} =3D 'selected' if exists $dma{'SECURET= RANS'} and not $dma{'STARTTLS'}; >> + $selected{'mail_tls'}{'disabled'} =3D 'selected' if not exists ($dma{'SE= CURETRANS'} and $dma{'STARTTLS'}); >> =09 >> #Open site >> &Header::openpage($Lang::tr{'email settings'}, 1, ''); >> @@ -226,7 +226,13 @@ END >> >> >> $Lang::tr{'email tls'} >> - >> + >> + >> + >> >> END >> if (! -z $dmafile && $mail{'USEMAIL'} eq 'on' && !$errormessage){ >> --=20 >> 2.16.4 >=20 --===============4595726404341737019==--