Bug 242729 - mail/openwebmail generates lots of perl errors; some prevent it from working
Summary: mail/openwebmail generates lots of perl errors; some prevent it from working
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-19 16:10 UTC by William F. Dudley Jr.
Modified: 2019-12-19 16:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William F. Dudley Jr. 2019-12-19 16:10:01 UTC
openwebmail generates the following errors and warnings.  The first one (the error) prevents replying to an email:

.openwebmail-send.pl: Can't use an undefined value as a HASH reference at /usr/local/www/cgi-bin/openwebmail/.openwebmail-send.pl line 534.: /usr/local/www/cgi-bin/openwebmail/openwebmail-send.pl

I "fixed" this by making this change:

6,8d5
< $CGI::LIST_CONTEXT_WARN = 0;
< use File::Basename;
< use lib dirname (__FILE__);
537c534
<             if ( defined {$message{attachment}[1]} &&
---
>             if ( %{$message{attachment}[1]} &&

(I cribbed this fix from the similar fix done to .openwebmail-read.pl)


ALL of the .openwebmail*.pl files generate the following warning:

.openwebmail-main.pl: CGI::param called in list context from /usr/local/www/cgi-bin/openwebmail/.openwebmail-main.pl line 80, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/local/lib/perl5/site_perl/CGI.pm line 412.

.openwebmail.pl: CGI::param called in list context from /usr/local/www/cgi-bin/openwebmail/.openwebmail.pl line 569, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/local/lib/perl5/site_perl/CGI.pm line 412.: /usr/local/www/cgi-bin/openwebmail/openwebmail.pl, referer: https://mail.casano.com/cgi-bin/openwebmail/openwebmail.pl

etc. etc.

The fix for the warning is to add this fragment to each of the .openwebmail*.pl files somewhere near the top:

$CGI::LIST_CONTEXT_WARN = 0;

I also add these as a matter of course:

use File::Basename;
use lib dirname (__FILE__);

So that "use" of any local files will still work.