From patchwork Wed Oct 30 10:58:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 2560 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 47357g42Mpz420M for ; Wed, 30 Oct 2019 10:59:43 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 47357f322mz2Ps; Wed, 30 Oct 2019 10:59:42 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1572433182; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jkGJd11XqYnNPfL2SrWQZCmPf/GIhx12j1V/6KPoHbE=; b=iyNp3LlQkqq4LohbsKNgBtdONDOXI+DuvI0MaotFsli/MKq1Eje9T5OIQcioNwFg1fS3Qr XMNUxTN15qcu1iDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1572433182; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jkGJd11XqYnNPfL2SrWQZCmPf/GIhx12j1V/6KPoHbE=; b=NNMpD3M1qeRcbyXNOb8UFl+8dRRni8DBg1c+XaMCqojEYH0ILPPJk8M8jNVmecIXdURtaw xKUGqtoo131KOhp5FVb0Syx96S1jeL4ZMavCSd+SyF/GJ+teGIUs8Ko3GRbvBpND/khIQ7 C5OIFQx2EkcIMNsCQm2pb4OjTIrXZJVJMEmk42VgaJSgWph4pMbtdN6BF8bjs+DjUM2Sq2 TL7CYdk8AKTuXTxJJfrb81VgWApipLZJdvv2F0ae6otB92lhL6IKgbGDFPuyn2RroKek4m BOa4ZOzcjFv1EHUcE+vI8IG6ulIuBkFHLIFbEMrts2g7/1O1oIucf20VYqO9EQ== Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 47357f1ktGz2ySv; Wed, 30 Oct 2019 10:59:42 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 47357c3CC2z2y48 for ; Wed, 30 Oct 2019 10:59:40 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 47357b6xDCz2Ps; Wed, 30 Oct 2019 10:59:29 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1572433180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jkGJd11XqYnNPfL2SrWQZCmPf/GIhx12j1V/6KPoHbE=; b=Lj4tGFeNCUrMpbmboIa4SHVkUT5tVobam5M83fmZxTC6V6SH7srrhkvtomrCUZfBAZclmp TdxmfeA9dWlgBLAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1572433180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jkGJd11XqYnNPfL2SrWQZCmPf/GIhx12j1V/6KPoHbE=; b=aPSxcRskrwMiny42Bk8vRy6AtT4lZqyn+EFEgGN5IQ2JMRDZ2e6Y6C748KyLUnLpuvKpSg QwwmloMUv04bSxxR2yD/TKjUEer03e2+3tdBk1Chs1+YIcNZNAuSUeFETkYVi0TYQSdz9S N6ZDKmKPbGvIIijBEx8n2F/5iee/RCxV5FLvJvAYG5R/6gQ73JdnwvAHY4z+rWPCxP5Pmx UWpenlTYcD4wFeWRNrJWjAoNHfpdVZfMSWQNGAgld3L1yTgBxjgdxvOq27s7XrW5L41iZC zIuWJUyLUncTtxoEXeKbL5NAoiZ0aIDxBBkvUEu2Yz9BZ4Er8AkXmIzdLRm8rw== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 1/2] mail.cgi: Always check content of fields Date: Wed, 30 Oct 2019 10:58:59 +0000 Message-Id: <20191030105900.15306-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" These checks did not do anything but clear all fields when mailing was disabled. It makes a lot more sense to retain people's settings, even when they have been disabled. Signed-off-by: Michael Tremer --- html/cgi-bin/mail.cgi | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/html/cgi-bin/mail.cgi b/html/cgi-bin/mail.cgi index 9cf14cac8..07986a4d6 100755 --- a/html/cgi-bin/mail.cgi +++ b/html/cgi-bin/mail.cgi @@ -81,19 +81,10 @@ if ( -f $mailfile){ #ACTIONS if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ #SaveButton on configsite - #Check fields - if ($cgiparams{'USEMAIL'} eq 'on'){ - $errormessage=&checkmailsettings; - }else{ - $cgiparams{'txt_mailserver'}=''; - $cgiparams{'txt_mailport'}=''; - $cgiparams{'txt_mailuser'}=''; - $cgiparams{'txt_mailpass'}=''; - $cgiparams{'mail_tls'}=''; - $cgiparams{'txt_mailsender'}=''; - $cgiparams{'txt_recipient'}=''; - } - if(!$errormessage){ + # Check fields + $errormessage = &checkmailsettings(); + + if (!$errormessage) { #clear hashes %auth=(); %dma=();