Textpattern CMS can be configured to alert an author when someone leaves a comment on their article. This is an optional feature, and may not be appropriate for some organisations using Textpattern, especially those with a moderation hierarchy for content – a freelance author may not have the authority to approve a comment, for example. For single-author Textpattern websites, it’s often useful to have notification of new comments as they come in, even more so if the comments are asking for a reply or clarification.
I have encountered a problem in the past of Gmail preventing delivery of these comment emails. Here’s how it happens:
- author uses a Gmail address for their profile
- author writes an article
- reader leaves a comment on the article
- Textpattern generates an email alert to the author
- Gmail processes the email, thinks it’s spoofed
- Gmail files the email as junk/spam
The issue presents itself at a mail server level. The Gmail server receives an email intended for the article author, and this email also identifies itself as being from the author. Gmail checks the origin of the email and notes that the originating email server is not one of theirs. Therefore, it’s a fair assumption that someone is spoofing the sender details and they file away in the junk/spam folder accordingly. After some investigation, I found a solution that works for a single-user environment: configure a Gmail filter to allow the email through.
In my case, I’m using Textpattern with English as the language. I’m also receiving comment notifications from multiple websites, each funneling into one Gmail account. A comment alert email looks like this:
Subject: [site name] comment received: [article title]. Dear [author real name], A comment on your post “[article title]” was recorded. http://example.com/blog/article http://example.com/textpattern/index.php?event=discuss&step=discuss_edit&discussid=123 Status: Visible. Name: [commenter name] Email: email@example.com Website: http://example.org Comment: [message]
Excuse the blocky text in square brackets, but you get the idea. The content will change in each case, but the overall format of the email stays the same. What I wanted to achieve was to allow the Textpattern emails through, but not have anyone else spoofing my email address as the sender (a previously well-used spammer trick) arriving in my inbox. The solution I chose was to check the subject of the email for the text string ‘]comment received:’ (without the quotes), and never send it to spam if that was the case.
To do this in Gmail, log into the account and choose Settings. Go to Filters, then Create a new filter, then paste that text string into the Subject field (remove the quotes). I can see two small potential issues to this filter trick, both of which are edge-cases: if the language string is updated in Textpattern then the Subject filter will have to be updated, and if a spammer figures out you’re using the text string check then they could send you all manner of junk with that string in the title and Gmail will diligently deliver them. That said, I’ve been using this workaround for about 4 years and that’s never happened.