Script for simplifying spam control

roblook

New Member
Outlook version
Outlook 2016 64 bit
Email Account
IMAP
Good evening everybody. I am new here and also not familiar with VBA. So I thought I should ask if this is feasible and if I can get a bit of guidance on the how-to. Every morning, after opening outlook (2016) I go through the same routine to control spam. My goal is to single out the sender's domain and do a permanent delete. At least, I won't see spam from that domain ever again. While tiresome, it has been effective.

So... on the email I receive I copy the email address. Then, I follow the rules to create a rule: create a rule, advanced options, with specific words on the sender's address, I add the domain name, click Ok and Next, permanently delete it + stop processing rules, NEXT, NEXT, run this rule now, finish.

The above steps delete the spam and that is that, forever. I don't mind doing it for each domain-spam I receive but I was wondering if there is a way to shorten and simplify this process. Any comment is greatly appreciated.
 
Are the spam in the inbox?

A macro could get the domain name onto the click board, but adding rules is more complicated. The big issue with blocking addresses is most spammers don't reuse addresses so they are only used once then removed. The exception is if you are like me and get spam from people trying to sell you services and they follow up 3 or 4 times. I have some companies who email fairly often - one person sends 3 or 4 messages, then a few months later, a new person.


I was working on a script to watch the inbox (or junk folder) for addresses and delete messages from those addresses but ran into bugs and haven't had time to spend on figuring out where I went wrong.
 
Thank you for all responses and thanks Diane.

Yes, in the inbox. I understand the change of domains. However, I was only looking to simplify the process as it now takes 7 to 8 steps. I was hoping for 2 or 3 steps. That will be progress.

But I just noticed one thing they all have in common and may help in stopping, at least, this current wave of spam. Universally, the spam is back-dated. Today's, for example, is showing in my inbox as sent "9/17/2023". I hardly remember having received a legit email that was back-dated. Perhaps, a way to stop this specific type is to have a routine that "permanently deletes" anything that is received "today" with a back-dated "sent date". Do you think this is possible?
 
I just wrote a new rule using "received on specified dates" and narrow the after/before dates to 2 days in September so that the rule does not delete other emails from the past I keep in the inbox. I also narrowed the rule to only 1 of my email addresses and to the inbox so that it does not delete past emails in other folders. Let's see if this stops, slows down the current wave.
 
They date rule probably won't work (it uses received not sent) but a script could do it.


You can block the sender with 1 click - but it blocks the entire address, you need to edit to block the domain - but blocking is mostly useless because spammers change addresses. Hitting Del is fastest for most spam.
1696876369540.png
 
Thanks again. Yes, did not work.

Instead, I checked the headers and found the date sent with hours, minutes and seconds. Strangely, these batches are being sent at the same time/date. So I used the rule "with specific words in the message header" and deleted it permanently. So far, it's working. Chances of messages other than this wave of spam being sent at the exact time counting seconds is 1 in a million. And yes, there is always the 1-click "delete". Thank you for all the help.
 
Thanks for the update! hopefully the spammer will give up soon. :)
 
Thanks for the update! hopefully the spammer will give up soon. :)
I wish. For a while I was setting up a rule to move spam into my junk folder. Then I noticed that spammers were constantly changing user names and/or domains. It's a losing battle. Now every morning I do manual deletes and be done with it.
 
If you have access to your email server rules, you can try to create a server rule on the incoming domain that sends a "USER NOT FOUND" message back to the spammer. That sometimes works to get them to actually take the email out of their system. This can be done with most cPanel accounts.
 
Similar threads
Thread starter Title Forum Replies Date
J Outlook Rules VBA Run a Script - Multiple Rules Outlook VBA and Custom Forms 0
N Outlook 2021 'Run Script" Rules? Outlook VBA and Custom Forms 4
K Run a script rule to auto 'send again' on undeliverable emails? Outlook VBA and Custom Forms 1
W Designer Form 2013 and Script ? how ? Outlook VBA and Custom Forms 1
G print attachment straight away; working script edit not working Outlook VBA and Custom Forms 0
G Save attachment run a script rule Outlook VBA and Custom Forms 0
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
G Script does not exist Outlook VBA and Custom Forms 0
G Trigger script without restaring outlook Outlook VBA and Custom Forms 7
A VBA Script - Print Date between first email in Category X and last email in Category Y Outlook VBA and Custom Forms 3
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
L Need help modifying a VBA script for emails stuck in Outbox Outlook VBA and Custom Forms 6
L VB script only runs manually Outlook VBA and Custom Forms 5
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
Aussie Rules Run a Script on an Incoming Email OK and then the Email reverts Outlook VBA and Custom Forms 0
D.Moore VBA script fail after Office 365 update Using Outlook 8
M Outlook 2013 Script Assistance - Save Opened Link with Subject Added Outlook VBA and Custom Forms 1
F Script for zip file attachment Outlook VBA and Custom Forms 1
S Change VBA script to send HTML email instead of text Outlook VBA and Custom Forms 3
Y Outlook 2013 Run A Script Outlook VBA and Custom Forms 4
Z Script to set account? Using Outlook 0
dweller Outlook 2010 Rule Ignores VBA Script Outlook VBA and Custom Forms 2
N VBA Script to Open highlighted e-mail and Edit Message Outlook VBA and Custom Forms 5
B Outlook rule run a Script doesn't work Outlook VBA and Custom Forms 1
J Calling a Public sub-routine from the script editor via VB script Outlook VBA and Custom Forms 4
K Outlook Archive to PST Files by Date Range VBA Script? Outlook VBA and Custom Forms 1
Peter H Williams Enable script containing VBA Outlook VBA and Custom Forms 12
H VB script in outlook form doesn't work anymore Outlook VBA and Custom Forms 2
A Script to fetch data from mails in restricted collection and sending them to excel Using Outlook 1
B Wanting to run a script that will filter any body that has a russian link in it. Outlook VBA and Custom Forms 5
Bri the Tech Guy Registry Tweak to make "Run a Script" Action Available Outlook VBA and Custom Forms 2
V VB script code to save a specific email attachment from a given email Outlook VBA and Custom Forms 14
Bri the Tech Guy Run Script rule not running for newly arriving messages Outlook VBA and Custom Forms 25
M Subject Line Automation - Trigger Script Delayed Outlook VBA and Custom Forms 2
Q Script to create a pst file for Archiving Using Outlook 1
Vijay Error in rule- Run a script Using Outlook 1
R VBA Script Quick Parts Using Outlook 1
Vijay Run script doesn't work in outlook Using Outlook 1
Q VBA Script to move item in secondary mailbox Outlook VBA and Custom Forms 2
Diane Poremsky Run a Script Rule: Send a New Message when a Message Arrives Using Outlook 2
F Avoid sending duplicate using Outlook script Outlook VBA and Custom Forms 2
oliv- How to Run a Script IN AN ADDIN with Outlook's Rules and Alerts Outlook VBA and Custom Forms 2
L Run a Script Rule doesn't work Using Outlook 5
N Outlook script to forward emails based on senders' address Outlook VBA and Custom Forms 2
S using script rule to save attachments on arrival Outlook 2010 Outlook VBA and Custom Forms 9
X Outlook script to run excel data Outlook VBA and Custom Forms 1
N VBA Script to Send Automatic Emails from Outlook 2010 Outlook VBA and Custom Forms 1
Davzell Change default pop3 account with script, prf or registery ? Outlook VBA and Custom Forms 0
D RUN SCRIPT WHEN OUTLOOK IS CLOSE Outlook VBA and Custom Forms 1

Similar threads

Back
Top