madm

Artifact Content
Login

Artifact 90d7e849ef964e36116bcf83ec5ec32e2fda9bf37185517494266cf30a6fd241:


= Documentation

madm is a mailadmin component to manage mail server user data.
It is programmed in Lua (5.2/5.3) with a redis data backend.

usage help is provided via "-h" option or in console "h" command.

== Structure

The configuration is split into three layers:
- (global) config
- domain
- user

Each layer has attributes, some are inherited.
Authentication and admin flags are required to modify these attributes.

A request is send from a client with a user. Authentication contains:
user:user_password,client:client_password,unique_identification (for each request)

The UID is a counter that has to be higher than last request id to prevent sending a request again.
The user is a full email address: admin@example.com
The client is a name (adminpc | webmail.example.com | ..) and can be restricted to an IP address.
Users could be jailed to access only from resticted clients.

== Attributes

=== Config attributes (including admin flags)

admin_flag_config_users -> users can edit config attributes
admin_flag_global_domain_users -> users can add/remove/manage all domains (and users)
admin_flag_mailbox_limit_overrule_config_users
admin_flag_mailbox_limit_overrule_domain_users
-> mailbox limit is inherited a user mailbox limit can not be set higher than config or domain level
-> by a user, that can not change the level as well or may overrule:
admin_flag_read_data_users -> allows to read (and resolve) recipient_data and mailbox_data
admin_flag_read_only_users -> good for (mailserver) query user .. not allowed to change any data
admin_flag_read_pass_users -> allows to read out password - handle with care
debug_client_auth -> used to check out, why client request fail, not recommended in a productive environment
enable_cgi_request_method_get -> allow GET requests (instead of POST only)
mailbox_delete_command -> command to remove a mailbox from filesystem
mailbox_delete_path_min_length -> security option, so no one can try to delete "/" but has to delete at last "/path_min_length" characters
mailbox_limit -> mailbox size limit - has to be checked and interpreted by mailserver
mailbox_limit_sender -> if over limit mail is fetched, this could be used to set up a sender address
mailbox_limit_subject -> subject for over limit mail
mailbox_limit_subject_warn -> subject for over limit mail in state warning
mailbox_limit_text -> mail body for over limit mail
mailbox_limit_warn -> mailbox warn size limit
mailbox_path -> has to be set in config .. base path for mailboxes
mailbox_size_cache_interval -> if size is checked via command (not maildir) it is cached to spare load
mailbox_size_check_command -> command to check mailbox size
mailbox_type -> supported: mbox/maildir
online -> "main power switch"
password_condition -> is an array of regular expressions against the passwords (lua style)
password_min_length -> minimum length of a user/client password

=== Domain attributes

active -> on/off switch for domain
admin_users -> users, that are allowed to add/remove/manage users of this domain
alias -> ALL mailboxes will be resolved to this alias domain
catchall -> catch all mailbox name (empty for no catch all)
created -> read_only time of domain creation
mailbox_limit -> inherited from config, if not set
mailbox_limit_warn -> inherited from config, if not set
mailbox_path -> path for domain mails - (default, if not set: "/${(config) mailbox_path}/${DOMAIN}")
mailbox_type -> inherited from config, if not set

=== User attributes

active -> on/off switch for user
admin_domains -> domains, on that this user is allowed to add/remove/manage users
admin_flags -> flag names for config flags
aliases -> array of aliases
autore_active -> read only, if autoresponder is active
autore_end -> end time (%Y%m%d) of autoresponder (empty if no end or not active)
autore_reply_as -> mail sender
autore_start -> start time of autoresponder (set only if not started yet)
autore_subject -> mail subject
autore_text -> mail body
created -> read_only time of user  creation
last_access -> may be set on mailbox access / send mail
mailbox -> 1/0 has mailbox or alias only
mailbox_data -> special attribute (read only mailbox data for imap/pop server) returns mailbox size, (over) limit data and mailbox path
mailbox_limit -> inherited from domain, if not set
mailbox_limit_warn -> inherited from domain, if not set
mailbox_path -> path for user mails - (default, if not set: "/${(config) mailbox_path}/${DOMAIN}/${USER}")
mailbox_size -> current (cached) size of the mailbox
mailbox_type -> inherited from domain, if not set
pass -> user password
recipient_data -> special attribute (read only recipient data for mailserver) returns a full resolved recipient list (combination of mailbox paths and aliases)
restricted_clients -> restrict access only from these clients.

=== Client attributes

active -> active, if pass is set
pass -> client password
ip -> may be set to restrict the client on a static IP

----
https://gitlab.com/mdkmde/madm/ - matthias (at) koerpermagie.de

Copyright (c) ISC License

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
----