sympa-community / mhonarc Goto Github PK
View Code? Open in Web Editor NEWA mail-to-HTML converter
License: GNU General Public License v2.0
A mail-to-HTML converter
License: GNU General Public License v2.0
Like:
no warnings qw(deprecated);
unshift(@INC, 'lib');
(See this comment for beginning of discussion)
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
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:
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):
Feel free to modify this issue in the future to reflect new changes or to add unlisted release.
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.
develop
into master
perl Makefile.PL; make; make tardist
) and upload it to PAUSE¹master
into develop
develop
if needed¹ Need for the community to have co-maintainership of MHonArc on PAUSE
2.6.24 and earlier
Any
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.:
Content-Disposition: inline
):
<p>This is a JPEG file</p>
<p><a href="..." ><img src="..." alt="JPEG image"></a></p>
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>
With inline image, Content-Description is omitted.
Content-Disposition: inline
):
<p><a href="..." ><img src="..." alt="JPEG image"></a></p>
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;
}
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
The BUGS file refers to (really) old URLs for bug reporting.
We should either update or remove it.
It would be really useful if we had a test suite to verify that we don’t modify the behavior of the module.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.