Hi,
I think there is a problem with this patch.
On Sat, 2015-10-31 at 07:34 +0100, Alexander Marx wrote:
auth.conf was always written, even if no username/password provided. In this case only the ip or Hostname of the mailserver was written into auth.conf. Now the file is only filled if username/password are filled.
Signed-off-by: Alexander Marx alexander.marx@ipfire.org
html/cgi-bin/mail.cgi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/html/cgi-bin/mail.cgi b/html/cgi-bin/mail.cgi index be663a6..f5be104 100755 --- a/html/cgi-bin/mail.cgi +++ b/html/cgi-bin/mail.cgi @@ -110,9 +110,12 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ #SaveButton on configsite $mail{'SENDER'} = $cgiparams{'txt_mailsender'}; $mail{'RECIPIENT'} = $cgiparams{'txt_recipient'};
$auth{'AUTHNAME'} =
$cgiparams{'txt_mailuser'};
$auth{'AUTHPASS'} =
$cgiparams{'txt_mailpass'};
$auth{'AUTHHOST'} =
$cgiparams{'txt_mailserver'};
if ($cgiparams{'txt_mailuser'} &&
$cgiparams{'txt_mailpass'}) {
$auth{'AUTHNAME'} =
$cgiparams{'txt_mailuser'};
$auth{'AUTHPASS'} =
$cgiparams{'txt_mailpass'};
$auth{'AUTHHOST'} =
$cgiparams{'txt_mailserver'};
print TXT1
"$auth{'AUTHNAME'}|$auth{'AUTHHOST'}:$auth{'AUTHPASS'}\n";
}
My email client made a right mess out of this code above, but maybe you check with the original one... So if the user wants to clear the username and password and then hits save I guess these changes won't be saved. They should though.
Can you confirm this? I think the solution should keep the first three lines that are now in the if-clause before that and also clear auth.conf when the configuration was cleared.
$dma{'SMARTHOST'} =
$cgiparams{'txt_mailserver'}; $dma{'PORT'} = $cgiparams{'txt_mailport'}; @@ -129,7 +132,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ #SaveButton on configsite print TXT "$k $v\n"; } close TXT;
print TXT1
"$auth{'AUTHNAME'}|$auth{'AUTHHOST'}:$auth{'AUTHPASS'}\n";
close TXT2;close TXT1;
On a side note: It would probably have helped a bit to name the file handles better. Like AUTHFILE or so instead of numbering them.
}else{
-Michael