From: "Peter Müller" <peter.mueller@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH v2 1/2] mail.cgi: add support for implicit TLS usage
Date: Mon, 03 Feb 2020 18:35:00 +0000 [thread overview]
Message-ID: <2a6c0c35-df5a-5b9b-1117-ba533448a51f@ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 3321 bytes --]
The second version of this patchset fixes reading empty configuration
files and superseds the first version (duh!).
Fixes #12161
Reported-by: Michael Tremer <michael.tremer(a)ipfire.org>
Signed-off-by: Peter Müller <peter.mueller(a)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..7865a1da6 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(a)ipfire.org> #
+# Copyright (C) 2007-2020 IPFire Team <info(a)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'} eq 'explicit');
+ $dma{'SECURETRANSFER'} = '' if ($cgiparams{'mail_tls'} eq 'explicit' || $cgiparams{'mail_tls'} eq '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{'SECURETRANSFER'}) and (not exists $dma{'STARTTLS'});
+ $selected{'mail_tls'}{'disabled'} = 'selected' if (not exists $dma{'SECURETRANSFER'}) and (not exists $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
next reply other threads:[~2020-02-03 18:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 18:35 Peter Müller [this message]
2020-02-03 18:35 ` [PATCH v2 2/2] update language files for mail.cgi changes Peter Müller
2020-02-04 10:22 ` Michael Tremer
2020-02-04 10:22 ` [PATCH v2 1/2] mail.cgi: add support for implicit TLS usage Michael Tremer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a6c0c35-df5a-5b9b-1117-ba533448a51f@ipfire.org \
--to=peter.mueller@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox