On 2020-06-01 at 18:34 +0200, Herr Oswald wrote:
> pkg_resources.DistributionNotFound: The 'mboxattachments==0.5.35'
> distribution was not found and is required by the application
> 
> Can somebody give me a useful hint?
> 
> Cheers,
> Wolf

The error suggests the python package wasn't installed properly, since
it is complaining it cannot find itself.

Once you make it work, it currently only deals with mbox files, but it
is easy to make it work with Maildirs, the code is "almost there". Just
a couple of lines to create a mailbox.Maildir instead of a mailbox.mbox.
See the attached patch.

I'm copying the upstream author so he can integrate the change into the
module.

Best regards


--- mboxattachments.py	2020-06-02 01:34:19.784170000 +0200
+++ mboxattachments.py	2020-06-02 01:37:16.055170000 +0200
@@ -243,14 +243,19 @@
      
 
             
-    def filter_mbox(self, obj):
+    def filter_mailbox(self, obj):
         """ Filter a mbox file or mailbox.mbox instance. """
         if isinstance(obj, str):
             if os.path.isfile(obj):
                 obj = mailbox.mbox(obj)
+            elif os.path.isdir(obj):
+                obj = mailbox.Maildir(obj)
+            else
+                return
+
         for mail in obj:
             self.filter_mail(mail)
-        if isinstance(obj, mailbox.mbox):
+        if isinstance(obj, mailbox.Mailbox):
             obj.close()
 
     def filter_mail(self, mail):
@@ -545,7 +550,7 @@
                       debugging=debugging, SQstart=SQstart)
         
         for mbox in args:
-            filt.filter_mbox(mbox)
+            filt.filter_mailbox(mbox)
      
         print("\n\n%s emails were filtered, %s emails passed, "
             "\nprocessing of %s emails failed, "
_______________________________________________
evolution-list mailing list
[email protected]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list

Reply via email to