From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 528B4BFD63 for ; Tue, 9 Jan 2024 14:59:08 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1E35917F7D for ; Tue, 9 Jan 2024 14:59:08 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 9 Jan 2024 14:59:07 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6794F49049 for ; Tue, 9 Jan 2024 14:59:07 +0100 (CET) From: Dominik Csapak To: pmg-devel@lists.proxmox.com Date: Tue, 9 Jan 2024 14:59:01 +0100 Message-Id: <20240109135906.66200-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240109135906.66200-1-d.csapak@proxmox.com> References: <20240109135906.66200-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [disclaimer.pm] Subject: [pmg-devel] [PATCH pmg-api 1/4] ruledb disclaimer: cleanup trailing whitespace X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2024 13:59:08 -0000 Signed-off-by: Dominik Csapak --- src/PMG/RuleDB/Disclaimer.pm | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/PMG/RuleDB/Disclaimer.pm b/src/PMG/RuleDB/Disclaimer.pm index c6afe54..5eadc6f 100644 --- a/src/PMG/RuleDB/Disclaimer.pm +++ b/src/PMG/RuleDB/Disclaimer.pm @@ -31,7 +31,7 @@ sub otype_text { } sub oisedit { - return 1; + return 1; } sub final { @@ -50,13 +50,13 @@ _EOD_ sub new { my ($type, $value, $ogroup) = @_; - + my $class = ref($type) || $type; $value //= $std_discl; - + my $self = $class->SUPER::new($class->otype(), $ogroup); - + $self->{value} = $value; return $self; @@ -64,17 +64,17 @@ sub new { sub load_attr { my ($type, $ruledb, $id, $ogroup, $value) = @_; - + my $class = ref($type) || $type; defined($value) || die "undefined object attribute: ERROR"; - + my $obj = $class->new(decode('UTF-8', $value), $ogroup); $obj->{id} = $id; $obj->{digest} = Digest::SHA::sha1_hex($id, $value, $ogroup); - + return $obj; } @@ -91,9 +91,9 @@ sub save { if (defined ($self->{id})) { # update - + $ruledb->{dbh}->do( - "UPDATE Object SET Value = ? WHERE ID = ?", + "UPDATE Object SET Value = ? WHERE ID = ?", undef, $value, $self->{id}); } else { @@ -104,14 +104,14 @@ sub save { "VALUES (?, ?, ?);"); $sth->execute($self->ogroup, $self->otype, $value); - - $self->{id} = PMG::Utils::lastid($ruledb->{dbh}, 'object_id_seq'); + + $self->{id} = PMG::Utils::lastid($ruledb->{dbh}, 'object_id_seq'); } - + return $self->{id}; } -sub add_data { +sub add_data { my ($self, $entity, $data) = @_; $entity->bodyhandle || return undef; @@ -122,14 +122,14 @@ sub add_data { if (my $path = $entity->{PMX_decoded_path}) { $fh = IO::File->new("<$path"); } else { - $fh = $entity->open("r"); + $fh = $entity->open("r"); } return undef if !$fh; # in memory (we can't modify the file, because # a.) that would modify all entities (see ModGroup) - # b.) bad performance + # b.) bad performance my $body = new MIME::Body::InCore || return undef; my $newfh = $body->open ("w") || return undef; @@ -190,7 +190,7 @@ sub sign { } sub execute { - my ($self, $queue, $ruledb, $mod_group, $targets, + my ($self, $queue, $ruledb, $mod_group, $targets, $msginfo, $vars, $marks) = @_; my $rulename = encode('UTF-8', $vars->{RULE} // 'unknown'); @@ -212,7 +212,7 @@ sub execute { $parser->parse($tmp); $parser->eof; - + $self->sign($entity, "$html\n", "$text\n", $queue->{logid}, $rulename); return; -- 2.30.2