[type/__mail_alias] Update man.rst and make --alias required

This commit is contained in:
Dennis Camera 2020-10-01 12:55:38 +02:00
parent 161e1e85f4
commit c6b795b3f9
2 changed files with 14 additions and 7 deletions

View file

@ -39,6 +39,12 @@ in
exit 0 exit 0
fi fi
test -s "${__object:?}/parameter/alias" || {
printf 'The --alias parameter is required if --state present.\n' >&2
printf 'Use --state absent to remove all aliases.\n' >&2
exit 1
}
if test -s "${__object:?}/explorer/aliases" if test -s "${__object:?}/explorer/aliases"
then then
echo "update aliases" >>"${__messages_out:?}" echo "update aliases" >>"${__messages_out:?}"

View file

@ -8,7 +8,7 @@ cdist-type__mail_alias - Manage mail aliases.
DESCRIPTION DESCRIPTION
----------- -----------
This cdist type allows you to configure mail aliases (/etc/mail/aliases). This cdist type allows you to configure mail aliases (/etc/aliases).
REQUIRED PARAMETERS REQUIRED PARAMETERS
@ -21,11 +21,12 @@ OPTIONAL PARAMETERS
state state
'present' or 'absent', defaults to 'present' 'present' or 'absent', defaults to 'present'
alias alias
the aliases where mail for the given user should be redirected to. an alias, i.e. a mail address where mail for the user should be redirected
This parameter can be specified multiple times to redirect to more than one to.
recipient. This parameter can be specified multiple times to redirect to multiple
See the `aliases(5)` man page for the different forms this parameter can recipients.
take.. If ``--state`` is ``present`` this parameter is required.
See `aliases(5)` for the different forms this parameter can take.
BOOLEAN PARAMETERS BOOLEAN PARAMETERS
@ -51,7 +52,7 @@ BUGS
containing ``,`` (commas) are treated incorrectly (they are treated as two containing ``,`` (commas) are treated incorrectly (they are treated as two
addresses/aliases.) addresses/aliases.)
Make sure that email addresses do not contain commas. Make sure that email addresses do not contain commas.
- ``:include:`` directives in the aliases file are ignored by this type.
SEE ALSO SEE ALSO
-------- --------