[type/__dma] Fixes for FreeBSD

This commit is contained in:
Dennis Camera 2020-06-01 19:24:32 +02:00
parent 0657ac4f11
commit 7183bb3cd1
2 changed files with 11 additions and 5 deletions

View File

@ -108,7 +108,7 @@ function is_word(s) { return s ~ /^[A-Z_]+$/ }
function first(line, sep) { function first(line, sep) {
if (!sep) sep = SUBSEP if (!sep) sep = SUBSEP
return index(line, sep) ? substr(line, 0, index(line, sep)) : line return index(line, sep) ? substr(line, 1, index(line, sep) - 1) : line
} }
function rest(line, sep) { function rest(line, sep) {
@ -121,7 +121,7 @@ function conf_pop(word, value) {
if (!(word in conf)) return 0 if (!(word in conf)) return 0
if (!value) { if (!value) {
if (index(conf[word], SUBSEP)) # more than one element? if (index(conf[word], SUBSEP)) # more than one element?
value = substr(conf[word], 0, index(conf[word], SUBSEP)) value = substr(conf[word], 1, index(conf[word], SUBSEP) - 1)
else else
value = conf[word] value = conf[word]
} }
@ -256,10 +256,13 @@ then
then then
cat <<-EOF cat <<-EOF
sendmail root <<EOM sendmail root <<EOM
Subject: [cdist] Testing mail on '${__target_host}' Subject: [cdist] Test mail from '${__target_fqdn}'
You can safely ignore this message. It means your system will notify you Hi,
correctly of any relevant messages.
you can ignore this message.
Its sole purpose is to notify you that root mail on ${__target_fqdn}
will be redirected to you.
Enjoy! Enjoy!
EOM EOM

View File

@ -19,6 +19,9 @@ in
# Setup mailwrapper accordingly # Setup mailwrapper accordingly
__file '/etc/mail/mailer.conf' --mode 0644 --source - <<-'EOF' __file '/etc/mail/mailer.conf' --mode 0644 --source - <<-'EOF'
#
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
#
sendmail /usr/libexec/dma sendmail /usr/libexec/dma
send-mail /usr/libexec/dma send-mail /usr/libexec/dma
mailq /usr/libexec/dma mailq /usr/libexec/dma