Skip to content
Snippets Groups Projects
Commit 93434bbb authored by Petter Helset's avatar Petter Helset Committed by Charlie Smurthwaite
Browse files

Configurable message size limit. Defaults to 14MB. (#383)

parent 0d88d793
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -71,6 +71,7 @@ smtp_server:
proxy_protocol: false
log_connect: true
strip_received_headers: false
max_message_size: 14 # size in Megabytes
 
smtp_relays:
-
Loading
Loading
Loading
Loading
@@ -82,7 +82,7 @@ module Postal
begin
@database.query(create_table_query(table,:columns => {
:id => 'int(11) NOT NULL AUTO_INCREMENT',
:data => 'mediumblob DEFAULT NULL',
:data => 'longblob DEFAULT NULL',
:next => 'int(11) DEFAULT NULL'
}
))
Loading
Loading
Loading
Loading
@@ -377,8 +377,8 @@ module Postal
end
 
def finished
if @data.bytesize > 14.megabytes.to_i
return "552 Message too large (maximum size 14MB)"
if @data.bytesize > Postal.config.smtp_server.max_message_size.megabytes.to_i
return "552 Message too large (maximum size %dMB)" % Postal.config.smtp_server.max_message_size
end
 
if @headers['received'].select { |r| r =~ /by #{Postal.config.dns.smtp_server_hostname}/ }.count > 4
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment