40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
# ------------------------------------------------------------------------------
|
|
# Mail system
|
|
# This file is part of the init.sh project
|
|
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
|
# ------------------------------------------------------------------------------
|
|
# This file is distributed under 3-clause BSD license.
|
|
# The complete license agreement can be obtained at:
|
|
# https://opensource.org/licenses/BSD-3-Clause
|
|
# ------------------------------------------------------------------------------
|
|
# Variable:
|
|
# * HOSTNAME: Name of the host
|
|
# * MAINDOM: Default main domain name
|
|
# ------------------------------------------------------------------------------
|
|
|
|
export VER_conf_mail="0.0.3"
|
|
|
|
conf_mail()
|
|
{
|
|
prnt I "Installation de postfix..."
|
|
pkginst postfix
|
|
|
|
prnt I "Configuration de postfix..."
|
|
installfile postfix_main.cf /etc/postfix/main.cf
|
|
sed -i -e "s/@HOSTNAME@/$HOSTNAME/" -e "s/@MAINDOM@/$MAINDOM/" \
|
|
/etc/postfix/main.cf
|
|
echo $HOSTNAME.$MAINDOM > /etc/mailname
|
|
svc_restart postfix
|
|
}
|
|
|
|
precheck_conf_mail()
|
|
{
|
|
[[ -n $MAINDOM ]] && (
|
|
prnt E "Aucun domaine principal renseigné."
|
|
die 158
|
|
)
|
|
}
|
|
|
|
export -f conf_mail
|
|
export -f precheck_conf_mail
|