Sending email to RT returns HTML

I’ve moved an existing instance of RT over to RHEL. I’m trying to get email tickets to work. I’ve confirmed that the tickets get picked up from the Gmail account but they don’t get created in RT.

Simplifying it down to the command line, when I put in this
(echo “From: XXXXX@yavapai.us” ; echo “Subject: test from command line” ; echo ; echo “test”) |/var/www/requesttracker/bin/rt-mailgate --queue ‘YLN’ --action correspond --url http://helptest.yln.info/requesttracker --debug

I get this:

    The RT server which handled your email did not behave as expected. It
    said:

and then it returns the HTML of the home page.

Any idea what might cause this?

What happens if you talk directly to:

http://helptest.yln.info/requesttracker/REST/1.0/NoAuth/mail-gateway

using a web browser? That should be the URL that rt-mailgate ends up using so you can see what it generates or if it does lots of redirects (rt-mailgate can do three levels of redirection on a URL IIRC).

In Firefox, it says “The page you requested could not be found.” I also did it in Edge (who knows why) and it loads the home page.

Here’s what the Apache logs show:

[41270] [Wed Aug 21 18:38:20 2019] [notice]: Marking original destination as having side-effects before redirecting for login.
Request: /requesttracker/REST/1.0/NoAuth/mail-gateway
Reason: your browser did not supply a Referrer header (/var/www/requesttracker/sbin/../lib/RT/Interface/Web.pm:438)

I tried accessing the URL on the working production site and it returns:
not ok - Couldn’t parse or find sender’s address