Skip to content

Commit 01bf13a

Browse files
committed
Initial commit.
1 parent 2c6b9af commit 01bf13a

File tree

23 files changed

+629
-1
lines changed

23 files changed

+629
-1
lines changed

.eslintrc.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true,
7+
"applescript": true
8+
},
9+
"parserOptions": {
10+
"ecmaFeatures": {
11+
"jsx": true
12+
},
13+
"sourceType": "module"
14+
},
15+
"rules": {
16+
"no-const-assign": "warn",
17+
"no-this-before-super": "warn",
18+
"no-undef": "warn",
19+
"no-unreachable": "warn",
20+
"no-unused-vars": "warn",
21+
"constructor-super": "warn",
22+
"valid-typeof": "warn"
23+
}
24+
}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
11
# stop-spamming-me
2-
An AppleScript to weed out spam mails from the inbox using Regex
2+
3+
Author: [Sidharth Mishra](mailto:sidmishraw@gmail.com)
4+
5+
A JXA script-app to weed out spam mails from the inbox using regex.
6+
7+
The application runs every 15 minutes for this version.
8+
9+
Target:
10+
11+
* macOS Sierra: 10.12.6 (16G1212)
12+
13+
* Mail: Version 10.3 (3273)
14+
15+
## Usage
16+
17+
* Download the contents of the [app](./app) directory.
18+
19+
* Run the `stop-spamming-me.app` application.
20+
21+
* When prompted to give the `regexes.lst` file and `starters.lst` file in the dialog box (both are included in the app directory).
22+
23+
## regexes.lst and starters.lst
24+
25+
* `regexes.lst` file contains the list of regular expressions that you believe match the spam emails.
26+
27+
* `starters.lst` file contains the list of starting words that you believe match the spam emails.
28+
29+
## Changelog
30+
31+
### v0.1.0
32+
33+
* Initial release

app/regexes.lst

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#########################################################################################################
2+
#
3+
# This is where you write all your regexes for email addresses to dump into JUNK!.
4+
# Comments for this file begin with the `#` symbol.
5+
#
6+
# Valid email addresses's have the following specifications:
7+
# source: https://en.wikipedia.org/wiki/Email_address#Syntax
8+
#
9+
# syntax: `local-part@domain`
10+
#
11+
# Local-part:
12+
# The local-part of the email address may use any of these ASCII characters:
13+
# * uppercase and lowercase Latin letters A to Z and a to z;
14+
# * digits 0 to 9;
15+
# * special characters !#$%&'*+-/=?^_`{|}~;
16+
# * dot ., provided that it is not the first or last character unless quoted,
17+
# and provided also that it does not appear
18+
# consecutively unless quoted (e.g. John..Doe@example.com is not allowed
19+
# but "John..Doe"@example.com is allowed);
20+
# * space and "(),:;<>@[\] characters are allowed with
21+
# restrictions (they are only allowed inside a quoted string, as described
22+
# in the paragraph below, and in addition, a backslash or double-quote must be preceded by a backslash);
23+
# * comments are allowed with parentheses at either end of the local-part;
24+
# e.g. john.smith(comment)@example.com and (comment)john.smith@example.com are both
25+
# equivalent to john.smith@example.com.
26+
#
27+
# Domain:
28+
# * uppercase and lowercase Latin letters A to Z and a to z;
29+
# * digits 0 to 9, provided that top-level domain names are not all-numeric;
30+
# * hyphen -, provided that it is not the first or last character.
31+
#
32+
#########################################################################################################
33+
34+
# Regexes begin from here:
35+
([\w\s]+)\<update\@([\w\.\-]+)mail\.\w+\> # generic matcher
36+
([\w\s]+)\<update\@([\w\.\-]+)mail[\w\.\-]*\.\w+\> # for emails like update@utm.mails-server.com

app/starters.lst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#########################################################################################################
2+
#
3+
# This is where you write all your starter words for ignoring email addresses that begin
4+
# with those words and to dump them into JUNK!.
5+
# Comments for this file begin with the `#` symbol.
6+
#
7+
#########################################################################################################
8+
9+
# starters begin from here:
10+
update # boring update emails
11+
sad-bunkers
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleAllowMixedLocalizations</key>
6+
<true/>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>English</string>
9+
<key>CFBundleExecutable</key>
10+
<string>applet</string>
11+
<key>CFBundleIconFile</key>
12+
<string>applet</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>io.github.sidmishraw.stop-spamming-me</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>stop-spamming-me</string>
19+
<key>CFBundlePackageType</key>
20+
<string>APPL</string>
21+
<key>CFBundleShortVersionString</key>
22+
<string>0.1.0</string>
23+
<key>CFBundleSignature</key>
24+
<string>aplt</string>
25+
<key>CFBundleVersion</key>
26+
<string>0.1.0</string>
27+
<key>LSMinimumSystemVersionByArchitecture</key>
28+
<dict>
29+
<key>x86_64</key>
30+
<string>10.6</string>
31+
</dict>
32+
<key>LSRequiresCarbon</key>
33+
<true/>
34+
<key>NSHumanReadableCopyright</key>
35+
<string>2018 Sidharth Mishra</string>
36+
<key>OSAScriptingDefinition</key>
37+
<string>A script for the Mail application to filter out spam-emails using regex. Uses Apple's JavaScript for automation.</string>
38+
<key>WindowState</key>
39+
<dict>
40+
<key>bundleDividerCollapsed</key>
41+
<false/>
42+
<key>bundlePositionOfDivider</key>
43+
<real>1621</real>
44+
<key>dividerCollapsed</key>
45+
<true/>
46+
<key>eventLogLevel</key>
47+
<integer>2</integer>
48+
<key>name</key>
49+
<string>ScriptWindowState</string>
50+
<key>positionOfDivider</key>
51+
<real>731</real>
52+
<key>savedFrame</key>
53+
<string>0 76 1920 982 0 0 1920 1058 </string>
54+
<key>selectedTab</key>
55+
<string>description</string>
56+
</dict>
57+
</dict>
58+
</plist>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
APPLaplt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830
2+
{\fonttbl}
3+
{\colortbl;\red255\green255\blue255;}
4+
{\*\expandedcolortbl;;}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>files</key>
6+
<dict>
7+
<key>Resources/Scripts/main.scpt</key>
8+
<data>
9+
45TioHaBIyvfgRVbcUhZXR7n/OA=
10+
</data>
11+
<key>Resources/applet.icns</key>
12+
<data>
13+
sINd6lbiqHD5dL8c6u79cFvVXhw=
14+
</data>
15+
<key>Resources/applet.rsrc</key>
16+
<data>
17+
G3hvC/3Isewfk+ZUxF+TP/ZxvWg=
18+
</data>
19+
<key>Resources/description.rtfd/TXT.rtf</key>
20+
<data>
21+
U1/ikutWmrJdAXLoU25d4KUS06c=
22+
</data>
23+
</dict>
24+
<key>files2</key>
25+
<dict>
26+
<key>Resources/Scripts/main.scpt</key>
27+
<dict>
28+
<key>hash</key>
29+
<data>
30+
45TioHaBIyvfgRVbcUhZXR7n/OA=
31+
</data>
32+
<key>hash2</key>
33+
<data>
34+
yyWZ4FjH1BIj9SHAB/LVEjMxDzQ4UK+VmsmDJRzY46g=
35+
</data>
36+
</dict>
37+
<key>Resources/applet.icns</key>
38+
<dict>
39+
<key>hash</key>
40+
<data>
41+
sINd6lbiqHD5dL8c6u79cFvVXhw=
42+
</data>
43+
<key>hash2</key>
44+
<data>
45+
J7weZ6vlnv9r32tS5HFcyuPXl2StdDnfepLxAixlryk=
46+
</data>
47+
</dict>
48+
<key>Resources/applet.rsrc</key>
49+
<dict>
50+
<key>hash</key>
51+
<data>
52+
G3hvC/3Isewfk+ZUxF+TP/ZxvWg=
53+
</data>
54+
<key>hash2</key>
55+
<data>
56+
OmstnccQFFH1YVx1Dj7JvkZSdzLgTnopcGQ1fvugMQ0=
57+
</data>
58+
</dict>
59+
<key>Resources/description.rtfd/TXT.rtf</key>
60+
<dict>
61+
<key>hash</key>
62+
<data>
63+
U1/ikutWmrJdAXLoU25d4KUS06c=
64+
</data>
65+
<key>hash2</key>
66+
<data>
67+
vGT9c0omY5YveJ9Gjv3lLYFVn64gjtcT7Nc6UAWGXh4=
68+
</data>
69+
</dict>
70+
</dict>
71+
<key>rules</key>
72+
<dict>
73+
<key>^Resources/</key>
74+
<true/>
75+
<key>^Resources/.*\.lproj/</key>
76+
<dict>
77+
<key>optional</key>
78+
<true/>
79+
<key>weight</key>
80+
<real>1000</real>
81+
</dict>
82+
<key>^Resources/.*\.lproj/locversion.plist$</key>
83+
<dict>
84+
<key>omit</key>
85+
<true/>
86+
<key>weight</key>
87+
<real>1100</real>
88+
</dict>
89+
<key>^Resources/Base\.lproj/</key>
90+
<dict>
91+
<key>weight</key>
92+
<real>1010</real>
93+
</dict>
94+
<key>^version.plist$</key>
95+
<true/>
96+
</dict>
97+
<key>rules2</key>
98+
<dict>
99+
<key>.*\.dSYM($|/)</key>
100+
<dict>
101+
<key>weight</key>
102+
<real>11</real>
103+
</dict>
104+
<key>^(.*/)?\.DS_Store$</key>
105+
<dict>
106+
<key>omit</key>
107+
<true/>
108+
<key>weight</key>
109+
<real>2000</real>
110+
</dict>
111+
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
112+
<dict>
113+
<key>nested</key>
114+
<true/>
115+
<key>weight</key>
116+
<real>10</real>
117+
</dict>
118+
<key>^.*</key>
119+
<true/>
120+
<key>^Info\.plist$</key>
121+
<dict>
122+
<key>omit</key>
123+
<true/>
124+
<key>weight</key>
125+
<real>20</real>
126+
</dict>
127+
<key>^PkgInfo$</key>
128+
<dict>
129+
<key>omit</key>
130+
<true/>
131+
<key>weight</key>
132+
<real>20</real>
133+
</dict>
134+
<key>^Resources/</key>
135+
<dict>
136+
<key>weight</key>
137+
<real>20</real>
138+
</dict>
139+
<key>^Resources/.*\.lproj/</key>
140+
<dict>
141+
<key>optional</key>
142+
<true/>
143+
<key>weight</key>
144+
<real>1000</real>
145+
</dict>
146+
<key>^Resources/.*\.lproj/locversion.plist$</key>
147+
<dict>
148+
<key>omit</key>
149+
<true/>
150+
<key>weight</key>
151+
<real>1100</real>
152+
</dict>
153+
<key>^Resources/Base\.lproj/</key>
154+
<dict>
155+
<key>weight</key>
156+
<real>1010</real>
157+
</dict>
158+
<key>^[^/]+$</key>
159+
<dict>
160+
<key>nested</key>
161+
<true/>
162+
<key>weight</key>
163+
<real>10</real>
164+
</dict>
165+
<key>^embedded\.provisionprofile$</key>
166+
<dict>
167+
<key>weight</key>
168+
<real>20</real>
169+
</dict>
170+
<key>^version\.plist$</key>
171+
<dict>
172+
<key>weight</key>
173+
<real>20</real>
174+
</dict>
175+
</dict>
176+
</dict>
177+
</plist>

resources/regexes.lst

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#########################################################################################################
2+
#
3+
# This is where you write all your regexes for email addresses to dump into JUNK!.
4+
# Comments for this file begin with the `#` symbol.
5+
#
6+
# Valid email addresses's have the following specifications:
7+
# source: https://en.wikipedia.org/wiki/Email_address#Syntax
8+
#
9+
# syntax: `local-part@domain`
10+
#
11+
# Local-part:
12+
# The local-part of the email address may use any of these ASCII characters:
13+
# * uppercase and lowercase Latin letters A to Z and a to z;
14+
# * digits 0 to 9;
15+
# * special characters !#$%&'*+-/=?^_`{|}~;
16+
# * dot ., provided that it is not the first or last character unless quoted,
17+
# and provided also that it does not appear
18+
# consecutively unless quoted (e.g. John..Doe@example.com is not allowed
19+
# but "John..Doe"@example.com is allowed);
20+
# * space and "(),:;<>@[\] characters are allowed with
21+
# restrictions (they are only allowed inside a quoted string, as described
22+
# in the paragraph below, and in addition, a backslash or double-quote must be preceded by a backslash);
23+
# * comments are allowed with parentheses at either end of the local-part;
24+
# e.g. john.smith(comment)@example.com and (comment)john.smith@example.com are both
25+
# equivalent to john.smith@example.com.
26+
#
27+
# Domain:
28+
# * uppercase and lowercase Latin letters A to Z and a to z;
29+
# * digits 0 to 9, provided that top-level domain names are not all-numeric;
30+
# * hyphen -, provided that it is not the first or last character.
31+
#
32+
#########################################################################################################
33+
34+
# Regexes begin from here:
35+
([\w\s]+)\<update\@([\w\.\-]+)mail\.\w+\> # generic matcher
36+
([\w\s]+)\<update\@([\w\.\-]+)mail[\w\.\-]*\.\w+\> # for emails like update@utm.mails-server.com

0 commit comments

Comments
 (0)