You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/12/12 00:41:54 UTC
[incubator-ponymail-foal] branch master updated: Update version
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new cad41c8 Update version
cad41c8 is described below
commit cad41c8cfc0f35caacadfee403ab29fdcfb86cda
Author: Sebb <se...@apache.org>
AuthorDate: Sun Dec 12 00:41:42 2021 +0000
Update version
---
server/server_version.py | 2 +-
test/resources/anal.py | 55 +++++++++++++++++++
test/resources/msgids.dat | 3 ++
test/resources/ref2.eml | 120 ++++++++++++++++++++++++++++++++++++++++++
test/resources/refs.eml | 8 +++
test/resources/rfc2822-A5.eml | 34 ++++++++++++
test/test_archiver.py | 58 ++++++++++++++++++++
test/test_msgid.py | 35 ++++++++++++
8 files changed, 314 insertions(+), 1 deletion(-)
diff --git a/server/server_version.py b/server/server_version.py
index 4496987..3171135 100644
--- a/server/server_version.py
+++ b/server/server_version.py
@@ -1,2 +1,2 @@
# This file is generated by server/update_version.sh
-PONYMAIL_SERVER_VERSION = 'e080f7f'
+PONYMAIL_SERVER_VERSION = '89151e6'
diff --git a/test/resources/anal.py b/test/resources/anal.py
new file mode 100755
index 0000000..733692d
--- /dev/null
+++ b/test/resources/anal.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python3
+
+import sys
+import email
+import gzip
+from email.policy import default
+
+class MyHeaderClass(email.headerregistry.UnstructuredHeader):
+ @classmethod
+ def parse(cls, value, kwds):
+ print("Input:" + value)
+ super().parse(value.lstrip(), kwds)
+ print(kwds)
+
+# print(default.header_factory)
+policy = default.clone()
+policy.header_factory.map_to_type('references', MyHeaderClass)
+policy.header_factory.map_to_type('message-id', MyHeaderClass)
+
+def process(f):
+ msg = email.message_from_binary_file(f, policy=policy)
+
+ # print(msg.defects)
+ # for item in msg.raw_items():
+ # print(item)
+ # N.B. This may repeat keys
+ for key,val in msg.items():
+ print()
+ print(key)
+ print(val.__class__)
+ print(val.defects)
+ print(val)
+ # for k,v in email.header.decode_header(val):
+ # if v is None or v.find("8bit") != -1:
+ # if isinstance(k, bytes):
+ # print([key, k,v])
+ # sys.exit(1)
+ # else:
+ # print([key,k,v])
+ # sys.exit(1)
+ # print(val.defects)
+ # print(val.__class__)
+ # if isinstance(val, email.headerregistry.AddressHeader):
+ # for addr in val.addresses:
+ # print(addr)
+ # else:
+
+for file in sys.argv[1:]:
+ print(file)
+ if file.find(".gz") != -1:
+ with gzip.open(file,'rb') as gp:
+ process(gp)
+ else:
+ with open(file, 'rb') as fp:
+ process(fp)
diff --git a/test/resources/msgids.dat b/test/resources/msgids.dat
new file mode 100644
index 0000000..e887252
--- /dev/null
+++ b/test/resources/msgids.dat
@@ -0,0 +1,3 @@
+References:
+ <1083063521.21556.232.camel@23.13 yum.ot yum <40...@outerthought.org>
+Message-Id: <1083071596.28238.264.camel@23.13 yum.ot yum
diff --git a/test/resources/ref2.eml b/test/resources/ref2.eml
new file mode 100644
index 0000000..ccb2efd
--- /dev/null
+++ b/test/resources/ref2.eml
@@ -0,0 +1,120 @@
+From dev-return-367894-apmail-lucene-dev-archive=lucene.apache.org@lucene.apache.org Sat Nov 30 20:27:58 2019
+Return-Path: <de...@lucene.apache.org>
+X-Original-To: apmail-lucene-dev-archive@www.apache.org
+Delivered-To: apmail-lucene-dev-archive@www.apache.org
+Received: from mail.apache.org (hermes.apache.org [207.244.88.153])
+ by minotaur.apache.org (Postfix) with SMTP id 7D21010F81
+ for <ap...@www.apache.org>; Sat, 30 Nov 2019 20:27:58 +0000 (UTC)
+Received: (qmail 34553 invoked by uid 500); 30 Nov 2019 20:27:55 -0000
+Delivered-To: apmail-lucene-dev-archive@lucene.apache.org
+Received: (qmail 34493 invoked by uid 500); 30 Nov 2019 20:27:55 -0000
+Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm
+Precedence: bulk
+List-Help: <ma...@lucene.apache.org>
+List-Unsubscribe: <ma...@lucene.apache.org>
+List-Post: <ma...@lucene.apache.org>
+List-Id: <dev.lucene.apache.org>
+Reply-To: dev@lucene.apache.org
+Delivered-To: mailing list dev@lucene.apache.org
+Received: (qmail 34482 invoked by uid 99); 30 Nov 2019 20:27:55 -0000
+Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142)
+ by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Nov 2019 20:27:55 +0000
+Received: from localhost (localhost [127.0.0.1])
+ by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 724FA1A1859
+ for <de...@lucene.apache.org>; Sat, 30 Nov 2019 20:27:54 +0000 (UTC)
+X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org
+X-Spam-Flag: NO
+X-Spam-Score: 1.507
+X-Spam-Level: *
+X-Spam-Status: No, score=1.507 tagged_above=-999 required=6.31
+ tests=[FROM_FMBLA_NEWDOM=1.499, KAM_DMARC_STATUS=0.01,
+ SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled
+Received: from mx1-ec2-va.apache.org ([10.40.0.8])
+ by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024)
+ with ESMTP id n_-8ZdyC0rBg for <de...@lucene.apache.org>;
+ Sat, 30 Nov 2019 20:27:53 +0000 (UTC)
+Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=54.67.1.252; helo=bilbo.elyograg.org; envelope-from=apache@elyograg.org; receiver=<UNKNOWN>
+Received: from bilbo.elyograg.org (bilbo.elyograg.org [54.67.1.252])
+ by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTP id 36CFCBC52D
+ for <de...@lucene.apache.org>; Sat, 30 Nov 2019 20:27:53 +0000 (UTC)
+Received: from localhost (localhost [127.0.0.1])
+ by bilbo.elyograg.org (Postfix) with ESMTP id 47QNGp1GJQz7l3r
+ for <de...@lucene.apache.org>; Sat, 30 Nov 2019 13:27:46 -0700 (MST)
+Received: from bilbo.elyograg.org ([127.0.0.1])
+ by localhost (bilbo@elyograg.org [127.0.0.1]) (amavisd-new, port 10024)
+ with ESMTP id Xt9CDh4Ym4wW for <de...@lucene.apache.org>;
+ Sat, 30 Nov 2019 13:27:44 -0700 (MST)
+Received: from [192.168.1.105] (170-72-4-30.ut.vivintwireless.net [170.72.4.30])
+ (Authenticated sender: elyograg@elyograg.org)
+ by bilbo.elyograg.org (Postfix) with ESMTPSA id 47QNGm27Swz7l3d
+ for <de...@lucene.apache.org>; Sat, 30 Nov 2019 13:27:44 -0700 (MST)
+Subject: Re: Commit / Code Review Policy
+To: dev@lucene.apache.org
+References: <CA...@mail.gmail.com>
+ <CA...@mail.gmail.com>
+From: Shawn Heisey <ap...@elyograg.org>
+Message-ID: <4f...@elyograg.org>
+Date: Sat, 30 Nov 2019 13:27:45 -0700
+User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
+ Thunderbird/68.2.2
+MIME-Version: 1.0
+In-Reply-To: <CA...@mail.gmail.com>
+Content-Type: text/plain; charset=utf-8; format=flowed
+Content-Language: en-US
+Content-Transfer-Encoding: 7bit
+
+On 11/30/2019 7:39 AM, Robert Muir wrote:
+> -1 ... you even went so far as to discourage lucene committers from
+> attending that meeting, and now its turned around as if its consensus
+> everywhere and should be applied to lucene too?
+>
+> I don't think changing things to review-then-commit will help.
+
+I did attend the meeting, and I think committers who concentrate on
+Lucene should not be discouraged from attending any similar future
+meetings. Discussions in a meeting about Solr are not very likely to
+dive down that far into the inner workings, but even if they don't, some
+Lucene people might find the the talk about Solr to be interesting, and
+having their perspective available would not be a bad thing.
+
+I'm very wary of making an official change to review-then-commit. I
+fully support the ideas that went into the proposal, but I think making
+it mandatory for all commits is going to really slow things down and
+cause some problems. It's not the way most Apache projects work, and it
+makes it a LOT harder to do quick sanity edits like fixing spelling errors.
+
+As much as I really like the idea of more frequent reviews, I think that
+review requirements should be informal.
+
+Most of the time a committer will know whether the changes they are
+working on fall into a "major" or "minor" category. When it's leaning
+more towards major, I think most of us will agree that a few extra
+eyeballs looking for gotchas is a really good idea. TLDR note: The
+number of lines in a change is sometimes NOT an indicator of how major
+the change is.
+
+I certainly want to seek a "looks good to me" on changes I make which
+have any significant impact. For some of the ideas I have, if those
+ever reach the implementation phase, I think I'd want even more
+assurance that I'm not doing it wrong. I can pledge that I will seek
+review for non-trivial changes. I wonder if there is wording we can add
+to any official project rulebook to make such a thing mandatory, without
+a full switch.
+
+I think that a full switch to review-then-commit (RTC) would be the
+wrong thing to do. I think it would lead to a lot of dissent within the
+project, encouraging rivalries and cliques within the project.
+
+If RTC is preferred by a significant majority, I will work within that
+paradigm ... but I think that it would be a short-lived experiment and
+we would be back to CTR pretty quickly.
+
+Is it possible to vote -0.5 instead of -1? I don't think it is.
+
+Thanks,
+Shawn
+
+---------------------------------------------------------------------
+To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
+For additional commands, e-mail: dev-help@lucene.apache.org
+
diff --git a/test/resources/refs.eml b/test/resources/refs.eml
new file mode 100644
index 0000000..ee43361
--- /dev/null
+++ b/test/resources/refs.eml
@@ -0,0 +1,8 @@
+Message-Id: <1083144246.26036.1.camel@23.13N
+ yum.otN
+ yum
+References:
+ <1083063521.21556.232.camel@23.13 yum.ot yum> <40...@outerthought.org>
+ <1083071596.28238.264.camel@23.13 yum.ot yum <40...@apache.org>
+Message-ID:
+ <te...@silly.test>
diff --git a/test/resources/rfc2822-A5.eml b/test/resources/rfc2822-A5.eml
new file mode 100644
index 0000000..7308f46
--- /dev/null
+++ b/test/resources/rfc2822-A5.eml
@@ -0,0 +1,34 @@
+From: Pete(A wonderful \) chap) <pete(his account)@silly.test(his host)>
+Sender: Pete(A wonderful \) chap) <pete(his account)@silly.test(his host)>
+To:A Group(Some people)
+ :Chris Jones <c@(Chris's host.)public.example>,
+ joe@example.org,
+ John <jd...@one.test> (my dear friend); (the end of the group)
+Cc:(Empty list)(start)Undisclosed recipients :(nobody(that I know)) ;
+Cc: cliffs@steam.com (Cliff Skolnick)
+Date: Thu,
+ 13
+ Feb
+ 1969
+ 23:32
+ -0330 (Newfoundland Time)
+Message-ID:
+ <te...@silly.test>
+References:
+ <1083063521.21556.232.camel@23.13 yum.ot yum> <40...@outerthought.org>
+ <1083071596.28238.264.camel@23.13 yum.ot yum <40...@apache.org>
+X-Message-Id: <1083144246.26036.1.camel@23.13 yum.ot yum
+Message-Id: <1083144246.26036.1.camel@23.13
+ yum.ot
+ yum
+X-modmbox: cocoon-dev/200404.mbox/raw/%3c1083144246.26036.1.camel@23.13%20%09yum.ot%20%09yum
+Message-Id: <00...@qq.com>+A3E5F732394C9F6E
+X-Message-Id: <00...@qq.com>+A3E5F732394C9F6E
+Message-Id: <61...@re-prd-rgout-005.btmx-prd.synchronoss.net> (added by postmaster@btinternet.com)
+X-Message-Id: <61...@re-prd-rgout-005.btmx-prd.synchronoss.net> (added by postmaster@btinternet.com)
+Subject: This
+ is
+ a
+ test7
+
+Testing.
diff --git a/test/test_archiver.py b/test/test_archiver.py
new file mode 100644
index 0000000..ea1982c
--- /dev/null
+++ b/test/test_archiver.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+# To be run as: python3 -m pytest test/test_archiver.py
+# This ensures sys.path is set up correctly
+
+import sys
+import email.errors
+import email.header
+import email.utils
+from tools import archiver
+
+def show(dict):
+ for key in dict.keys():
+ print("%s: %s" % (key, dict[key]))
+
+def test_archiver_1():
+ print("---------",file=sys.stderr)
+ archie = archiver.Archiver(
+
+ )
+ list_override = 'a.b.c.d'
+ private = False
+ file = open("test/resources/rfc2822-A5.eml","rb")
+ message_raw = file.read()
+ message = email.message_from_bytes(message_raw, policy=email.policy.SMTPUTF8)
+ json, contents, _msgdata, _irt, skipit = archie.compute_updates(
+ list_override, private, message, message_raw
+ )
+ print("--json--")
+ show(json)
+ print("--contents--")
+ print(contents)
+ print("--_msgdata--")
+ show(_msgdata)
+ print("--_irt--")
+ print(_irt)
+ print("--skipit--")
+ print(skipit)
+ # assert False, json
+
+test_archiver_1()
\ No newline at end of file
diff --git a/test/test_msgid.py b/test/test_msgid.py
new file mode 100755
index 0000000..39ddd11
--- /dev/null
+++ b/test/test_msgid.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+
+import sys
+import email
+import gzip
+from email.policy import default
+from email.policy import compat32
+
+class MyHeaderClass(email.headerregistry.UnstructuredHeader):
+ @classmethod
+ def parse(cls, value, kwds):
+# print("Input:" + value)
+ super().parse(value.lstrip(), kwds)
+# print(kwds)
+
+# print(default.header_factory)
+policy = default.clone()
+policy.header_factory.map_to_type('references', MyHeaderClass)
+policy.header_factory.map_to_type('message-id', MyHeaderClass)
+
+def process(f):
+ msg = email.message_from_binary_file(f, policy=policy)
+ # N.B. This may repeat keys
+ for key,val in msg.items():
+ print()
+ print(key, val)
+
+for file in sys.argv[1:]:
+ print(file)
+ if file.find(".gz") != -1:
+ with gzip.open(file,'rb') as gp:
+ process(gp)
+ else:
+ with open(file, 'rb') as fp:
+ process(fp)