مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
By default, we will now listen directly on various ports [breaking]
This allows us to avoid messing around with changes to iptables and generally makes installation easier for everyone. If you have an instance of postal before this, you will need to do a couple of things to ensure your installation continues to work. 1. You will need to specify a `fast_server.bind_address` in your postal.yml configuration file. This is the IP that you dedicated to the fast server. 2. You will need to allow Ruby to listen on privileged ports (sudo setcap 'cap_net_bind_service=+ep' /usr/bin/ruby2.3). 3. You will need to remove any iptables rules that you may have added previously to accomodate the older way of doing this.
هذا الالتزام موجود في:
@@ -22,8 +22,8 @@ web_server:
|
||||
fast_server:
|
||||
enabled: false
|
||||
bind_address: 0.0.0.0
|
||||
port: 5010
|
||||
ssl_port: 5011
|
||||
port: 80
|
||||
ssl_port: 443
|
||||
proxy_protocol: false
|
||||
default_private_key_path: # Defaults to config/fast_server.key
|
||||
default_tls_certificate_path: # Defaults to config/fast_server.cert
|
||||
@@ -58,14 +58,12 @@ workers:
|
||||
quantity: 1
|
||||
|
||||
smtp_server:
|
||||
port: 25
|
||||
tls_enabled: false
|
||||
tls_certificate_path: # Defaults to config/smtp.crt
|
||||
tls_private_key_path: # Defaults to config/smtp.key
|
||||
proxy_protocol: false
|
||||
log_connect: true
|
||||
evented: true
|
||||
ports:
|
||||
- 2525
|
||||
|
||||
smtp_relays:
|
||||
-
|
||||
@@ -88,7 +86,7 @@ dns:
|
||||
|
||||
smtp:
|
||||
host: 127.0.0.1
|
||||
port: 2525
|
||||
port: 25
|
||||
username: # Complete when Postal is running and you can
|
||||
password: # generate the credentials within the interface.
|
||||
from_name: Postal
|
||||
|
||||
@@ -8,6 +8,7 @@ fast_server:
|
||||
# This can be enabled to enable click & open tracking on emails. It is disabled by
|
||||
# default as it requires a separate static IP address on your server.
|
||||
enabled: false
|
||||
bind_address:
|
||||
|
||||
general:
|
||||
# This can be changed to allow messages to be sent from multiple IP addresses
|
||||
|
||||
@@ -6,14 +6,19 @@ module Postal
|
||||
class Server
|
||||
|
||||
def run
|
||||
if Postal.config.fast_server.bind_address.blank?
|
||||
Postal.logger_for(:fast_server).info "Cannot start fast server because no bind address has been specified"
|
||||
exit 1
|
||||
end
|
||||
|
||||
Thread.abort_on_exception = true
|
||||
TrackCertificate
|
||||
server_sockets = {
|
||||
TCPServer.new(Postal.config.fast_server.bind_address, Postal.config.fast_server.ssl_port) => {:ssl => true},
|
||||
TCPServer.new(Postal.config.fast_server.bind_address, Postal.config.fast_server.port) => {:ssl => false},
|
||||
}
|
||||
Postal.logger_for(:fast_server).info("Fast server started listening on HTTP port #{Postal.config.fast_server.port}")
|
||||
Postal.logger_for(:fast_server).info("Fast server started listening on HTTPS port #{Postal.config.fast_server.ssl_port}")
|
||||
Postal.logger_for(:fast_server).info("Fast server started listening on HTTP (#{Postal.config.fast_server.bind_address}:#{Postal.config.fast_server.port})")
|
||||
Postal.logger_for(:fast_server).info("Fast server started listening on HTTPS port (#{Postal.config.fast_server.bind_address}:#{Postal.config.fast_server.ssl_port})")
|
||||
loop do
|
||||
client = nil
|
||||
ios = select(server_sockets.keys, nil, nil, 1)
|
||||
|
||||
@@ -7,7 +7,6 @@ module Postal
|
||||
|
||||
def initialize(options = {})
|
||||
@options = options
|
||||
@options[:ports] ||= Postal.config.smtp_server.ports
|
||||
@options[:debug] ||= false
|
||||
prepare_environment
|
||||
end
|
||||
@@ -49,7 +48,7 @@ module Postal
|
||||
if ENV['SERVER_FD']
|
||||
@server = TCPServer.for_fd(ENV['SERVER_FD'].to_i)
|
||||
else
|
||||
@server = TCPServer.open('::', @options[:ports].first)
|
||||
@server = TCPServer.open('::', Postal.config.smtp_server.port)
|
||||
end
|
||||
@server.autoclose = false
|
||||
@server.close_on_exec = false
|
||||
@@ -62,7 +61,7 @@ module Postal
|
||||
@server.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPCNT, 5)
|
||||
end
|
||||
ENV['SERVER_FD'] = @server.to_i.to_s
|
||||
logger.info "Listening"
|
||||
logger.info "Listening on port #{Postal.config.smtp_server.port}"
|
||||
end
|
||||
|
||||
def unlisten
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم