Email scan loses messages

View: New views
1 Messages — Rating Filter:   Alert me  

Email scan loses messages

by dmark :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have patiently explained this (several times) to Bruce Winter and others.  It must not be sinking in.

The "logic" here says that if the total number of messages available from the POP3 server is less than it was before, there are no new messages available.  This makes no sense at all.  If n new messages came in and n "rolled off", the total will obviously be the same as last time.  How stupid can this thing get?  And this is not theory, I have ran this scan before and watched it skip messages.  I finally tore it up and rewrote it (like most of the rest of this project.)

# If count is < last time, assume we have read previous messages and reset for next pass
                                # If count is > last time, read only new messages
        my $msgcnt_prev = @{$email_prev{$account}} if $email_prev{$account};
        if (defined $msgcnt and $msgcnt < $msgcnt_prev) {
            delete $email_prev{$account};
            unlink("$config_parms{data_dir}/email/latest.html");


            $msgcnt = 0;
        }
        elsif ($msgcnt > $msgcnt_prev) {
       $msg_inbox_total = $msgcnt;
            print "There are $msgcnt mail messages for $account\n"  unless $config_parms{quiet};

And look at this:

if ($body =~ /^(.*?)<html>(.*)$/is) {
                        $body = "<pre>$1</pre>\n<html><p>\n$2";
#                       $body = "<div>$body</div>";  # Try to bound bad/untermintated html tags ... doesn't help
                    }
                    else {
                        $body = encode_entities $body;
                        $body = "<pre>$body</pre>";
                    }

Yecch.  This is inept and dangerous.  DO NOT use the Web pages generated by this script.  This is the MH "state of the art" MIME decoding (searching for <html> in the body), so don't expect scans based on keywords in the subject line, body, etc. to work (it doesn't unfold the headers at all, so long subjects are chopped off.)

And yes, I have told them about these shortcomings.  Furthermore, I have a fix for the scan, but the basic attitude on this project seems to be "see no evil, hear no evil, etc."  MIME decoding?  I wrote the book on that and yes, I wrote a PERL treatment for use with this project.  But the resident "geniuses" seem to think they have things under control. (?!)

Again, DO NOT use the "alphabet soup" HTML that is spit out by this script.  This is especially true for Windows users, where security settings for local content will often allow malicious scripts to function unimpeded (that's why email is part of the "Internet Zone.")

Here is the change log for this script, dating back to the Milennium.

# $Log: get_email,v $
# Revision 1.37  2004/11/22 22:57:17  winter
# *** empty log message ***
#
# Revision 1.36  2004/03/23 01:58:04  winter
# *** empty log message ***
#
# Revision 1.35  2003/11/23 20:25:50  winter
#  - 2.84 release
#
# Revision 1.34  2003/09/02 02:48:43  winter
#  - 2.83 release
#
# Revision 1.33  2003/06/01 21:54:39  winter
#  - 2.81 release
#
# Revision 1.32  2003/04/20 21:43:57  winter
#  - 2.80 release
#
# Revision 1.31  2002/11/10 01:59:54  winter
# - 2.73 release
#
# Revision 1.30  2002/09/22 01:33:22  winter
# - 2.71 release
#
# Revision 1.29  2002/05/28 13:07:47  winter
# - 2.68 release
#
# Revision 1.28  2001/12/16 21:48:40  winter
# - 2.62 release
#
# Revision 1.27  2001/11/18 22:51:42  winter
# - 2.61 release
#
# Revision 1.26  2001/10/21 01:22:31  winter
# - 2.60 release
#
# Revision 1.25  2001/06/27 03:45:11  winter
# - 2.54 release
#
# Revision 1.24  2001/03/24 18:08:37  winter
# - 2.47 release
#
# Revision 1.23  2001/02/04 20:31:30  winter
# - 2.43 release
#
# Revision 1.22  2000/12/21 18:54:14  winter
# - 2.38 release
#
# Revision 1.21  2000/12/03 19:38:50  winter
# - 2.36 release
#
# Revision 1.20  2000/11/12 21:01:02  winter
# - 2.34 release
#
# Revision 1.19  2000/10/01 23:35:24  winter
# - 2.29 release
#
# Revision 1.18  2000/08/06 21:56:43  winter
# - See 2.24 release notes.
#
# Revision 1.17  2000/05/06 16:39:05  winter
# - 2.15 release
#
# Revision 1.16  2000/04/09 18:03:19  winter
# - 2.13 release
#
# Revision 1.15  2000/02/20 04:47:54  winter
# -2.01 release

Nothing at all.  And this is the guy with my updates in his "to do" list.  At this rate, this project will just fade away as a never-quite-was.  You can't call it a has-been as it has never really been anything.