Package: mail_alias_creator
mail_alias_creatorA python program to create our mail alias tables from alias definitionsConfigurationA configuration file is needed to configure this software.
By default it looks formac.confin the current working directory,
but this can be changed by the-ccommand line option or theMAC_CONFIGenvironment variable.The configuration file is read by python configparser and must adhere to its format.A typical configuration file looks like this:[main]
logging_conf = logging.conf
strict = false
check_syntax_only = false
dummy_sender_uid = mydummy
dummy_recipient_address = mydummy@example.com

[LDAP]
uri = ldaps://myldap.com
user_search_base = ou=users,dc=example,dc=com
group_search_base = ou=groups,dc=example,dc=com
user_filter = (objectClass=posixUser)
group_filter = (objectClass=posixGroup)
user_uid_field = uid
user_primary_mail_field = mail
group_id_field = cn
group_membership_field = memberUidThelogging_confis file path relative to the main configuration file (or absolute). At this path should be a pythonlogging.confcompatible logging configuration. This option may be omitted.Thestrictflag enables strict checking of the inputs. In this case the program exits with a non-zero exit code when a possible problem with the given files is detected. This option may be omitted, which set's it to false.Thecheck_syntax_onlyflag can be used to abort the program after loading the alias files. This option may be omitted, which set's it to false.Thedummy_sender_uidanddummy_recipient_addressfields are optional.
It is also possible to set one and omit the other
If set to a non-empty string the respective uid or address is used for all aliases that are defined but do not have an actual sender or recipient (this can be the case if the primary mail of a user can't be found, a group is empty, theforbidSendorforbidReceiveflags are used or for the sender of an alias which only has entries of theexternal_addresskind).
This can be used to make sure the alias still appears in the generated lists giving the mail processing system the ability to
react accordingly.In the LDAP section some more variables than shown are supported.
For a complete list and some explanations seeldap.py.Alias defintion formatAll given files and all files (recursively) in given folders are parsed as yaml files.Each file must be of the following format:meta:name:<name of the file>description:<description of the file>aliases:<alias_mail>:description:<description of the alias>entries:-kind:<kind>...-kind:<kind2>...<alias_mail2> ......Alias entry kindThe following kinds of alias entries are currently supported.UserThe user alias kind can be used to allow users to send and receive emails to/from this alias.Kind name:userFormat:-kind:useruser:<username>Optional attribuesThe following optional attributes may be added.namedefaultdescriptionforbidSendFalseForbid the user to send via this alias.forbidReceiveFalseDon't foward incoming mails to that user.GroupThe group alias kind can be used to allow a whole group to send and receive emails to/from this alias.Kind name:groupFormat:-kind:groupgroup:<groupname>Optional attribuesThe following optional attributes may be added.namedefaultdescriptionforbidSendFalseForbid the group to send via this alias.forbidReceiveFalseDon't foward incoming mails to the users of this group.Include aliasThe include alias kind can be used to include another alias in this alias.
As the argument another alias  defined in this repo must be given.
Every recipient from that given alias is also forwared incoming mails to this alias.
Every sender from that given alias send mails via this alias.
If the given address is not an alias defined in this repo there will be an error.Kind name:include_aliasFormat:-kind:include_aliasalias:<alias address>Optional attribuesThe following optional attributes may be added.namedefaultdescriptionforbidSendFalseForbid the members of the given alias to send via this alias.forbidReceiveFalseDon't foward incoming mails to the members of the given alias.External addressThe external address kind can be used to forward mails to external email addresses.
Sending is not possible for entries with this kind.Kind name:external_addressFormat:-kind:external_addressaddress:<email address>Optional attribuesEven though they do not make much sense, the following optional attributes may be added.namedefaultdescriptionforbidSendFalseForbid the members of the given alias to send via this alias.forbidReceiveFalseDon't foward incoming mails to the members of the given alias.