AI helped our listservs recently

In the past few weeks I have spent dozens of hours struggling with our hosting provider, trying to eliminate the little problem that our hosting provider has been tricking our listserv server into “unsubscribing” our members.  Eventually our hosting provider agreed to stop the bad behavior.  This having been accomplished, my next task was to restore to membership the people who had been wrongly “unsubscribed” from the listservs.  It looked like this would take another twenty or thirty hours, because I would need to manually check several thousand email messages to collect the email addresses of the people who would need to be restored to membership.

This blog article describes how I was able to use an AI to shorten this process.  I was able to restore about 2200 people to membership in around 6 hours, instead of 20-30 hours.

The background is that each time that our hosting service provider tricked our listserv server into wrongly “unsubscribing” a member from a listserv, an email would get sent to me as the system administrator.  It would tell me that some particular member, identified by email address, had been unsubscribed because we had received a number of “bounce” messages for that email address.  (The “bounce” messages came from a poorly designed man-in-the-middle spam filter operated by our hosting service provider.)

As of a week or so ago, the bad behavior of our hosting service provider had led to more than two thousand people being kicked off our listservs.  In recent weeks the behavior had gotten so bad that we would lose an average of a hundred members per day.  Simple math predicted that the listservs would all be destroyed (reduced to a member count of “zero”) within a predictable number of months.  But as I say, eventually our hosting provider agreed to stop it.

I looked through my email archives and saw that during the relevant period of time, I had received more than two thousand of the bad-news email messages.  I faced the prospect of having to open each of these emails one by one, having to copy the email address from the message, and having to paste the email address into a list for later loading back into the membership database for the relevant listserv.  I would have to repeat this process around eleven times, once for each of the eleven listservs.

In an earlier life I might instead have sat down to write a computer program to read in the content of the several thousand emails, and to parse the emails, and extract the email addresses, and check for duplicates, and to finish with a list to be later loaded into the listserv system.  But this program would only get used on a single day, only eleven times.  It would probably take me all day to write the software and debug it and carry out the work, or maybe several days.  What’s worse is that the programming languages in which I am fluent are not commonly used languages these days.  It would have been a lot of fuss and bother to learn how to do this on a Windows computer with some language from many years ago.

But it crossed my mind to think that an AI might save me some time.  So I went to Gemini (the AI in Google search) and posted a query:

I have several thousand email messages from Mailman, each of which tells me that a listserv member got “unsubscribed”.  Please write a computer program to run on my Windows computer to extract the email address from each of the emails and to save it in a report.

It took about two seconds for the AI to hand me this piece of software.  Two seconds.  Did I mention it only took about two seconds?  Maybe I forgot to mention, in this blog article, that it only took about two seconds.

Following the explanation from the AI, I saved my several thousand emails, each as a so-called “EML” file on my hard drive.  I did this in a selective way, saving all of the emails for (for example) the e-Trademarks listserv in one folder, and all of the emails for the PCT listserv in a different folder.

The AI then asked if I needed any help actually running the program on my computer, which I did.  It happens this program had been written in Python, and although for some years now I have been vowing to learn Python, I had not yet learned Python.  This means that oddly enough I did not actually know how to run a Python program on my computer.

Following the guidance of the AI, I then opened a command prompt and typed a command to check to see whether Python had already been installed on my computer.  (It turns out the answer was “yes”, but the AI made clear that it would have been glad to talk me through the process of installing Python, had it been needed.)  It was then a matter of copying and pasting the Python program into the command prompt window.  I then ran the Python program for one of the listservs, and it cheerfully told me that it had extracted zero email addresses from the pertinent email messages.

The AI had warned me that this might happen, and the AI had already told me that I might need to tweak a regular expression toward the beginning of the program:

# Adjust these patterns depending on your specific Mailman version / language
MAILMAN_PATTERNS = [
re.compile(r”([\w\.-]+@[\w\.-]+\.\w+)\s+has\s+(?:been\s+)?removed”, re.IGNORECASE)
]

Although I have never learned Python, the AI warning and software comment made it easy to see where I needed to focus my attention.  It was easy enough to tweak the regular expression to match the formatting in my “unsubscribed” email messages.  I ran the program again, and it worked.  I repeated this for each of the other listservs in this project, generating a report for each listserv.  I then used the reports to restore the people to membership in the listservs.  Here you can see the results:

listserv membership before restoration updated membership number restored
Madrid 587 613 26
Copyright 542 589 47
Patentcenter 502 592 90
Designs 372 546 174
PCT 861 1067 206
Patentpractice 410 905 495
e-Trademarks 386 1444 1058

Yes, the hosting service provider had managed to trick our Mailman server into kicking over one thousand members of the e-Trademarks listerv out of the community.  At an average loss of one hundred members per day, the e-Trademark listserv would have been emptied of membership in another four days.

You can add up the numbers in the rightmost column and it is 2207.  I was able to restore 2207 people to membership in these listservs, and it took maybe six hours.  Without the AI, it would have taken 20-30 hours.

For those keeping score at home, I will mention that I did not need to pay any money to get this Python program.  This is the free Gemini AI that anybody can get just by clicking around in Google.  I think it’s very likely I could gotten similar results from the free-of-charge version of ChatGPT.

I welcome comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *