[type/__dma] Remove mail aliases functionality

This commit is contained in:
Dennis Camera 2020-05-31 15:06:06 +02:00
parent 3f72ca1341
commit b87b67597e
4 changed files with 6 additions and 107 deletions

View File

@ -1,68 +0,0 @@
# Based off FreeBSD's /etc/aliases
#
# >>>>>>>>>> The program "newaliases" must be run after
# >> NOTE >> this file is updated for any changes to
# >>>>>>>>>> show through to sendmail.
#
#
# See also RFC 2142, `MAILBOX NAMES FOR COMMON SERVICES, ROLES
# AND FUNCTIONS', May 1997
# http://tools.ietf.org/html/rfc2142
# Pretty much everything else in this file points to "root", so
# you would do well in either reading root's mailbox or forwarding
# root's email from here.
# root: me@my.domain
# Basic system aliases -- these MUST be present
MAILER-DAEMON: postmaster
postmaster: root
# General redirections for pseudo accounts
_dhcp: root
_pflogd: root
auditdistd: root
bin: root
bind: root
daemon: root
games: root
hast: root
kmem: root
mailnull: postmaster
man: root
news: root
nobody: root
operator: root
pop: root
proxy: root
smmsp: postmaster
sshd: root
system: root
toor: root
tty: root
usenet: news
uucp: root
# Well-known aliases -- these should be filled in!
manager: root
dumper: root
# BUSINESS-RELATED MAILBOX NAMES
info: root
marketing: root
sales: root
support: root
# NETWORK OPERATIONS MAILBOX NAMES
abuse: root
noc: root
security: root
# SUPPORT MAILBOX NAMES FOR SPECIFIC INTERNET SERVICES
ftp: root
ftp-bugs: ftp
hostmaster: root
webmaster: root
www: webmaster

View File

@ -19,18 +19,9 @@ email server configured in the `smart-host` parameter.
REQUIRED PARAMETERS
-------------------
smart-host
The destination email server. The addresses passed in `root-email` must be
either local to the `smart-host` or it must be configured to act as a relay
for the host being configured by this type.
REQUIRED MULTIPLE PARAMETERS
----------------------------
root-email
Destination email address. Can be specified multiple times or just once
with each address separated by commas.
This will be setup in `/etc/aliases` as the destination for the local
root mailbox.
The email server used to send email.
It must be configured to act as a relay for the host being configured by
this type so that mail can be sent to users non-local to the smart-host.
BOOLEAN PARAMETERS
@ -55,11 +46,7 @@ EXAMPLES
.. code-block:: sh
# Send root email to both our BOFH and the nice-admin.
# That way they can figure things out together.
__dma \
--root-email bofh@domain.tld \
--root-email nice-admin@domain.tld \
--smart-host mx1.domain.tld \
--send-test-email
@ -73,11 +60,12 @@ SEE ALSO
AUTHORS
-------
Evilham <contact@evilham.com>
Dennis Camera <dennis.camera@ssrq-sds-fds.ch>
COPYING
-------
Copyright \(C) 2020 Evilham. You can redistribute it
Copyright \(C) 2020 Evilham and Dennis Camera. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

View File

@ -1,8 +1,7 @@
#!/bin/sh -e
os="$(cat "${__global}/explorer/os")"
os=$(cat "${__global}/explorer/os")
root_email="$(tr '\n' ',' < "${__object}/parameter/root-email" | sed -E 's/,+$//')"
smart_host="$(cat "${__object}/parameter/smart-host")"
if [ -f "${__object}/parameter/mailname" ]; then
@ -21,14 +20,12 @@ else
esac
fi
aliases_file=/etc/mail/aliases
case ${os} in
debian|devuan|ubuntu)
# Debian-like requires installing DMA
__package dma
# Moving forward without DMA doesn't make much sense
export require="__package/dma"
aliases_file=/etc/aliases
;;
freebsd)
# Disable sendmail + stop if necessary
@ -134,20 +131,3 @@ EOF
__file /etc/dma/dma.conf --mode 0644 --source '-' <<EOF
${DMA_CONF}
EOF
# Setup aliases file (Debian doesn't create it by default)
__file --state exists \
--mode 0644 \
--source "${__type}/files/aliases" \
"${aliases_file}"
export require="${require} __file${aliases_file}"
# Setup the root alias
__key_value --key 'root' \
--delimiter ":" \
--comment "# Main admin(s) for this host" \
--value "${root_email}" \
--onchange 'newaliases' \
--file "${aliases_file}" \
root_mail_alias

View File

@ -1 +0,0 @@
root-email