Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious MHonArc Search warnings for undefined search parameters #613

Closed
pkissman opened this issue May 14, 2019 · 3 comments
Closed

Spurious MHonArc Search warnings for undefined search parameters #613

pkissman opened this issue May 14, 2019 · 3 comments
Assignees
Labels
bug ready A PR is waiting to be merged. Close to be solved
Milestone

Comments

@pkissman
Copy link

pkissman commented May 14, 2019

Version

Version 6.2.42

Installation method

Installed from Source on a Debian 9 System

Expected behavior

No warnings when MHonArc archives are searched.

Actual behavior

Many warnings populate error log when archives are searched for undefined parameters: $subj, $date, $from, $id.

When someone does archive searching, our log files fill up with warnings such as:

[Tue May 14 09:19:44.283239 2019] [fcgid:warn] [pid 23730] [client <ipaddress>:4878] mod_fcgid: stderr: [Tue May 14 09:19:44 2019] wwsympa.fcgi: Use of uninitialized value $subj in substitution (s///) at /usr/local/sympa/bin/Sympa/WWW/Marc/Search.pm line 307., referer: <website>/sympa

Additional information

I made some changes to /sympa/bin/Sympa/WWW/Marc/Search.pm that seems to solve the issue, but was not confident to submit a patch.

--- Search.pm   2019-05-14 10:36:27.205977640 -0400
+++ Search.pm_dist      2019-05-14 09:12:25.280414786 -0400
@@ -304,20 +304,18 @@
                 last if (/-->/);
             }
         }
+        $subj =~ s/ *-->$//;
 
-        if($subj) { $subj =~ s/ *-->$//; }
-
-               ($from = (<$fh> // '') ) =~ s/^<!--X-From-R13: (.*) -->/$1/;
-
+        ($from = <$fh>) =~ s/^<!--X-From-R13: (.*) -->/$1/;
 
         ## No more need to decode header fields
         #$from = &MIME::Words::decode_mimewords($from);
 
         $from =~ tr/N-Z[@A-Mn-za-m/@A-Z[a-z/;
 
-               ($date = ( <$fh> // '') ) =~ s/^<!--X-Date: (.*) -->/$1/;
+        ($date = <$fh>) =~ s/^<!--X-Date: (.*) -->/$1/;
 
-               ($id = (<$fh> // '') ) =~ s/^<!--X-Message-Id: (.*) -->/$1/;
+        ($id = <$fh>) =~ s/^<!--X-Message-Id: (.*) -->/$1/;
 
         if ($body) {
             my $lines = '';
@ikedas ikedas added the bug label May 14, 2019
@ldidry ldidry changed the title Spurious Marc Search warnings for undefined search parameters Spurious MHonArc Search warnings for undefined search parameters May 17, 2019
ldidry added a commit to ldidry/sympa that referenced this issue May 17, 2019
@ldidry
Copy link
Contributor

ldidry commented May 17, 2019

I created a PR with a more simple solution: #618

@ldidry ldidry self-assigned this May 17, 2019
@ldidry ldidry added the ready A PR is waiting to be merged. Close to be solved label May 17, 2019
@ldidry
Copy link
Contributor

ldidry commented May 17, 2019

@pkissman
Copy link
Author

@ldidry , Yes. this patch appears to work. I've never actually bothered to look at a MHonarc message file before. So I learned something new. Thank you for cleaning up and simplifying a solution.

@ikedas ikedas added this to the 6.2.44 milestone May 27, 2019
@ikedas ikedas closed this as completed in f808eeb Jun 3, 2019
ikedas added a commit that referenced this issue Jun 3, 2019
Fix #613 — Avoid MHonArc’s search warning flood
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready A PR is waiting to be merged. Close to be solved
Projects
None yet
Development

No branches or pull requests

3 participants