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 Lead 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 CCO SmarterTools Inc. www.smartertools.com
David O'Leary Replied
This is still a serious problem. The one I got today did get delivered directly into my Junk folder but was still added to my Google Calendar. And, if I delete the email, it seems it sends a DECLINE message for the meeting. That's awful as we all know you shouldn't interact with SPAMMERS in any way. 

Here's the relevant line from the log:
[2026.03.24] 14:43:00.410 [60342861] Delivery for dennisward1002@precicarb.com to me@me.com has completed (Delivered to Junk Email) Filter: Spam (Weight: 8), Action (User Level): PrefixSubject, GoogleCalendar Likely Spam
Owner of Efficion Consulting
Andrew Barker Replied
Employee Post
Without having more information about your specific setup, it's difficult to say how this might be happening. Could you tell me how your Google Calendar is connected to your SmarterMail account? Is it connected to SmarterMail as an internet calendar, or are you just using a common client? 
Andrew Barker Lead Software Developer SmarterTools Inc. www.smartertools.com
David O'Leary Replied
I have no idea how SmarterMail is connected to my Google Calendar. I've looked and haven't been able to find the connection. It is not a common client. They both have the same email address. Where would this be set up in SmarterMail?
Owner of Efficion Consulting
Andrew Barker Replied
Employee Post
If your Google Calendar is visible in SmarterMail, then it is likely connected as a subscribed calendar, which is done using the relevant menu option on the Calendar page:


You can confirm that a calendar was added by Subscribe to Calendar by right clicking on it and selecting Properties. If it is a subscribed calendar, a modal will appear with the title "Subscribe to Calendar" and will include fields for name, URL, and update interval. If there isn't a Properties menu option, then the calendar is native to SmarterMail. If the Properties option opens a different modal, then it is either a domain calendar or a calendar shared by another user. 
Andrew Barker Lead Software Developer SmarterTools Inc. www.smartertools.com
David O'Leary Replied
I'm not subscribed to any calendars in SmarterMail.
While I'm still not sure what is adding these to my calendar, I did find a solution in the Google Calendar settings. There is a setting for:
"Add invitations to my calendar" with an option for "Only if the sender is known"
This should resolve this issue for me.
Owner of Efficion Consulting
Michael Replied
I wonder if someone could come up with a creative Regular Expression rule that could scan the Raw Content for patterns seen on these junky calendar invites.
Andrew Barker Replied
Employee Post
Ok, so it sounds like the Google Calendar issue is unrelated, which is what I was trying to determine with my questions.

As for your SmarterMail calendar, based on the log line you provided, it looks like the spam action is only adding a prefix to the subject. That indicates that something else is marking the message to be delivered to your Junk Email folder, which could possibly be interfering with the logic that would prevent the message from being added to your calendar. Based on that, we can probably provide more help if you open a ticket.
Andrew Barker Lead Software Developer SmarterTools Inc. www.smartertools.com
Douglas Foster Replied
@Michael
A single RegEx will be really tricky to create as a single rule.   This problem really calls for a rules engine which supports multiple-attribute rules, such as Declude or Declude Reboot.   These are the characteristics that might go into your multiple-attribute rule:

Message has a Calendar Body element:
  • BODY matches PCRE (\n\r*Content-Type:\s+application\/octet-stream;\s+name="[#-~][ -~]+.ics")
  • BODY matches PCRE (\n\r*Content-Type:\s+text\/calendar)
If your problem is unique to Google calendar, you may also want to add this:
Then you need something else to identify attacks from normal traffic.  At one point, I noticed that the time zone was Asia, and I assumed that we would not receive a legitimate invite from there, so I blocked on:
  • BODY CONTAINS TZID:Asia/
I have also had some requests that impersonate my domain, so I have a rule to block invites that claim to be from our internal domains.

Currently, I am having good success with a very simple rule:
  • SUBJECT CONTAINS "Invitation" and "Order"
This simple rule is standalone, regardless of whether the body is a calendar invite or not.  It has produced these results  in 90 days: 
  • 3 correct blocks, 
  • 2 incorrect (but unimportant) blocks on 1 domain, which could be fixed with a whitlelist rule, and 
  • 707 legitimate invites allowed.  
So my attackers have mostly moved onto other tactics

Reply to Thread

Enter the verification text