Skip to content

Commit 6cfcf32

Browse files
committed
Merge branch 'develop'
2 parents b2b8668 + 28bdf6c commit 6cfcf32

File tree

8 files changed

+746
-39
lines changed

8 files changed

+746
-39
lines changed

Changes.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 1.8.5 - 2023-03-05
2+
3+
- New & Breaking change: Check for too many emails has been changed to containing the exclude and/or include value. Read the README.
4+
- New: Define attachment names (entire name or part of the name) and it will be blocked. Check the mongodb.ini or README.
5+
- Checking the limit of the message is done now only for incoming messages.
6+
- Attachments file names that start with a "." (dot) are now saved with the checksum and extension as file name.
7+
- Fix: Check for too many emails within a specific time did not work with include.
8+
19
# 1.8.4 - 2022-05-08
210

311
- Disabled creation of index as it could throw error with different versions of MongoDB. Please create indexes according to your requirements.
@@ -53,7 +61,7 @@
5361
# 1.6.5 - 2020-10-18
5462

5563
- NEW: We've added an option to limit incoming emails. Please see README
56-
- We are now creating indexes for our collections
64+
- We are now creating indexes for our collections
5765
- Returning a "DENY" if the message is larger than 16MB
5866
- Returning a "DENY" if the message cannot be parsed
5967
- Updated libraries
@@ -79,7 +87,7 @@
7987

8088
- You can now use a mongodb:// connection string with the new string value
8189
- There is now a new "limit" option as you cannot insert more that 16 MB documents into MongoDB
82-
- You can now send back emails to the sender on limits, parsing, and insert errors
90+
- You can now send back emails to the sender on limits, parsing, and insert errors
8391
- Improved performance for parsing inline images
8492
- Added custom content type to extend what attachments Haraka should accept as valid files. Otherwise the attachment is renamed to (filename).txt
8593
- Removed some content types from the default reject string
@@ -144,7 +152,7 @@
144152

145153
# 1.4.8 - 2019-12-05
146154

147-
- The filename of files within a winmail.dat are now cleaned up as well (surprisingly a lot of people are still sending those)
155+
- The filename of files within a winmail.dat are now cleaned up as well (surprisingly a lot of people are still sending those)
148156

149157
# 1.4.7 - 2019-12-04
150158

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ Copy the mongodb.ini from the config directory (haraka-plugin-mongodb/config) to
3838

3939
Provide your credentials to connect to your MongoDB instance.
4040

41-
As of version 1.6.2 you can also define a mongodb connection string directly using the "string" value. This has to be a valid [mongodb connection string](https://docs.mongodb.com/manual/reference/connection-string). If you define a connection string, only the connection string will be used for the connection.
41+
As of version 1.6.2 you can also define a mongodb connection string directly using the "string" value. This has to be a valid [mongodb connection string](https://docs.mongodb.com/manual/reference/connection-string). If you define a connection string, only the connection string will be used for the connection.
4242

43-
Please note that the mongodb connection is used for both the delivery and the queue. If you want to store the queue in another database you should use a separate queue and a delivery instance.
43+
Please note that the mongodb connection is used for both the delivery and the queue. If you want to store the queue in another database you should use a separate queue and a delivery instance.
4444

4545
## Section: Collections
4646

@@ -58,6 +58,9 @@ This plugin comes now with a built-in check to make sure your attachment path is
5858
### Attachment reject (new as of 1.6.1)
5959
Enter the attachments content type that should be rejected. The default ones are the most common file types that should never be accepted by any file system. Feel free to adjust. It's an array with content type strings.
6060

61+
### Attachment reject by name (new as of 1.8.5)
62+
Enter the attachments name that should be rejected. Enter the entire filename or only part of the name. Feel free to adjust. It's an array with content type strings.
63+
6164
### Extend content types (new as of 1.6.2)
6265
As of 1.6.1 we test each attachment for the proper content type and get the correct extension. Sometimes you might want to extend that with your own content types. With the new "custom_content_type" setting you can do that now. Within the mongodb.ini simply extend the map with your own custom types. The format is, 'content/type' : ['extension'] and you comma separate each content type.
6366

@@ -83,9 +86,20 @@ Enter your SMTP server values and FROM, CC, and BCC for sending an alert email t
8386

8487
Enabling the limits for incoming emails will check the FROM and the TO email-address of incoming email and send back a "softdeny" if found. The time amount is set in the "timeout_seconds" setting. By default this is set to 10 seconds. In our experience, we've seen that this will throttle most automated systems, while emails from users are coming in without delays.
8588

86-
Use the "exclude" (empty array) settings to never throttle emails from a certain domain.
89+
Use the "exclude" settings to never throttle emails from a certain domain.
90+
91+
92+
---
93+
### Breaking change as of 1.8.5
94+
95+
The exclude and include values check if the word is found within the senders email address. Previously, it was only checking the email domain. This allows you to exclude certain words and/or include words. The default config file now includes some sane values to check now (though, as long as the limit check is disabled nothing it will not check for anything).
96+
97+
Please also note, that the format of the exclude and include params has changed! If you use the limit check, please change your config values first.
98+
99+
---
100+
87101

88-
As of 1.7.0 you can also use the "include" (empty array) setting to only include certain domains in the check. An empty array means to check for all incoming emails, one or many values mean to only check for those domains.
102+
As of 1.7.0 you can also use the "include" setting to only include certain domains in the check. An empty array means to check for all incoming emails, one or many values mean to only check for those domains.
89103

90104
As of 1.8.0 there is a new parameter called "db" that lets you use Redis as an alternative to MongoDB. This is helpful if you get thousands of emails and want to save on the constant MongoDB connections. Besides, the MongoDB TTL is not accurate enough and Redis is made for such a use case. Set db=redis to use Redis instead of db=mongodb.
91105

config/max_data_line_length

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3000

config/mongodb.ini

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@ delivery=email_delivery_results
2828
; Absolute path to store attachments
2929
[attachments]
3030
path=/opt/attachments
31+
; The below path has to exists or else we stop Haraka from starting. Leave empty if you don't want to execute a check.
32+
; Great if you have to make sure that a value is mounted or keeps being mounted. If we loose connection we exit Haraka.
3133
path_check=
34+
; Attachments that should always be rejected. The values below are the ones that Gmail and Outlook also reject
3235
reject=['application/x-freearc','application/x-bzip','application/x-bzip2','application/x-csh','application/gzip','application/java-archive','text/javascript','application/vnd.apple.installer+xml','application/x-httpd-php','application/x-sh','application/xhtml+xml','application/vnd.microsoft.portable-executable','application/x-msdownload','application/exe','application/x-exe','application/dos-exe','vms/exe','application/x-winexe','application/msdos-windows','application/x-msdos-program']
3336
custom_content_type={ 'application/imed' : ['imed'] }
37+
; You can also reject attachments by filename. Enter the complete filename or only part of it
38+
reject_by_name=['~WRD']
3439

3540
; Convert inline images or not
3641
; cid = leave value as cid:(number) - this is useful if you want to process the images later on
@@ -72,16 +77,37 @@ bcc=
7277
; Limit incoming messages. Please see the README for instructions
7378
[limits]
7479
incoming=no
75-
incoming_collection=limit_incoming
80+
7681
; Limit in seconds
7782
incoming_seconds=30
78-
; Domains you want to exclude from the limits check
79-
exclude=['helpmonks.com','helpmonks.net','helpmonks.org','sendmonks.net','sendmonks.com','razuna.com','razuna.org']
80-
; Domains that should be INCLUDED in the limits check (when left as an empty array it will check every email)
81-
include=[]
83+
84+
; Strings that should be excluded from the limits check
85+
exclude[] = helpmonks
86+
exclude[] = sendmonks
87+
exclude[] = razuna
88+
89+
; String that should be included in the limits check
90+
include[] = monitor
91+
include[] = notification
92+
include[] = java
93+
include[] = noreply
94+
include[] = notreply
95+
include[] = no-reply
96+
include[] = not-reply
97+
include[] = deployment
98+
include[] = notifier
99+
include[] = root
100+
include[] = alert
101+
include[] = uptime
102+
include[] = robot
103+
include[] = opsgenie
104+
82105
; Set the database to be used. Either "mongodb" or "redis"
83106
db=redis
84107

108+
; Set the collection to be used if you use mongodb
109+
incoming_collection=limit_incoming
110+
85111
; Redis Credentials
86112
; Used for the limit incoming option above
87113
[redis]

email_body_utility.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,4 +713,4 @@ const EmailBodyUtility = function() {
713713
convertPlainTextToHtml // (text)
714714
};
715715
}();
716-
module.exports = EmailBodyUtility;
716+
module.exports = EmailBodyUtility;

0 commit comments

Comments
 (0)