Managing email aliases#
This manual is dedicated to users that are part of the aliases
group. It describes actions that can be done by those users on the email aliases.
Edit receiving aliases#
Open the /etc/aliases
file with your favorite CLI text editor (nano
, vim
, etc.). It should look something like this:
# See man 5 aliases for format.
# Use tab for alignment.
# To regenerate the db file run: newaliases
postmaster: root
root: nicolas
contact: nicolas,vincent,guilhem,audrey
alert: nicolas,vincent,guilhem
matrix-synapse: /dev/null
jellyfin: /dev/null
Important
After you’ve saved your edits, you have to regenerate the database (/etc/aliases.db
) using the following command:
newaliases
Add or remove a user from an alias#
Simply write or erase the name of the chosen user in the list that follows the alias name.
Create or delete an alias#
You can create as many aliases as you want by adding a new line to the file, following the Postfix aliases db syntax:
ALIAS: USER1[,USER2...]
To delete an alias, simply delete or comment out (using #
) the corresponding line.
Edit sending aliases#
The process is very similar from the edition of receiving aliases, but some differences exists:
The file to edit is
/etc/aliases_senders
.You must NOT use
:
between the key and the value.You must always specify the complete email address with
@club1.fr
.The command used to regenerate the database is:
/usr/sbin/postmap hash:/etc/aliases_senders
Advanced usage#
Comme indiqué précédemment, le fichier d’alias de réception /etc/aliases
respecte la syntaxe d’alias de Postfix.
En plus de rediriger les emails vers d’autres adresses,
elle permet de les envoyer vers des fichiers ou des commandes.
Dans ce cas, il faut faire attention aux permissions requises
pour créer les fichiers et exécuter les commandes.
Ces actions sont réalisées avec les droits de l’utilisateur correspondant à l’alias s’il existe
et sinon, sur CLUB1, avec l’utilisateur nobody
et le groupe mail
.
See also