1

There seems to be a few posts on this but none of the answers seem to work for us.

We're running outlook 2016. We're getting an incredible influx of spam hitting our inboxes. The thing is these emails all have attachments and theyre sent to us between 10pm - 6am in the morning (we're in Australia, so im gathering the spammers are based overseas).

Is anyone able to tell me how to make a rule that moves all emails with attachments that are sent between 10pm and 6am everyday to the junk folder?

3 Answers 3

1

It's not possible with an Outlook rule, the only condition that comes close is "Received in a specific Date Span" but you have to choose 2 fixed dates.

You can write a macro to run nightly, there's many code snippets here: http://www.outlookcode.com/

Lastly, you can use a 3rd party rule add-in like Auto-Mate: http://www.pergenex.com/auto-mate/index.shtml

Hope this helps.

0

Never tried it, but I guess one solution can be to write a rule for Exchange (not Outlook), setting Spam Confidence Level (SCL) to some high value - that should move all unwanted emails to junk. And then, enable/disable this rule using a script & Windows task scheduler.

https://community.spiceworks.com/topic/1189797-transport-rule-that-only-runs-on-certain-days-hours

https://social.technet.microsoft.com/wiki/contents/articles/23150.how-to-use-task-scheduler-for-exchange-scripts.aspx

https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/scl?view=exchserver-2019

0

You can take advantage of the fact that the Internet headers contain the date in a specific format to write a rule looking for substrings. (I found this idea here.)

The time in an internet header is generally formatted like this:

Received: from somemachine ([someipaddr]) by
 anothermachine ([someipaddr]) with mapi id
 somerandomstring; Mon, 2 Mar 2020 11:47:59 -0500

So you can create a rule that looks for any of the following strings in the message body:

2020 22:
2020 23:
2020 00:
2020 01:
2020 02:
2020 03:
2020 04:
2020 05:

You'll have to update the rule once every year, but it's a big help.

EDIT: @timothy-law notes in a comment that headers often contain more than one time zone. In my own situation, I was filtering message reports that were generated automatically and internal to my company, so the return path was predictable and never included -0000, so I didn't run in to this.

My solution also will not take notice of Daylight Savings Time. Again, in my case, the goal was to filter away nighttime messages that also had "deployment successful" in them, because 99% of nighttime messages from that app were about successful deployments. So the fact that "nighttime" switched by an hour twice a year didn't bother me there, either.

So yeah, this is brittle and may not work for you, but it's great for a specific circumstance like mine...

2
  • But since the header usually includes both time zones (i.e. -0000 & -0500), it's still going to be a problem. Mar 14, 2023 at 19:18
  • 1
    @timothy-law Noted. Added to my answer to address your comment. Mar 15, 2023 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .