From owner-freebsd-ports@freebsd.org Mon Apr 24 18:06:07 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 141DED4E616 for ; Mon, 24 Apr 2017 18:06:07 +0000 (UTC) (envelope-from bretislav.kubesa@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id E67E2903 for ; Mon, 24 Apr 2017 18:06:06 +0000 (UTC) (envelope-from bretislav.kubesa@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id E5CF3D4E615; Mon, 24 Apr 2017 18:06:06 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5744D4E614 for ; Mon, 24 Apr 2017 18:06:06 +0000 (UTC) (envelope-from bretislav.kubesa@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8682B901; Mon, 24 Apr 2017 18:06:06 +0000 (UTC) (envelope-from bretislav.kubesa@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id m123so75456640wma.0; Mon, 24 Apr 2017 11:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:subject:from:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=eSdcGzmjjOk9BokGSrjlO9+Zr4W8Hqj63NjeWsR4Avg=; b=pNjPw97xFObrD8HaiDtNzQmrVpRgYDeaeG+7OdjNvWqWpF+J9dtnnxhZDaMH3XuNna LVPwZY3OgQH482EyPVGkDBR2JigDSP/ELyXBEN/r3zHuU+KxL9CfDyYEjed4cbfu3jZ5 7spvlTvS9IulypJRiOqJ2yoBxt1JYeUadoeftRHQHv3buZQnpUwXAHuBaes2J/FJgns2 jZ/eBI/fLwxiUBxDQMwy5KmljIQt0Rpw1w/jtqN98qu7WxjbW5lNnaLHXTT9fJKYJs3Y O1GCSzymZvST353rD7ZMLfAV7VP9TrIgYB4SsDSg6PfbSQqioTxI0FQzAhMSuJRbNaoA yOAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:from:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=eSdcGzmjjOk9BokGSrjlO9+Zr4W8Hqj63NjeWsR4Avg=; b=V86WATm8jg2CtNWMCE1timV6ra6g4JGsr15HivWOCgXB4rzhrgdKxi8tnAdJ8ghbKY AA4LTDPIYUSfkfr19TM4Y/DdBGDi0HeSi8ws7/fHOYy1zyBNjEUdi9rvSuZsmkEJxBQq TyP57MkulOG8DyjkoVxE1kfeAb4PuoYyFS6BdLNpNaLwsn4yh0e1kykTWOlwWwW1OYUF LqqZSudffLqU7VF1NR2Q3oW0jMX4l0+PGUqRScEh0oO3Pz3GmLvWuqSkn1MfGgVsbiDz QMNFzbaek1Pz+n/KUWa3zxUduWrBTHBXGQ7HA0ol9VxMw5QAKN927XbHZEH+E9/sD1ii 3lJw== X-Gm-Message-State: AN3rC/4uKVFvc4tfy7g6wvu29bwQ4i0VTp73HuJPsDeGDvVXRUOqlOEB QDCOQdjWOvhOZ2YV7wM= X-Received: by 10.28.71.132 with SMTP id m4mr10030037wmi.130.1493057164705; Mon, 24 Apr 2017 11:06:04 -0700 (PDT) Received: from [10.0.0.6] (ip-185-149-129-53.kmenet.cz. [185.149.129.53]) by smtp.googlemail.com with ESMTPSA id q108sm5405840wrb.3.2017.04.24.11.06.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Apr 2017 11:06:04 -0700 (PDT) To: crees@FreeBSD.org Cc: ports@FreeBSD.org Subject: FreeBSD Port: openwebmail-2.53_2 - error Can't use 'defined(%hash)' From: =?UTF-8?Q?B=c5=99etislav_Kubesa?= Message-ID: <6b7a9406-fa5e-2a07-1401-e9efbae68620@gmail.com> Date: Mon, 24 Apr 2017 20:06:03 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2017 18:06:07 -0000 Hi, I faced issues after upgrading to FBSD 10.3, getting error : Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at /var/www/cgi-bin/mydomain/owm/shares/ow-shared.pl line 201. Compilation failed in require at /var/www/cgi-bin/mydomain/owm/.openwebmail-tool.pl line 67. Thanks to discussion http://www.linuxquestions.org/questions/slackware-14/openwebmail-in-14-2-compilation-failed-errors-from-defined-4175593135/ I maybe managed to fully fix it. Hope this will be fine for fixing it for someone more experienced then me / port maintainer. Thank you Bretislav PS : Don't kill me, just trying help diff -ruN openwebmail-2.53_2_broken/cgi-bin/openwebmail/openwebmail-read.pl openwebmail-2.53_2/cgi-bin/openwebmail/openwebmail-read.pl --- openwebmail-2.53_2_broken/cgi-bin/openwebmail/openwebmail-read.pl 2017-04-24 19:43:15.081986000 +0200 +++ openwebmail-2.53_2/cgi-bin/openwebmail/openwebmail-read.pl 2017-04-24 19:36:30.000000000 +0200 @@ -861,7 +861,7 @@ my $has_nontext_att=0; foreach my $attnumber (0 .. $#{$message{attachment}}) { - next unless (defined %{$message{attachment}[$attnumber]}); + next unless (%{$message{attachment}[$attnumber]}); $has_nontext_att++ if (defined ${$message{attachment}[$attnumber]}{'content-type'} && ${$message{attachment}[$attnumber]}{'content-type'}!~/^text/i); my $attcharset=$convfrom; @@ -886,7 +886,7 @@ } else { # attmode==simple # handle case to skip to next text/html attachment - if ( defined %{$message{attachment}[$attnumber+1]} && + if ( ref($message{attachment}[$attnumber+1]) eq "HASH" && (${$message{attachment}[$attnumber+1]}{boundary} eq ${$message{attachment}[$attnumber]}{boundary}) ) { @@ -1508,7 +1508,7 @@ return ($msgsize, $errmsg) if ($msgsize<=0); ($message{header}, $message{body}, $message{attachment}) =ow::mailparse::parse_rfc822block(\$block, "0", "all"); - return 0 if (!defined @{$message{attachment}}); + return 0 if (!defined {$message{attachment}}); my @datas; my $boundary = "----=OPENWEBMAIL_ATT_" . rand(); diff -ruN openwebmail-2.53_2_broken/cgi-bin/openwebmail/openwebmail-send.pl openwebmail-2.53_2/cgi-bin/openwebmail/openwebmail-send.pl --- openwebmail-2.53_2_broken/cgi-bin/openwebmail/openwebmail-send.pl 2017-04-24 19:43:15.085116000 +0200 +++ openwebmail-2.53_2/cgi-bin/openwebmail/openwebmail-send.pl 2017-04-24 19:28:00.000000000 +0200 @@ -510,7 +510,7 @@ } elsif ($message{'content-type'} =~ /^multipart/i) { # If the first attachment is text, # assume it's the body of a message in multi-part format - if ( defined %{$message{attachment}[0]} && + if ( %{$message{attachment}[0]} && ${$message{attachment}[0]}{'content-type'} =~ /^text/i ) { if (${$message{attachment}[0]}{'content-transfer-encoding'} =~ /^quoted-printable/i) { $body = decode_qp(${${$message{attachment}[0]}{r_content}}); @@ -531,7 +531,7 @@ # handle mail with both text and html version # rename html to other name so if user in text compose mode, # the modified/forwarded text won't be overridden by html again - if ( defined %{$message{attachment}[1]} && + if ( %{$message{attachment}[1]} && ${$message{attachment}[1]}{boundary} eq ${$message{attachment}[0]}{boundary} ) { # rename html attachment in the same alternative group if ( (${$message{attachment}[0]}{subtype}=~/alternative/i && diff -ruN openwebmail-2.53_2_broken/cgi-bin/openwebmail/shares/getmessage.pl openwebmail-2.53_2/cgi-bin/openwebmail/shares/getmessage.pl --- openwebmail-2.53_2_broken/cgi-bin/openwebmail/shares/getmessage.pl 2017-04-24 19:43:15.037505000 +0200 +++ openwebmail-2.53_2/cgi-bin/openwebmail/shares/getmessage.pl 2017-04-24 19:02:24.000000000 +0200 @@ -89,7 +89,7 @@ $message{status} =~ s/\s//g; if ($message{'content-type'}=~/charset="?([^\s"';]*)"?\s?/i) { $message{charset}=$1; - } elsif (defined @{$message{attachment}}) { + } elsif (@{$message{attachment}}) { my @att=@{$message{attachment}}; foreach my $i (0 .. $#att) { if (defined ${$att[$i]}{charset} && ${$att[$i]}{charset} ne '') { diff -ruN openwebmail-2.53_2_broken/cgi-bin/openwebmail/shares/mailfilter.pl openwebmail-2.53_2/cgi-bin/openwebmail/shares/mailfilter.pl --- openwebmail-2.53_2_broken/cgi-bin/openwebmail/shares/mailfilter.pl 2017-04-24 19:43:15.040213000 +0200 +++ openwebmail-2.53_2/cgi-bin/openwebmail/shares/mailfilter.pl 2017-04-24 19:02:37.000000000 +0200 @@ -366,7 +366,7 @@ $io_errcount++; $i--; next; } } - if (!defined @{$r_attachments}) { + if (!@{$r_attachments}) { ($header, $body, $r_attachments)=ow::mailparse::parse_rfc822block(\$currmessage); } @@ -430,7 +430,7 @@ $io_errcount++; $i--; next; } } - if (!defined @{$r_attachments}) { + if (!@{$r_attachments}) { ($header, $body, $r_attachments)=ow::mailparse::parse_rfc822block(\$currmessage); } # check attachments @@ -638,7 +638,7 @@ $io_errcount++; $i--; next; } } - if (!defined @{$r_attachments}) { + if (!@{$r_attachments}) { ($header, $body, $r_attachments)=ow::mailparse::parse_rfc822block(\$currmessage); } diff -ruN openwebmail-2.53_2_broken/cgi-bin/openwebmail/shares/ow-shared.pl openwebmail-2.53_2/cgi-bin/openwebmail/shares/ow-shared.pl --- openwebmail-2.53_2_broken/cgi-bin/openwebmail/shares/ow-shared.pl 2017-04-24 19:43:15.041206000 +0200 +++ openwebmail-2.53_2/cgi-bin/openwebmail/shares/ow-shared.pl 2017-04-24 19:21:59.000000000 +0200 @@ -184,17 +184,18 @@ use vars qw($_vars_used); sub openwebmail_clearall { # clear opentable in filelock.pl - ow::filelock::closeall() if (defined %ow::filelock::opentable); + ow::filelock::closeall() if (%ow::filelock::opentable); # chdir back to openwebmail cgidir chdir($config{'ow_cgidir'}) if ($config{'ow_cgidir'}); # clear gobal variable for persistent perl - undef(%SIG) if (defined %SIG); - undef(%config) if (defined %config); - undef(%config_raw) if (defined %config_raw); + undef(%SIG) if (%SIG); + undef(%config) if (%config); + undef(%config_raw) if (%config_raw); + undef($thissession) if (defined $thissession); - undef(%icontext) if (defined %icontext); + undef(%icontext) if (%icontext); undef($default_logindomain) if (defined $default_logindomain); undef($loginname) if (defined $loginname); @@ -207,7 +208,7 @@ undef($uuid) if (defined $uuid); undef($ugid) if (defined $ugid); undef($homedir) if (defined $homedir); - undef(%prefs) if (defined %prefs); +undef(%prefs) if (%prefs); undef($quotausage) if (defined $quotausage); undef($quotalimit) if (defined $quotalimit); @@ -1068,8 +1069,8 @@ $user=get_user_by_virtualuser($loginuser); if ($user eq "") { my @domainlist=($logindomain); - if (defined @{$config{'domain_equiv'}{'list'}{$logindomain}}) { - push(@domainlist, @{$config{'domain_equiv'}{'list'}{$logindomain}}); + if (defined{$config{'domain_equiv'}{'list'}{$logindomain}}) { + push(@domainlist, defined{$config{'domain_equiv'}{'list'}{$logindomain}}); } foreach (@domainlist) { $user=get_user_by_virtualuser("$loginuser\@$_"); @@ -1698,7 +1699,7 @@ ########## IS_ADM ################################################ sub is_vdomain_adm { - if (defined @{$config{'vdomain_admlist'}}) { + if (@{$config{'vdomain_admlist'}}) { foreach my $adm (@{$config{'vdomain_admlist'}}) { return 1 if ($_[0] eq $adm); # $_[0] is the user }