Code Monkey home page Code Monkey logo

mhonarc's People

Contributors

ldidry avatar racke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mhonarc's Issues

Deprecation warnings in Perl 5.12/5.14

Copied from https://rt.cpan.org/Public/Bug/Display.html?id=76857

Hi Earl,

There are some checks for arrays to be defined in MHonArc code, they are
deprecated as of 5.12 and generate warnings.

Attached patch should remove these warnings.

--
Serguei Trouchelle

diff -cr MHonArc-2.6.18.orig/lib/mhamain.pl MHonArc-2.6.18/lib/mhamain.pl
*** MHonArc-2.6.18.orig/lib/mhamain.pl	2011-01-09 08:18:35.000000000 -0800
--- MHonArc-2.6.18/lib/mhamain.pl	2012-04-27 16:31:13.288034000 -0700
***************
*** 1561,1567 ****
  ##	Create Index2MsgId if not defined
  ##
  sub defineIndex2MsgId {
!     if (!defined(%Index2MsgId)) {
  	foreach (keys %MsgId) {
  	    $Index2MsgId{$MsgId{$_}} = $_;
  	}
--- 1561,1567 ----
  ##	Create Index2MsgId if not defined
  ##
  sub defineIndex2MsgId {
!     unless (%Index2MsgId) {
  	foreach (keys %MsgId) {
  	    $Index2MsgId{$MsgId{$_}} = $_;
  	}
diff -cr MHonArc-2.6.18.orig/lib/mhopt.pl MHonArc-2.6.18/lib/mhopt.pl
*** MHonArc-2.6.18.orig/lib/mhopt.pl	2011-01-08 21:13:14.000000000 -0800
--- MHonArc-2.6.18/lib/mhopt.pl	2012-04-27 16:29:39.183188000 -0700
***************
*** 864,870 ****
  ##
  sub update_data_2_1_to_later {
      # we can preserve filter arguments
!     if (defined(%main::MIMEFiltersArgs)) {
  	warn qq/         preserving MIMEARGS...\n/;
  	%readmail::MIMEFiltersArgs = %main::MIMEFiltersArgs;
  	$IsDefault{'MIMEARGS'} = 0;
--- 864,870 ----
  ##
  sub update_data_2_1_to_later {
      # we can preserve filter arguments
!     if (%main::MIMEFiltersArgs) {
  	warn qq/         preserving MIMEARGS...\n/;
  	%readmail::MIMEFiltersArgs = %main::MIMEFiltersArgs;
  	$IsDefault{'MIMEARGS'} = 0;
diff -cr MHonArc-2.6.18.orig/lib/readmail.pl MHonArc-2.6.18/lib/readmail.pl
*** MHonArc-2.6.18.orig/lib/readmail.pl	2011-01-08 21:13:14.000000000 -0800
--- MHonArc-2.6.18/lib/readmail.pl	2012-04-27 16:30:53.558852000 -0700
***************
*** 117,125 ****
  ##  set to true.
  
  %MIMEDecoders			= ()
!     unless defined(%MIMEDecoders);
  %MIMEDecodersSrc		= ()
!     unless defined(%MIMEDecodersSrc);
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMECharSetConverters is the associative array for storing functions
--- 117,125 ----
  ##  set to true.
  
  %MIMEDecoders			= ()
!     unless %MIMEDecoders;
  %MIMEDecodersSrc		= ()
!     unless %MIMEDecodersSrc;
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMECharSetConverters is the associative array for storing functions
***************
*** 153,161 ****
  ##  string.
  
  %MIMECharSetConverters			= ()
!     unless defined(%MIMECharSetConverters);
  %MIMECharSetConvertersSrc		= ()
!     unless defined(%MIMECharSetConvertersSrc);
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEFilters is the associative array for storing functions that
--- 153,161 ----
  ##  string.
  
  %MIMECharSetConverters			= ()
!     unless %MIMECharSetConverters;
  %MIMECharSetConvertersSrc		= ()
!     unless %MIMECharSetConvertersSrc;
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEFilters is the associative array for storing functions that
***************
*** 180,188 ****
  ##  that all functions are defined before invoking MAILread_body.
  
  %MIMEFilters	= ()
!     unless defined(%MIMEFilters);
  %MIMEFiltersSrc	= ()
!     unless defined(%MIMEFiltersSrc);
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEFiltersArgs is the associative array for storing any optional
--- 180,188 ----
  ##  that all functions are defined before invoking MAILread_body.
  
  %MIMEFilters	= ()
!     unless %MIMEFilters;
  %MIMEFiltersSrc	= ()
!     unless %MIMEFiltersSrc;
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEFiltersArgs is the associative array for storing any optional
***************
*** 196,202 ****
  ##  listed for a function if both are applicable.
  
  %MIMEFiltersArgs	= ()
!     unless defined(%MIMEFiltersArgs);
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEExcs is the associative array listing which data types
--- 196,202 ----
  ##  listed for a function if both are applicable.
  
  %MIMEFiltersArgs	= ()
!     unless %MIMEFiltersArgs;
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEExcs is the associative array listing which data types
***************
*** 206,212 ****
  ##	Values => <should evaluate to a true expression>
  
  %MIMEExcs			= ()
!     unless defined(%MIMEExcs);
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEIncs is the associative array listing which data types
--- 206,212 ----
  ##	Values => <should evaluate to a true expression>
  
  %MIMEExcs			= ()
!     unless %MIMEExcs;
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMEIncs is the associative array listing which data types
***************
*** 220,226 ****
  ##  be used to only allow a well-defined set of content-types.
  
  %MIMEIncs			= ()
!     unless defined(%MIMEIncs);
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMECharsetAliases is a mapping of charset names to charset names.
--- 220,226 ----
  ##  be used to only allow a well-defined set of content-types.
  
  %MIMEIncs			= ()
!     unless %MIMEIncs;
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  ##  %MIMECharsetAliases is a mapping of charset names to charset names.
***************
*** 231,237 ****
  ##	Values => real charset name
  ##
  %MIMECharsetAliases = ()
!     unless defined(%MIMECharsetAliases);
  
  ##---------------------------------------------------------------------------
  ##	Text entity-related variables
--- 231,237 ----
  ##	Values => real charset name
  ##
  %MIMECharsetAliases = ()
!     unless %MIMECharsetAliases;
  
  ##---------------------------------------------------------------------------
  ##	Text entity-related variables

Even invoked with -stderr /dev/null, although it quieted most of the noise, it still emits:

defined(%hash) is deprecated at /usr/share/mhonarc/mhamain.pl line 1564.
(Maybe you should just omit the defined()?)
defined(%hash) is deprecated at /usr/share/mhonarc/mhopt.pl line 867.
(Maybe you should just omit the defined()?)

using perl 5.14.2 and MHonArc v2.6.18 from Debian

Wrongly recogniced "^From " in the mail-body

When there is a "From " at the beginning of a line inside the body of the email, it will be recognized as new email from that point. Example output:

Reading /usr/local/src/test_info-0383.mbox .read_mail_body(): Body data loaded into memory
read_mail_body(): Calling readmail::MAILread_body
MAILread_body: charset: us-ascii
Warning: No end boundary delimiter found in message body
MAILread_body: charset: us-ascii
MAILread_body: charset: utf-8
read_mail_body(): readmail::MAILread_body DONE
.
Warning: Could not parse date for message
Message-Id: [email protected]
Date:
read_mail_body(): Body data loaded into memory
read_mail_body(): Calling readmail::MAILread_body
MAILread_body: charset: us-ascii
read_mail_body(): readmail::MAILread_body DONE

Writing mail ..
Writing /usr/local/src/mhonarc/maillist.html ...
Writing /usr/local/src/mhonarc/threads.html ...
Writing database ...
2 new messages
2 total messages

The first "^From " in an email is taken from the email header. The first warning here is coming from the wrongly recognized second "^From " which is inside the body. Therefore it thinks that there had to be an end delimiter before finding the second "From ".

The mistake is coming from not verifying after each "^From " if it is followed by a real eamail address (e. g. containing "@") AND if it has a colon like "^From: "

In my version 2.6.19-2.2 I isolated in the /usr/share/mhonarc/mhamain.pl the area around the line 26637, where it was missleaded:
image

Add missing releases to git tree

According to the README header, and to give more visibility to which releases are missing, there is the list of releases that are missing in the git tree (established from commit names and list releases of CHANGES file):

  • 1.1.0 (http://www.elilabs.com/net/MHonArc1/)
  • 1.1.1
  • 1.2.0
  • 1.2.1
  • 1.2.2
  • 2.0.0 beta 1
  • 2.0.0 beta 2
  • 2.0.0 beta 3
  • 2.0.0
  • 2.1.0
  • 2.1.1
  • 2.3.0
  • 2.3.1
  • 2.3.2
  • 2.4.0
  • 2.4.1
  • 2.4.2
  • 2.4.3
  • 2.4.4
  • 2.4.5
  • 2.4.6
  • 2.4.7
  • 2.4.8
  • 2.5.0b
  • 2.5.0b2
  • 2.5.0
  • 2.5.1
  • 2.5.2
  • 2.5.3
  • 2.5.4
  • 2.5.5
  • 2.5.6
  • 2.5.7
  • 2.5.8
  • 2.5.9
  • 2.5.11
  • 2.5.13
  • 2.6.17 (as @ikedas indicated, it's not sure about it's existence since 2.6.18 was released the same day)

Feel free to modify this issue in the future to reflect new changes or to add unlisted release.

Incorrect FSF address in COPYING file

The FSF address currently referenced in the COPYING file is:
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

The correct address is:
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

Found with rpmlint.

Time for a new release

  • Merge develop into master
  • Update CHANGES
  • Update version number to 2.6.20 in MHonArc.pm
  • Create tarball (perl Makefile.PL; make; make tardist) and upload it to PAUSE¹
  • Merge master into develop
  • Rebase pending PR with develop if needed
  • Close the relative milestone

¹ Need for the community to have co-maintainership of MHonArc on PAUSE

Content-Description fields are omitted with inline images

Version

2.6.24 and earlier

Installation method

Any

Expected behavior

When an image part with Content-Description field is archived, e.g.:

Content-type: image/jpeg; name="image.jpg"
Content-Description: This is a JPEG file
Content-Disposition: inline; filename="image.jpg"
Content-transfer-encoding: base64

XXXX

Output should contain the description, i.e.:

  • For the inline image (Content-Disposition: inline):
    <p>This is a JPEG file</p>
    <p><a href="..." ><img src="..." alt="JPEG image"></a></p>
  • For the attachment (Content-Disposition: attachment, or non-images):
    <p><strong>Attachment:
    <a href="..." ><tt>image.jpg</tt></a></strong><br>
    <em>Description:</em> This is a JPEG file</p>

Actual behavior

With inline image, Content-Description is omitted.

  • For the inline image (Content-Disposition: inline):
    <p><a href="..." ><img src="..." alt="JPEG image"></a></p>

Author Sort Secondary Sort is Wrong

This is a repeat of bug #42323 submitted in 2014.

When sorting by author (<AUTHSORT>), the secondary sort key (date) is incorrect (random dates).

--- mhutil-dist.pl	2020-11-16 09:17:01
+++ mhutil.pl	2023-08-05 23:52:48
@@ -282,7 +282,7 @@
         } else {
             return sort {
                        ($from{$a} cmp $from{$b})
-                    || ($Time{$a} <=> $Time{$a})
+                    || ($Time{$a} <=> $Time{$b})
             } keys %Subject;
         }

mhtuil.pl.patch

Missing MHonArc module

Installation:

cpanm MHonArc::UTF8

Executing mhonarc:

Can't locate MHonArc.pm in @INC (you may need to install the MHonArc module) (@INC contains: lib /home/racke/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/x86_64-linux /home/racke/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0 /home/racke/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/x86_64-linux /home/racke/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0) at /home/racke/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/mhamain.pl line 29.
BEGIN failed--compilation aborted at /home/racke/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/mhamain.pl line 29

Add tests

It would be really useful if we had a test suite to verify that we don’t modify the behavior of the module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.