Wsgetmail has stopped working - No idea when - Error message recorded

We are currently running RT 4.4.6 on Ubuntu 14.04.6 LTS. We recently got complaints that we were not responding to user updates. Upon investigating, wsgetmail appears to have broken on our system with no real indication of when. The error message I’m getting, regardless of the queue/message processed is:

failed to run command "/opt/rt4/bin/rt-mailgate " for file /tmp/MjEy65WqGT.mime : 19200 at /usr/local/share/perl/5.18.2/App/wsgetmail/ line 204.

What happened, and more importantly how do I fix it?

The only change I know of we made was to deploy a web cert to enable HTTPS. I discovered our wsgetmail files still reference the the http:// URL so going to change those, reboot and see if that is it.

And that’s the issue… Turning on HTTPS completely breaks wsgetmail. I’ve checked out configuration files and they all are supposed to go to https:// for the server name. Is it possible that wsgetmail can’t figure out the certificate is valid and that is why it’s crashing?

It sounds to me like the issue is the handoff to rt-mailgate, not wsgetmail. What is your command_args in the wsgetmail conf? Is there anything useful in the rt.log?

Another thought. Some time ago we had SSL issues as well, and got around them by adding “–no-verify-ssl” to the rt-mailgate options. I don’t know what changed or when, but some time after, that became not necessary again.

I’m afraid I don’t have version numbers for when it worked, didn’t work, or started working again, except rt was version 4 for that whole time. But currently, rt 5.0.5 on ubuntu 22.04.4, wsgetmail is working with https.

For configuration options, we have none. The update happens in two parts. A cron job calls this script:
/usr/bin/setlock -n /opt/setlock/wsgetmail.lck /root/ >> /var/log/wsgetmail.log 2>&1
Inside that script, we call wsgetmail for each queue we want. Each line reads:
/usr/local/bin/wsgetmail --config=/root/.wsgetmail/CONFIG_FILE
Each file should be identical to the others with the exception being the mailbox in question (we currently use one mailbox per queue). The files look like this:

    "client_id": "CLIENT_ID",
    "tenant_id": "TENANT_ID",
    "secret": "I_HAVE_A_SECRET",
    "global_access": 1,
    "username": "QUEUE_EMAIL_ACCOUNT",
    "folder": "Inbox",
    "command": "/opt/rt4/bin/rt-mailgate",
    "command_args": "--url= --queue='General Problems/Inquiries' --action=correspond",
    "command_timeout": 30,
    "action_on_fetched": "delete"

We do have a project to get us upgraded to RT 5.05 as well as upgrade our Ubuntu install from 14.04 to the latest LTS release.

Let me try adding the “no verify ssl” to one of the queues and see if that fixes anything.

Maybe try changing the url to https.

Yup, tried that first. When I went and reviewed all the files I noticed we missed all of the wsgetmail JSON files. Switching over to https there didn’t fix anything.

–no-verify-ssl is my only remaining trick, then. Good luck.