mirror of
https://github.com/postalserver/postal.git
synced 2026-10-20 11:17:01 +00:00
Configurable message size limit. Defaults to 14MB. (#383)
This commit is contained in:
committed by
Charlie Smurthwaite
parent
0d88d79319
commit
93434bbb7e
@@ -71,6 +71,7 @@ smtp_server:
|
|||||||
proxy_protocol: false
|
proxy_protocol: false
|
||||||
log_connect: true
|
log_connect: true
|
||||||
strip_received_headers: false
|
strip_received_headers: false
|
||||||
|
max_message_size: 14 # size in Megabytes
|
||||||
|
|
||||||
smtp_relays:
|
smtp_relays:
|
||||||
-
|
-
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ module Postal
|
|||||||
begin
|
begin
|
||||||
@database.query(create_table_query(table,:columns => {
|
@database.query(create_table_query(table,:columns => {
|
||||||
:id => 'int(11) NOT NULL AUTO_INCREMENT',
|
:id => 'int(11) NOT NULL AUTO_INCREMENT',
|
||||||
:data => 'mediumblob DEFAULT NULL',
|
:data => 'longblob DEFAULT NULL',
|
||||||
:next => 'int(11) DEFAULT NULL'
|
:next => 'int(11) DEFAULT NULL'
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -377,8 +377,8 @@ module Postal
|
|||||||
end
|
end
|
||||||
|
|
||||||
def finished
|
def finished
|
||||||
if @data.bytesize > 14.megabytes.to_i
|
if @data.bytesize > Postal.config.smtp_server.max_message_size.megabytes.to_i
|
||||||
return "552 Message too large (maximum size 14MB)"
|
return "552 Message too large (maximum size %dMB)" % Postal.config.smtp_server.max_message_size
|
||||||
end
|
end
|
||||||
|
|
||||||
if @headers['received'].select { |r| r =~ /by #{Postal.config.dns.smtp_server_hostname}/ }.count > 4
|
if @headers['received'].select { |r| r =~ /by #{Postal.config.dns.smtp_server_hostname}/ }.count > 4
|
||||||
|
|||||||
Reference in New Issue
Block a user