pymilter icon indicating copy to clipboard operation
pymilter copied to clipboard

mime.py

Open gene-git opened this issue 2 years ago • 7 comments

News file for 0.8.0 says

Move /mime/ and dynip to Milter subpackage

dynip was moved but not mime.py

Should mime.py be moved into Milter/mime.py?

Its ending up in /usr/lib/python3.11/site-packages/mime.py which feels wrong.

gene-git avatar Apr 29 '23 19:04 gene-git

It's been a while since 0.8, but as I recall a lot of things broke when I moved it. I could move it again, and say something in the release notes, and call the new release 1.1. (Slight incompatibility.)

There are workarounds for python email bugs, and the "mimedefang" - which are arguably two different things. If we're going to be renaming things, I might look at separating out the defang stuff.

sdgathman avatar May 01 '23 15:05 sdgathman

I imagine that the import references would also need to be changed as well, since mime would now be part of Milter module instead of mime module - obviously and trivial change to Milter/init.py - but I haven't looked too hard at any code so this is just off the cuff.

And of I assume the 'import Milter' in mime.py would need modifying in some appropriate way as well.

Maybe other stuff?

gene-git avatar May 01 '23 15:05 gene-git

Actually just looked a bit more at code - your suggestion of simply creating a directory 'mime' and moving it there looks like it might be the simplest - that way references to import mime should just work.

The only references in Milter/xxx.py are 2 test programs.

Maybe i'm missing something.

gene-git avatar May 01 '23 15:05 gene-git

Other packages like bmsmilter use mime. The references aren't just in pymilter.

sdgathman avatar May 01 '23 23:05 sdgathman

Hmm. Maybe I could install in both places, and deprecate the old location. @gene-git

sdgathman avatar Jul 17 '23 18:07 sdgathman

I honestly think nothing should be in

 /usr/lib/python3.11/site-packages/mime.py 

Maybe as you suggested, I -think-, put it in

 /usr/lib/python3.11/site-packages/mime/mime.py

add usual __init__.py stuff to make it a module.

That way import mime should continue to work - at least in my setup there is no other package occupying that directory so would be fine

What you think?

gene-git avatar Jul 17 '23 18:07 gene-git

I think it should be its own package, not part of pymilter. It doesn't appear to conflict with anything in Python stdlib:

/usr/lib/python3.11/email/base64mime.py /usr/lib/python3.11/email/quoprimime.py

I think either a single file package:

/usr/lib/python3.11/site-packages/mime.py

Or something else:

usr/lib/python3.11/site-packages/mime/init.py

usr/lib/python3.11/site-packages/mime/mime.py

Is fine.

Scott K

On July 17, 2023 6:53:43 PM UTC, Gene @.***> wrote:

I honestly think nothing should be in

/usr/lib/python3.11/site-packages/mime.py 

Maybe as you suggested, I -think-, put it in

/usr/lib/python3.11/site-packages/mime/mime.py

add usual init.py stuff to make it a module.

That way import mime should continue to work - at least in my setup there is no other package occupying that directory so would be fine

What you think?

kitterma avatar Jul 17 '23 19:07 kitterma