lib.aliases #
Constants #
const file_aliases_default = if os.is_dir('/cfg') { '/cfg/mail/aliases' } else { '/etc/aliases' }
fn is_email_address #
fn is_email_address(email string) !bool
fn new_aliases #
fn new_aliases(path string) Aliases
new_aliases returns the aliases struct populated with users and the provided path
fn (Aliases) add #
fn (mut o Aliases) add(from string, to string) !bool
add adds an alias
fn (Aliases) has #
fn (mut o Aliases) has(from string) bool
has returns true/false after checking the databsae for the alias
fn (Aliases) get #
fn (mut o Aliases) get(from string) ?string
get returns the receipient for alias
fn (Aliases) del #
fn (mut o Aliases) del(from string) bool
del with remove the alias from the database
fn (Aliases) read #
fn (mut o Aliases) read() bool
read reads the aliases file into memory
fn (Aliases) write #
fn (o Aliases) write() !bool
write writes the aliases from memory to file