From owner-freebsd-ports@freebsd.org Sun Dec 30 01:10:17 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7CC11432954 for ; Sun, 30 Dec 2018 01:10:16 +0000 (UTC) (envelope-from SRS0=Ik2b=PH=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7CB38C723 for ; Sun, 30 Dec 2018 01:10:15 +0000 (UTC) (envelope-from SRS0=Ik2b=PH=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 3074E28417; Sun, 30 Dec 2018 02:03:31 +0100 (CET) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id C191C28416; Sun, 30 Dec 2018 02:03:29 +0100 (CET) Subject: Re: Maia Mailgaurd To: Janketh Jay , freebsd-ports@freebsd.org References: <3695c8be-c969-1715-a902-72752faf7d5e@hayers.org> <9BE00ADB383D4AC1A8E546A8B4F0DD89@RIVENDELL> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <95f7bde5-62c7-c79b-366d-45d8a9147edd@quip.cz> Date: Sun, 30 Dec 2018 02:03:29 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7CB38C723 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.62 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.97)[0.969,0]; IP_SCORE(0.58)[ip: (1.50), ipnet: 94.124.104.0/21(0.75), asn: 42000(0.60), country: CZ(0.04)]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[quip.cz]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.92)[0.916,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: elsa.codelab.cz]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[4.105.124.94.list.dnswl.org : 127.0.10.0]; NEURAL_SPAM_LONG(0.97)[0.967,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[000.fbsd@quip.cz,SRS0=Ik2b=PH=quip.cz=000.fbsd@elsa.codelab.cz]; RECEIVED_SPAMHAUS_PBL(0.00)[209.16.49.86.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:42000, ipnet:94.124.104.0/21, country:CZ]; FROM_NEQ_ENVFROM(0.00)[000.fbsd@quip.cz,SRS0=Ik2b=PH=quip.cz=000.fbsd@elsa.codelab.cz]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Dec 2018 01:10:17 -0000 Janketh Jay wrote on 2018/12/30 01:03: [...] > diff -Naur maia.orig/cache.php maia/cache.php > --- maia.orig/cache.php 2015-02-15 15:19:45.000000000 -0700 > +++ maia/cache.php      2018-10-14 20:25:30.278960000 -0600 > @@ -554,7 +554,7 @@ >                      $rectmp = ""; >                      foreach ($to_list as $recipient) { >                          if (isset($personal_addresses[$recipient]) || > $domain_default) { > -                          $rectmp[] = $recipient; > +                          $rectmp = $recipient; >                          } >                      } >                      $rows[$count]['recipient_email'] = $rectmp; > > >       Essentially, you just need to remove the "[]" from "rectmp" on > line 558 in your /usr/local/www/maia/cache.php file. I don't use Maia Mailguard and I didn't read the source code but I think your patch is wrong. It changed the function. Original code assigned all recipient addresses (appending) in to an array (hash) $rectmp in a foreach loop and then assign this array to $rows[$count]['recipient_email']. But now you are using it as variable so if there are more than one recipient this variable is overwritten on each iteration and then just the last recipient is assigned to $rows[$count]['recipient_email']. My very wild guess is that it should be like this - $rectmp = ""; + $rectmp = array(); foreach ($to_list as $recipient) { if (isset($personal_addresses[$recipient]) || $domain_default) { $rectmp[] = $recipient; } } $rows[$count]['recipient_email'] = $rectmp; I guess you want to fix some PHP 7 warning / syntax error with $rectmp created ass plain variable and later used as an array so I defined as an array first. But maybe I am totally wrong :) I just made similar fix few days ago in an old version of PostfixAdmin after upgrade from PHP 5.6 to 7.1. Miroslav Lachman