Re: Questions about the python3 version of TMDA

Hippo Man <[email protected]> Thu, 2 Jun 2022 01:44:23 -0400
Newsgroups gmane.mail.spam.tmda.user
Message-ID <CAK1LP6k6nKAG-kje95PEruCmaCytMfhJy2ta7oHQeTCXNa1scg@mail.gmail.com>
--===============4234636817817861484==
Content-Type: multipart/alternative; boundary="0000000000002f54c205e070802e"

--0000000000002f54c205e070802e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> I really tried to get TMDA working with python3 but eventually I gave up
> and decided to just stick with python2. Admittedly, my python skills are
> poor, and I didn't want to spend more hours trying to get it to work.
>
> Hopefully you'll make better progress than I did!
>
> Chris
>

Thank you!

And yes, I understand, I spent way, *way* too much time trying to convert
the original Python 2 TMDA code to Python 3. It ended up being a big
mess, and I finally gave up.

However, it turns out that the C=C3=A9dric Dufour version runs under Python=
 3.
I decided to take the plunge and try it, and I very easily got it to work!!=
!
... as follows:

% cd [work directory]

% git clone https://github.com/cedric-dufour/tmda.git

% cd tmda

% sudo python3 setup.py install

This installs the Python 3 TMDA executables into /usr/local/bin , and they
all work for me!  It turns out that the "debian" subdirectory that I was
asking about in my previous message is totally irrelevant. The only
purpose of that subdirectory is for facilitating the creation of a debian
APT package for TMDA. There is no need to do that, since the steps I
outlined above will perform a full TMDA installation on your own linux
machine.

After performing those steps, I only had to make one tiny change to my
existing TMDA configuration:

Near the top of /etc/tmdarc is the following line of code:
os.makedirs(LOGDIR, 0755)

That simply needs to be changed to this:
os.makedirs(LOGDIR, 0o755)

(*i.e.*, put a lower-case letter "o" between the zero and the seven)

Some of my own scripts had to be changed, because I had the original
Python 2 TMDA code in /usr/local/tmda/bin, and I had to change a small
number of references to that directory into /usr/local/bin. But to be
clear,
those changes are in my own code which *calls* TMDA executables ...
not in any of the Python 3 TMDA code itself.

One caveat is that I do not use TMDA for challenge-response these
days, and I have never used it for tagging ... only for whitelisting, for
blacklisting, and for putting unfamiliar messages into the Pending queue
so I can inspect them via the TMDA-cgi web software and decide what
to do with them. Therefore, I don't know if you would encounter
challenge-response or tagging issues. However, given how well the
Python 3 version is working for me, I am optimistic that those functions
would also probably work.

If you or anyone else want to try this Python 3 version of TMDA, and
if problems are encountered, I'm glad to offer whatever help I can here
in this mailing list.
<https://github.com/cedric-dufour/tmda.git>
--=20
 [email protected]
 Take a hippopotamus to lunch today.



>
> On Wed, 1 Jun 2022, Hippo Man wrote:
> > I have done a "git clone" of the python3 version of TMDA from here:
> > https://github.com/cedric-dufour/tmda.git
> >
> > And I have done a "python3 setup.py install".
> >
> > I see that it created a TMDA directory tree under /opt/local/share/tmda
> >
> > In the cloned git directory, there is also a "debian" subdirectory, and
> since
> > I am running under Debian-11, I want to install that debian-specific
> code.
> > However, this debian code was not installed anywhere after my run of
> > "python3 setup.py install", and I could not find any instructions for h=
ow
> > to install that debian code.
> >
> > Futhermore, in the documentation that came with this TMDA version,
> > there are a few references to http://wiki.tmda.net, but that web site
> > no longer exists.
> >
> > Is there any place where I could find instructions for how to do a full=
,
> > complete TMDA install of this python3 version on my Debian host?
> >
> > Thanks in advance for any pointers and help!
> >
> > --
> >  [email protected]
> >  Take a hippopotamus to lunch today.
> >
> >
> > On Wed, Jun 1, 2022 at 10:14 AM Hippo Man <[email protected]> wrote:
> >       Thank you very much.
> >
> > And I'm glad to see that this mailing list is actually still alive!
> >
> > Also, I went to your github site, and see that there are links there fo=
r
> two
> > Python3 forks. TMDA is the only Python2 code on my server, and I very
> > much want to get rid of Python2 completely. I'm going to check out both
> of
> > those Python3 TMDA forks, and I'm happy that they exist.
> >
> > --
> >  [email protected]
> >  Take a hippopotamus to lunch today.
> >
> >
> > On Wed, Jun 1, 2022 at 1:17 AM Chris Caputo <[email protected]> wrote:
> >       Nice work!
> >
> >       BTW, I maintain https://github.com/ccaputo/TMDAretro in case
> anyone has
> >       trouble installing TMDA these days.
> >
> >       Chris
> >
> >       On Tue, 31 May 2022, Hippo Man wrote:
> >       > I figured out the answer to my question.
> >       >
> >       > In case anyone might come to this mailing list some
> >       > day and wants to know how I solved my problem, here
> >       > is how I did so ...
> >       >
> >       > I can implement item #2 in my list below by means of
> >       > an "incoming" filter. I created a "holdlist" file to contain
> >       > match patterns for the set of addresses that I want to
> >       > automatically put into a pending state, and I put the
> >       > following rule into my incoming filter ...
> >       >
> >       > from-file ~/.tmda/lists/holdlist hold
> >       >
> >       > Now, I have succcessfully implemented all three items
> >       > in my list.
> >       > --
> >       >  [email protected]
> >       >  Take a hippopotamus to lunch today.
> >       >
> >       >
> >       > On Mon, May 30, 2022 at 7:51 PM Hippo Man <[email protected]>
> wrote:
> >       >       I've been using TMDA for something like 15 years, and I a=
m
> still
> >       > getting lots of benefit from it and am still very happy with it=
.
> >       >
> >       > If there is anyone who is actually reading this email list thes=
e
> days,
> >       > I have a question about the use of TMDA.
> >       >
> >       > My question is this: I want to set up the following filtering
> rules ...
> >       >
> >       > (1) If the sender's email address is on a very small list (less
> than a
> >       > dozen entries), I'd like the sender to be blacklisted.
> >       >
> >       > (2) if the sender's email address is on a very small list (less
> than a
> >       > dozen entries), I'd like the email to be held in the pending
> queue.
> >       >
> >       > (3) If any email arrives whose sender address is not in either
> of those
> >       > two small lists, I'd like it to be delivered.
> >       >
> >       > If all I had to deal with were item 1 and item 3, I could set
> ACTION_INCOMING
> >       > to "ok" and simply put the unwanted sender addresses into a
> blacklist file.
> >       >
> >       > However, I don't know how to also handle item 2 along with item=
s
> 1 and 3.
> >       > Is what I want to do even possible with TMDA?
> >       >
> >       > If anyone is actually reading this email list and can answer my
> question,
> >       > I will be greatly appreciative!
> >       >
> >       > --
> >       >  [email protected]
> >       >  Take a hippopotamus to lunch today.

--0000000000002f54c205e070802e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><div class=3D"gmail_quote"><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">I really tried to get TMDA wo=
rking with python3 but eventually I gave up <br>
and decided to just stick with python2. Admittedly, my python skills are <b=
r>
poor, and I didn&#39;t want to spend more hours trying to get it to work.<b=
r>
<br>
Hopefully you&#39;ll make better progress than I did!<br>
<br>
Chris<br></blockquote><div><br></div><div>Thank you!</div><div><br></div><d=
iv>And yes, I understand, I spent way, *way* too much time trying to conver=
t<br></div><div>the original Python 2 TMDA code to Python 3. It ended up be=
ing a big<br></div><div>mess, and I finally gave up.</div><div><br></div><d=
iv>However, it turns out that the C=C3=A9dric Dufour version runs under Pyt=
hon 3.</div><div>I decided to take the plunge and try it, and I very easily=
 got it to work!!!</div><div>... as follows:<br></div><div><br></div><div s=
tyle=3D"margin-left:40px">% cd [work directory]</div><div style=3D"margin-l=
eft:40px"><br></div><div style=3D"margin-left:40px">% git clone <a href=3D"=
https://github.com/cedric-dufour/tmda.git" rel=3D"noreferrer" target=3D"_bl=
ank">https://github.com/cedric-dufour/tmda.git</a></div><div style=3D"margi=
n-left:40px"><br></div><div style=3D"margin-left:40px">% cd tmda</div><div =
style=3D"margin-left:40px"><br></div><div style=3D"margin-left:40px">% sudo=
 python3 setup.py install</div><div><br></div><div>This installs the Python=
 3 TMDA executables into /usr/local/bin , and they</div><div>all work for m=
e!=C2=A0 It turns out that the &quot;debian&quot; subdirectory that I was</=
div><div>asking about in my previous message is totally irrelevant. The onl=
y</div><div>purpose of that subdirectory is for facilitating the creation o=
f a debian</div><div>APT package for TMDA. There is no need to do that, sin=
ce the steps I</div><div>outlined above will perform a full TMDA installati=
on on your own linux</div><div>machine.<br></div><div><br></div><div>After =
performing those steps, I only had to make one tiny change to my</div><div>=
existing TMDA configuration:</div><div><br></div><div>Near the top of /etc/=
tmdarc is the following line of code:</div><div style=3D"margin-left:40px">=
os.makedirs(LOGDIR, 0755)</div><div><br></div><div>That simply needs to be =
changed to this:</div><div style=3D"margin-left:40px">os.makedirs(LOGDIR, 0=
o755)</div><div><br></div><div>(<i>i.e.</i>, put a lower-case letter &quot;=
o&quot; between the zero and the seven)</div><div><br></div><div>Some of my=
 own scripts had to be changed, because I had the original</div><div>Python=
 2 TMDA code in /usr/local/tmda/bin, and I had to change a small</div><div>=
number of references to that directory into /usr/local/bin. But to be clear=
, <br></div><div>those changes are in my own code which *calls* TMDA execut=
ables ...</div><div>not in any of the Python 3 TMDA code itself.</div><div>=
<br></div><div>One caveat is that I do not use TMDA for challenge-response =
these</div><div>days, and I have never used it for tagging ... only for whi=
telisting, for</div><div>blacklisting, and for putting unfamiliar messages =
into the Pending queue</div><div>so I can inspect them via the TMDA-cgi web=
 software and decide what</div><div>to do with them. Therefore, I don&#39;t=
 know if you would encounter</div><div>challenge-response or tagging issues=
. However, given how well the</div><div>Python 3 version is working for me,=
 I am optimistic that those functions<br></div><div>would also probably wor=
k.</div><div><br></div><div>If you or anyone else want to try this Python 3=
 version of TMDA, and</div><div>if problems are encountered, I&#39;m glad t=
o offer whatever help I can here</div><div>in this mailing list.</div><div>=
</div><div><a href=3D"https://github.com/cedric-dufour/tmda.git" rel=3D"nor=
eferrer" target=3D"_blank"></a></div><div><div><div dir=3D"ltr" class=3D"gm=
ail_signature"><div dir=3D"ltr"><div>-- <br>=C2=A0<a href=3D"mailto:hippoma=
[email protected]" target=3D"_blank">[email protected]</a><br>=C2=A0Take a hippo=
potamus to lunch today.</div><div><br></div></div></div></div></div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On Wed, 1 Jun 2022, Hippo Man wrote:<br>
&gt; I have done a &quot;git clone&quot; of the python3 version of TMDA fro=
m here:<br>
&gt; <a href=3D"https://github.com/cedric-dufour/tmda.git" rel=3D"noreferre=
r" target=3D"_blank">https://github.com/cedric-dufour/tmda.git</a><br>
&gt; <br>
&gt; And I have done a &quot;python3 setup.py install&quot;.<br>
&gt; <br>
&gt; I see that it created a TMDA directory tree under /opt/local/share/tmd=
a<br>
&gt; <br>
&gt; In the cloned git directory, there is also a &quot;debian&quot; subdir=
ectory, and since<br>
&gt; I am running under Debian-11, I want to install that debian-specific c=
ode.<br>
&gt; However, this debian code was not installed anywhere after my run of<b=
r>
&gt; &quot;python3 setup.py install&quot;, and I could not find any instruc=
tions for how<br>
&gt; to install that debian code.<br>
&gt; <br>
&gt; Futhermore, in the documentation that came with this TMDA version,<br>
&gt; there are a few references to <a href=3D"http://wiki.tmda.net" rel=3D"=
noreferrer" target=3D"_blank">http://wiki.tmda.net</a>, but that web site<b=
r>
&gt; no longer exists.<br>
&gt; <br>
&gt; Is there any place where I could find instructions for how to do a ful=
l,<br>
&gt; complete TMDA install of this python3 version on my Debian host?<br>
&gt; <br>
&gt; Thanks in advance for any pointers and help!<br>
&gt; <br>
&gt; --<br>
&gt; =C2=A0<a href=3D"mailto:[email protected]" target=3D"_blank">hippoman=
@gmail.com</a><br>
&gt; =C2=A0Take a hippopotamus to lunch today.<br>
&gt; <br>
&gt; <br>
&gt; On Wed, Jun 1, 2022 at 10:14 AM Hippo Man &lt;<a href=3D"mailto:hippom=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Thank you very much.<br>
&gt; <br>
&gt; And I&#39;m glad to see that this mailing list is actually still alive=
!<br>
&gt; <br>
&gt; Also, I went to your github site, and see that there are links there f=
or two<br>
&gt; Python3 forks. TMDA is the only Python2 code on my server, and I very<=
br>
&gt; much want to get rid of Python2 completely. I&#39;m going to check out=
 both of<br>
&gt; those Python3 TMDA forks, and I&#39;m happy that they exist.<br>
&gt; <br>
&gt; --<br>
&gt; =C2=A0<a href=3D"mailto:[email protected]" target=3D"_blank">hippoman=
@gmail.com</a><br>
&gt; =C2=A0Take a hippopotamus to lunch today.<br>
&gt; <br>
&gt; <br>
&gt; On Wed, Jun 1, 2022 at 1:17 AM Chris Caputo &lt;<a href=3D"mailto:ccap=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Nice work!<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0BTW, I maintain <a href=3D"https://github.co=
m/ccaputo/TMDAretro" rel=3D"noreferrer" target=3D"_blank">https://github.co=
m/ccaputo/TMDAretro</a> in case anyone has<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0trouble installing TMDA these days.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Chris<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0On Tue, 31 May 2022, Hippo Man wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; I figured out the answer to my question=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; In case anyone might come to this maili=
ng list some<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; day and wants to know how I solved my p=
roblem, here<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; is how I did so ...<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; I can implement item #2 in my list belo=
w by means of<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; an &quot;incoming&quot; filter. I creat=
ed a &quot;holdlist&quot; file to contain<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; match patterns for the set of addresses=
 that I want to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; automatically put into a pending state,=
 and I put the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; following rule into my incoming filter =
...<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; from-file ~/.tmda/lists/holdlist hold<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Now, I have succcessfully implemented a=
ll three items<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; in my list.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; --<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; =C2=A0<a href=3D"mailto:hippoman@gmail.=
com" target=3D"_blank">[email protected]</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; =C2=A0Take a hippopotamus to lunch toda=
y.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; On Mon, May 30, 2022 at 7:51 PM Hippo M=
an &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">hippoman@gma=
il.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0I&#39;ve been=
 using TMDA for something like 15 years, and I am still<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; getting lots of benefit from it and am =
still very happy with it.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; If there is anyone who is actually read=
ing this email list these days,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; I have a question about the use of TMDA=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; My question is this: I want to set up t=
he following filtering rules ...<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; (1) If the sender&#39;s email address i=
s on a very small list (less than a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; dozen entries), I&#39;d like the sender=
 to be blacklisted.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; (2) if the sender&#39;s email address i=
s on a very small list (less than a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; dozen entries), I&#39;d like the email =
to be held in the pending queue.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; (3) If any email arrives whose sender a=
ddress is not in either of those<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; two small lists, I&#39;d like it to be =
delivered.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; If all I had to deal with were item 1 a=
nd item 3, I could set ACTION_INCOMING<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; to &quot;ok&quot; and simply put the un=
wanted sender addresses into a blacklist file.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; However, I don&#39;t know how to also h=
andle item 2 along with items 1 and 3.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Is what I want to do even possible with=
 TMDA?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; If anyone is actually reading this emai=
l list and can answer my question,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; I will be greatly appreciative!<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; --<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; =C2=A0<a href=3D"mailto:hippoman@gmail.=
com" target=3D"_blank">[email protected]</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; =C2=A0Take a hippopotamus to lunch toda=
y.</blockquote></div></div>

--0000000000002f54c205e070802e--


--===============4234636817817861484==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============4234636817817861484==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
tmda-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmda-users

--===============4234636817817861484==--