Spammers adding events to my SmarterMail and Google Calendar
Problem reported by David O'Leary - 11/7/2025 at 10:46 AM
Submitted
Over the last two weeks, I've received a bunch of SPAM invites that, I believe, SmarterMail is automatically adding to my SmarterMail calendar and Google Calendar. How do I prevent this from happening? I do not want spammers to be able to add things to my calendar.
Owner of Efficion Consulting
Douglas Foster Replied
We are getting them too.
Default behavior has always been to add calendar entries to calendar with tentative status.   The trick is to block the malicious senders.  
Douglas Foster Replied
My first attempt to block these fake invites was to test the body text for 
TZID: Asia
 Follow up is to test and block for 
Subject contains Invitation...Order

They are sent by 
Sender: Google Calendar <">calendar-notification@google.com>
which is used for lots of legitimate traffic, so it is not easily blocked.

The spammers are getting really good at exploiting infrastructure services to do their dirty work.

I think the better solution will be:
Content-Type: text/calendar
AND
Unknown Sender

Unknown Sender is a custom test that I have been building with Declude+SQL.    The list is updated overnight using yesterday's incoming SMTP log.   Hopefully, that gives me enough time to do my work so that the bad senders are blacklisted before they become "Known".   

Declude and its successor Declude Reboot are powerful because I can build a constantly growing set of customized tools.   Most of the commercial spam filters use a marketing message of "trust us and sleep well".    I stopped trusting them to solve my problems on my timeline after multiple ways that they have failed to deliver.   Now, I have tools to do it myself. 

Essentially all attacks come from unknown senders, so my current attention is focused on how to manage that risk.   Everyday I review the list of recently allowed messages that come from unknown senders or unknown servers.   It tells me about the spam that is getting through to my users.

I would like to have a rule to quarantine anything from an unknown sender, but the data says that I still have a steady stream of legitimate messages from previously unknown sources.   Quarantine may still become the necessary step to protect my network.

Michael Replied
Wild. Yea we're seeing these also. Trouble is we can't block by sender because sent by Google. Anyone have a good strategy here? Maybe can block by something else in the header? 
Douglas Foster Replied
1) File abuse reports to abuse@google.com

2) I have speculated about creating an algorithm to detect computer-generated account names - looking for unreasonable volume-consonant ratio, too-long runs of vowels or consonants, etc    Just a pioe dream, but if someone figures out an algorithm or RegEx, please share.
Merle Wait Replied
@Douglas Foster = would love to hear about Deculde with SQL?
Is there any information that you could share.. and/or approach?
Douglas Foster Replied
On the topic of computer-generated values for the message From address.   I am planning to explore this algorithm:
1) Message From address only.
2) Ignore messages with equal, hyphen, or period in the name.  The messages that I have observed do not use these characters
3) ignore ending digit strings up to 5 characters.   Flag anything with longer ending strings or more than one embedded digit.
4) Count the number of transitions from vowel to consonant and consonant to vowel.   Get suspicious if there are fewer than 2 for every 5 characters.
5) Be suspicious of long names, but have not determined what length to use.
Douglas Foster Replied
@Merle - about Declude and SQL
If I were starting over, I would start with Declude Reboot, since it has supported source code.  Declude Reboot can also be used with PostFix on Linux.
Declude allows us to call any executable.   Declude calls VBScript, and several of those launch Python scripts in a subprocess (I have had trouble calling Python directly.)
Declude had built-in SPF logic, but it did not work correctly, and it had no DKIM/DMARC support.   Declude Reboot has neither.   Python has free modules for SPF, DKIM, DNS, IP Address classification, email message parsing, and other stuff that I have found useful.   For authentication, I use the Python modules for SPF and DKIM, then apply my own non-standard logic for DMARC because I think slavish obedience to RFC 7489 leads to some really bad results.

SmarterMail calls Declude with two files:   The EML file contains the message body, and the HDR file contains the SMTP information and a little extra.    Some of my tests only need to look at that file.

The scripts also collect metadata about every message and store it in a SQL database created for that purpose.  I actually have two of them.   The first attempt runs on a SmarterMail + Declude box that serves as my MX.   It discards messages with no valid recipient, evaluates SPF/DKIM/DMARC on every message, checks my SQL database for reputation data, stores evaluation results in the database, and the forwards the message inbound for additional filtering.

The second box is a commercial appliance with an adequate web page for message review and pretty good content filtering.   SmarterMail and Declude both lack an adequate tool for this purpose, and I am hoping the MailsBestFriend will solve this by creating one.   This box looks at the TESTSFAILED message header set by Declude, and does block, quarantine, or whitelist based on those instructions.   It also applies its own logic to block bad content.

The third box is also based on SM+Declude+Python+SQL, but it does not block messages.   It does a complex parse of the message for research purposes, with the results being stored in a more complex SQL database structure.   It is also used to apply an External Sender warning which is customized to the characteristics of the message being received.   (High-trust senders are not flagged at all.)   

This third box also defends against Friendly Name impersonation by inserting the From address into the Friendly Name field of some messages (mostly mailbox providers like Gmail and Hotmail).    This is necessary because some user interfaces, particularly on cell phones, hide the From address from the user, showing only the Friendly Name, and allowing user deception.  I also use the third box to strip the attachment from incoming DMARC Aggregate Report messages.   Because these content changes are made after the message has been accepted, they do not interfere with the message scoring process.

After the third box processes the message, it is delivered to the main SmarterMail server, which does no inbound filtering.

All of the code is available for sharing.   Just send a private message.
Merle Wait Replied
Thank you Douglas..  I have Declude but not Declude reboot.. where do I get that from???  I searched the declude site.. but didn't see it.

Andrew Barker Replied
Employee Post
Just to let you all know, SmarterMail skips automatically adding invites to your calendar if they are delivered directly to your Junk Email folder. It's been a while since I looked at it, but I'm pretty sure that moving a meeting invite to junk will also remove it from your calendar.
Andrew Barker Senior Software Developer SmarterTools Inc. www.smartertools.com
Derek Curtis Replied
Employee Post
Merle - Linda from Mail's Best Friend is very responsive. If you DM her here, I'm sure she'd be able to give you more info on Declude Reboot. 

Derek Curtis COO SmarterTools Inc. www.smartertools.com

Reply to Thread

Enter the verification text