Maia Mailgaurd

Janky Jay, III jankyj at unfs.us
Sun Dec 30 02:48:36 UTC 2018


Hello Miroslav,

On 12/29/18 6:03 PM, Miroslav Lachman wrote:
> 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.

    Thank you for the information! You're likely very much correct as
that seems to be a more proper fix for the array (and there are likely
other arrays that need to be fixed). I will test this and see if it
works (I don't see why it wouldn't). Thanks again!

Regards,
Janky Jay, III

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20181229/10e52194/attachment.sig>


More information about the freebsd-ports mailing list