mailserver/smtp/start.sh

33 lines
898 B
Bash
Executable File

#!/bin/sh
echo "myorigin = ${MYHOSTNAME}" >> /etc/postfix/main.cf
echo "myhostname = ${MYHOSTNAME}" >> /etc/postfix/main.cf
echo "smtpd_tls_key_file = /certs/${MYHOSTNAME}.key" >> /etc/postfix/main.cf
echo "smtpd_tls_cert_file = /certs/${MYHOSTNAME}.crt" >> /etc/postfix/main.cf
echo "user = ${DATABASE_USER}
password = ${DATABASE_PASSWORD}
hosts = db
dbname = ${DATABASE_NAME}
table = alias
select_field = goto
where_field = address" > /etc/postfix/virtual_alias_maps.cf;
echo "user = ${DATABASE_USER}
password = ${DATABASE_PASSWORD}
hosts = db
dbname = ${DATABASE_NAME}
table = domain
select_field = domain
where_field = domain" > /etc/postfix/virtual_mailbox_domains.cf;
echo "user = ${DATABASE_USER}
password = ${DATABASE_PASSWORD}
hosts = db
dbname = ${DATABASE_NAME}
table = mailbox
select_field = maildir
where_field = username" > /etc/postfix/virtual_mailbox_maps.cf;
postfix start-fg