Merge branch 'master' into feature-alternative-domains

master
kaiyou 7 years ago
commit 2631de8977

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

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

@ -23,7 +23,7 @@ def manager_create(domain_name):
]
if form.validate_on_submit():
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)
elif user in domain.managers:
flask.flash('User %s is already manager' % user, 'error')

@ -44,7 +44,7 @@ def certbot_install(domain):
@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():
print("Generating TLS certificates using Certbot")
hostname = app.config["HOSTNAME"]

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

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

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

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

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

@ -4,7 +4,7 @@ query =
FROM
(SELECT destination, email, wildcard, localpart FROM alias
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
(
wildcard = 0

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

Loading…
Cancel
Save