Index: head/mail/openwebmail/Makefile =================================================================== --- head/mail/openwebmail/Makefile (revision 459629) +++ head/mail/openwebmail/Makefile (revision 459630) @@ -1,155 +1,155 @@ # Created by: Yen-Ming Lee # $FreeBSD$ PORTNAME= openwebmail PORTVERSION= 2.53 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= mail MASTER_SITES= http://openwebmail.acatysmoof.com/download/release/ \ http://openwebmail.org/openwebmail/download/release/ MAINTAINER= crees@FreeBSD.org COMMENT= Webmail system designed to manage big mail folder files efficiently RUN_DEPENDS= p5-Text-Iconv>=0:converters/p5-Text-Iconv USES= perl5 USE_PERL5= run build patch NO_BUILD= yes NO_WRKSUBDIR= yes OWCGIDIR= ${PREFIX}/www/cgi-bin/openwebmail OWDATADIR= ${PREFIX}/www/data/openwebmail PATCH_WRKSRC= ${WRKSRC}/cgi-bin/openwebmail PATCH_STRIP= -p1 PLIST= ${WRKDIR}/.PLIST.${PKGNAME} SUB_FILES= pkg-install PLIST_DIRS= www/cgi-bin/openwebmail/etc/addressbooks \ www/cgi-bin/openwebmail/etc/sessions \ www/cgi-bin/openwebmail/etc/users \ www/data/openwebmail/help/zh_CN.GB2312/images/_notes \ www/data/openwebmail/help/zh_CN.GB2312/templates_and_data/_notes OPTIONS_DEFINE= ANTIWORD MAGICK ISPELL LEARNSPAM LSOF PAM POP3_OVER_SSL QUOTA \ SPAMCHECK SPAMCHECK_ALL SPEEDYCGI TNEF VIRUSCHECK VIRUSCHECK_ALL \ WGET ANTIWORD_DESC= AntiWord ANTIWORD_RUN_DEPENDS= antiword:textproc/antiword ISPELL_DESC= ISpell ISPELL_RUN_DEPENDS= ispell:textproc/aspell-ispell LEARNSPAM_DESC= Learn HAM/SPAM LEARNSPAM_IMPLIES= SPAMCHECK LSOF_DESC= lsof LSOF_RUN_DEPENDS= ${LOCALBASE}/sbin/lsof:sysutils/lsof MAGICK_RUN_DEPENDS= convert:graphics/ImageMagick PAM_DESC= PAM PAM_RUN_DEPENDS= p5-Authen-PAM>=0:security/p5-Authen-PAM POP3_OVER_SSL_DESC= POP3 Over SSL POP3_OVER_SSL_RUN_DEPENDS= p5-IO-Socket-SSL>=0:security/p5-IO-Socket-SSL QUOTA_DESC= Quota QUOTA_RUN_DEPENDS= p5-Quota>=0:sysutils/p5-Quota SPAMCHECK_DESC= Spam check (Mail::SpamAssassin) SPAMCHECK_RUN_DEPENDS= spamassassin>=0:mail/spamassassin SPAMCHECK_ALL_DESC= Spam check for all (default: pop3) SPAMCHECK_ALL_IMPLIES= SPAMCHECK SPEEDYCGI_DESC= SpeedyCGI SPEEDYCGI_RUN_DEPENDS= speedy_suidperl:www/p5-CGI-SpeedyCGI SPEEDYCGI_SUB_LIST= WITHOUT_SPEEDYCGI="@comment " SPEEDYCGI_SUB_LIST_OFF= WITHOUT_SPEEDYCGI="" SPEEDYCGI_EXTRA_PATCHES= ${PATCH_WRKSRC}/misc/patches/suidperl2speedy_suidperl.notmp.patch TNEF_DESC= tnef TNEF_RUN_DEPENDS= ${LOCALBASE}/bin/tnef:converters/tnef VIRUSCHECK_DESC= Virus check (Clam AntiVirus) VIRUSCHECK_RUN_DEPENDS= clamdscan:security/clamav VIRUSCHECK_ALL_DESC= Virus check for all (default: pop3) VIRUSCHECK_ALL_IMPLIES= VIRUSCHECK WGET_DESC= wget WGET_RUN_DEPENDS= ${LOCALBASE}/bin/wget:ftp/wget .include # WITH_SPEEDYCGI needs suidperl enabled under perl 5.8.4 or above, # so, disable it first, and enable it again if perl exists and enabled suidperl .if ${PORT_OPTIONS:MSPEEDYCGI} DISABLE_SPEEDYCGI=yes PORT_OPTIONS:= ${PORT_OPTIONS:NSPEEDYCGI} .if exists(${PERL}) PERL_V!= ${PERL} -V .if ${PERL_V:M*dosuid*} != "" .undef DISABLE_SPEEDYCGI .endif # dosuid .endif # exists(${PERL}) .endif # SPEEDYCGI post-extract: .for x in addressbooks/global calendar.book @${RM} ${WRKSRC}/cgi-bin/openwebmail/etc/${x} .endfor post-patch: # ### XXX: Hack, some of this should be LOCALBASE @${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -e 's,/usr/local,${PREFIX},g' .if defined(DISABLE_SPEEDYCGI) @${ECHO_MSG} "" @${ECHO_MSG} "WARNING:" @${ECHO_MSG} "Your perl doesn't support SUID, or you don't have perl yet," @${ECHO_MSG} "so SpeedyCGI support is disabled automatically." @${ECHO_MSG} "If you want SpeedyCGI support, please reinstall perl with ENABLE_SUIDPERL=yes," @${ECHO_MSG} "and reinstall ${PORTNAME}." @${ECHO_MSG} "" .endif @${MV} ${PATCH_WRKSRC}/etc/openwebmail.conf ${PATCH_WRKSRC}/etc/openwebmail.conf.sample @${PERL} -pi.bak -e 's,${LOCALBASE}/www/cgi-bin/openwebmail,${OWCGIDIR},g' ${PATCH_WRKSRC}/etc/openwebmail.conf.sample @${PERL} -pi.bak -e 's,${LOCALBASE}/www/data/openwebmail,${OWDATADIR},g' ${PATCH_WRKSRC}/etc/openwebmail.conf.sample post-patch-LEARNSPAM-on: @${PERL} -pi.bak -e 's,enable_learnspam no,enable_learnspam yes,g' ${PATCH_WRKSRC}/etc/openwebmail.conf.sample post-patch-SPAMCHECK-on: @${PERL} -pi.bak -e 's,enable_spamcheck no,enable_spamcheck yes,g' ${PATCH_WRKSRC}/etc/openwebmail.conf.sample @${ECHO} "enable_saprefs yes" >> ${PATCH_WRKSRC}/etc/openwebmail.conf.sample post-patch-SPAMCHECK_ALL-on: @${ECHO} "spamcheck_source_allowed all" >> ${PATCH_WRKSRC}/etc/openwebmail.conf.sample post-patch-VIRUSCHECK-on: @${PERL} -pi.bak -e 's,enable_viruscheck no,enable_viruscheck yes,g' ${PATCH_WRKSRC}/etc/openwebmail.conf.sample post-patch-VIRUSCHECK_ALL-on: @${ECHO} "viruscheck_source_allowed all" >> ${PATCH_WRKSRC}/etc/openwebmail.conf.sample post-patch-SPEEDYCGI-on: @${ECHO} "has_savedsuid_support no" >> ${PATCH_WRKSRC}/etc/openwebmail.conf.sample post-patch-SPEEDYCGI-off: @${PERL} -pi.bak -e 's,/usr/bin/suidperl,${PERL},g' ${PATCH_WRKSRC}/openwebmail*pl pre-install: @: > ${PLIST} @${FIND} ${WRKSRC}/*/openwebmail \( -name "*.bak" -or -name "*.orig" \) -delete @${PRINTF} "%s\n%s\n" "@owner ${BINOWN}" "@group mail" >> ${PLIST} @${ECHO} "@sample www/cgi-bin/openwebmail/etc/openwebmail.conf.sample" >> ${PLIST} @${FIND} ${WRKSRC}/cgi-bin/openwebmail \( -type f -o -type l \) -and -not -name openwebmail.conf.sample | \ ${SED} -e 's,^${WRKSRC},www,' | ${SORT} -u >> ${PLIST} @${ECHO} "www/cgi-bin/openwebmail/etc/dbm.conf" >> ${PLIST} @${PRINTF} "%s\n%s\n" "@owner" "@group" >> ${PLIST} @${FIND} ${WRKSRC}/data/openwebmail \( -type f -o -type l \) -and -not -name openwebmail.conf.sample | \ ${SED} -e 's,^${WRKSRC},www,' | ${SORT} -u >> ${PLIST} pre-install-SPEEDYCGI-off: @${FIND} ${WRKSRC}/*/openwebmail -name "openwebmail*pl" | \ ${SED} -e 's,^${WRKSRC},www,' \ -e 's,openwebmail/openwebmail,openwebmail/.openwebmail,g' \ >> ${TMPPLIST} do-install: @${MKDIR} ${STAGEDIR}${OWCGIDIR} ${STAGEDIR}${OWDATADIR} @(cd ${WRKSRC}/cgi-bin/openwebmail && \ ${COPYTREE_SHARE} . ${STAGEDIR}${OWCGIDIR}) @(cd ${WRKSRC}/data/openwebmail && \ ${COPYTREE_SHARE} . ${STAGEDIR}${OWDATADIR}) @${PERL} ${STAGEDIR}${OWCGIDIR}/misc/test/dbmtest.pl | ${GREP} "^dbm" > ${STAGEDIR}${OWCGIDIR}/etc/dbm.conf @${CHMOD} 4755 ${STAGEDIR}${OWCGIDIR}/openwebmail*pl .include Index: head/mail/openwebmail/files/patch-fix-perl =================================================================== --- head/mail/openwebmail/files/patch-fix-perl (revision 459629) +++ head/mail/openwebmail/files/patch-fix-perl (revision 459630) @@ -1,149 +1,149 @@ diff -ruN openwebmail/openwebmail-read.pl openwebmail-2.53_2/cgi-bin/openwebmail/openwebmail-read.pl --- openwebmail/openwebmail-read.pl 2017-04-24 19:43:15.081986000 +0200 +++ 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/openwebmail-send.pl openwebmail-2.53_2/cgi-bin/openwebmail/openwebmail-send.pl --- openwebmail/openwebmail-send.pl 2017-04-24 19:43:15.085116000 +0200 +++ 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/shares/getmessage.pl openwebmail-2.53_2/cgi-bin/openwebmail/shares/getmessage.pl --- openwebmail/shares/getmessage.pl 2017-04-24 19:43:15.037505000 +0200 +++ 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/shares/mailfilter.pl openwebmail-2.53_2/cgi-bin/openwebmail/shares/mailfilter.pl --- openwebmail/shares/mailfilter.pl 2017-04-24 19:43:15.040213000 +0200 +++ 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}) { ++ if (!ref{$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}) { ++ if (!ref{$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/shares/ow-shared.pl openwebmail-2.53_2/cgi-bin/openwebmail/shares/ow-shared.pl --- openwebmail/shares/ow-shared.pl 2017-04-24 19:43:15.041206000 +0200 +++ 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 }