Merge branch 'master' into feature-alternative-domains

master
kaiyou 7 years ago
commit 2631de8977

@ -73,6 +73,10 @@ RELAYHOST=
# Fetchmail delay # Fetchmail delay
FETCHMAIL_DELAY=600 FETCHMAIL_DELAY=600
# Recipient delimiter, character used to delimiter localpart from custom address part
# e.g. localpart+custom@domain;tld
RECIPIENT_DELIMITER=+
################################### ###################################
# Nginx settings # Nginx settings
################################### ###################################

@ -46,7 +46,9 @@ login_manager = flask_login.LoginManager()
login_manager.init_app(app) login_manager.init_app(app)
babel = flask_babel.Babel(app) babel = flask_babel.Babel(app)
translations = list(map(str, babel.list_translations())) translations = list(map(str, babel.list_translations()))
scheduler = background.BackgroundScheduler() scheduler = background.BackgroundScheduler({
'apscheduler.timezone': 'UTC'
})
# Manager commnad # Manager commnad
manager = flask_script.Manager(app) manager = flask_script.Manager(app)

@ -23,7 +23,7 @@ def manager_create(domain_name):
] ]
if form.validate_on_submit(): if form.validate_on_submit():
user = models.User.query.get(form.manager.data) user = models.User.query.get(form.manager.data)
if user not in available_users: if user.email not in [user.email for user in available_users]:
flask.abort(403) flask.abort(403)
elif user in domain.managers: elif user in domain.managers:
flask.flash('User %s is already manager' % user, 'error') flask.flash('User %s is already manager' % user, 'error')

@ -44,7 +44,7 @@ def certbot_install(domain):
@scheduler.scheduled_job('date') @scheduler.scheduled_job('date')
@scheduler.scheduled_job('cron', hour=96, minute=0) @scheduler.scheduled_job('cron', day='*/4', hour=0, minute=0)
def generate_cert(): def generate_cert():
print("Generating TLS certificates using Certbot") print("Generating TLS certificates using Certbot")
hostname = app.config["HOSTNAME"] hostname = app.config["HOSTNAME"]

@ -127,7 +127,7 @@ service imap-login {
protocol lmtp { protocol lmtp {
mail_plugins = $mail_plugins sieve mail_plugins = $mail_plugins sieve
recipient_delimiter = + recipient_delimiter = {{ RECIPIENT_DELIMITER }}
} }
service lmtp { service lmtp {

@ -23,6 +23,7 @@ http {
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
server_tokens off; server_tokens off;
client_max_body_size 25m;
server { server {
listen 80; listen 80;

@ -23,6 +23,7 @@ http {
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
server_tokens off; server_tokens off;
client_max_body_size 25m;
server { server {
listen 80; listen 80;

@ -18,6 +18,7 @@ http {
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
server_tokens off; server_tokens off;
client_max_body_size 25m;
server { server {
listen 80; listen 80;

@ -28,6 +28,9 @@ mydestination =
# Relayhost if any is configured # Relayhost if any is configured
relayhost = {{ RELAYHOST }} relayhost = {{ RELAYHOST }}
# Recipient delimiter for extended addresses
recipient_delimiter = {{ RECIPIENT_DELIMITER }}
############### ###############
# TLS # TLS
############### ###############

@ -4,7 +4,7 @@ query =
FROM FROM
(SELECT destination, email, wildcard, localpart FROM alias (SELECT destination, email, wildcard, localpart FROM alias
UNION UNION
SELECT email||(CASE WHEN forward_enabled=1 THEN ','||forward_destination ELSE '' END) AS destination, email, 0 as wildcard, localpart FROM user) SELECT (CASE WHEN forward_enabled=1 THEN (CASE WHEN forward_keep=1 THEN email||',' ELSE '' END)||forward_destination ELSE email END) AS destination, email, 0 as wildcard, localpart FROM user)
WHERE WHERE
( (
wildcard = 0 wildcard = 0

@ -5,7 +5,7 @@ for VARIABLE in `env | cut -f1 -d=`; do
sed -i "s={{ $VARIABLE }}=${!VARIABLE}=g" /etc/postfix/*.cf sed -i "s={{ $VARIABLE }}=${!VARIABLE}=g" /etc/postfix/*.cf
done done
# Override Postfix configuration # Override Postfix main configuration
if [ -f /overrides/postfix.cf ]; then if [ -f /overrides/postfix.cf ]; then
while read line; do while read line; do
postconf -e "$line" postconf -e "$line"
@ -15,6 +15,16 @@ else
echo "No extra postfix settings loaded because optional '/overrides/postfix.cf' not provided." echo "No extra postfix settings loaded because optional '/overrides/postfix.cf' not provided."
fi fi
# Override Postfix master configuration
if [ -f /overrides/postfix.master ]; then
while read line; do
postconf -Me "$line"
done < /overrides/postfix.master
echo "Loaded '/overrides/postfix.master'"
else
echo "No extra postfix settings loaded because optional '/overrides/postfix.master' not provided."
fi
# Include table-map files # Include table-map files
if ls -A /overrides/*.map 1> /dev/null 2>&1; then if ls -A /overrides/*.map 1> /dev/null 2>&1; then
cp /overrides/*.map /etc/postfix/ cp /overrides/*.map /etc/postfix/

Loading…
Cancel
Save