AddAlias adds a new alias, it returns the id of the alias in the table and any error that occcurred.
AddMailUser adds a new mail user.
AddVirtualDomain adds the domain to the database.
BootstrapAdminsTemplate is the template for the admins page.
BootstrapAliasesTemplate is the template for the alias page.
BootstrapChangePWTemplate is the template for the change email password site.
BootstrapDomainsTemplate is the template for the domains page.
BootstrapLicenseTemplate is the template for the license template.
BootstrapLoginTemplate is the template for the login page.
BootstrapUsersTemplate is the template for the users page.
ChangeSinglePasswordHandler returns on get the template for changing a single password (RenderChangePWTemplate) and on post calls ChangeSinglePw to update te password.
ChangeSinglePw reads a JSON encoded map from the body, it must have the form: {'mail': <Mail>, 'old_password': <Old>, 'new_password': <New>} It compares the old password with the one in the database, if this is not correct or the email doesn't exist it responds with a 400.
ChangeUserPassword changes the password for the user with the given id, it returns an error != nil if something went wrong.
CheckLogin checks the login data contained in the body of the request.
DelAlias deletes the alias with the given id.
DeleteVirtualDomain deletes the domain.
DelMailUser removes the user with the given id.
GenDovecotSHA512 generates the SHA512 hash of the given password.
GenKeyPair generates a new auth-key, encryption-key pair.
ListAdminsJSON is the main handler for /api/admins.
ListAliasesJSON is the main handler for /api/aliases.
ListAllUsers lists all users for a given domain.
ListDomainsJSON is the main handler for domains.
ListUsersJSON handles the /api/users domains.
ListVirtualAliases lists all virtual aliases given an domainID.
ListVirtualDomains returns a map containing all virtual domains in the form id --> name.
No description provided by the author
LoginPageHandler is a handler that returns the login template for GET and uses CheckLogin for POST.
LoginRequired takes a handler function and returns a new handler function that first checks if the login is correct.
Logout will set the MaxAge of the session to -1 and thus destroy the session.
NewListResultForVirtualAlias creates a new ListUserResult for a virtual alias.
NewListResultForVirtualUser creates a new ListUserResult for a virtual user.
NewMailAppHandler returns a new MailAppHandler.
ParseConfig parses the configuration file (called mailconf in the config dir).
ParseMailParts splits an email address and returns the part before the @, the domain and an error if this is not possible.
ReadKeyPairs reads the key pairs from the key files.
RenderAdminsTemplate renders the template appContext.Templates["admins"].
RenderAliasesTemplate renders the template appContext.Templates["aliases"].
RenderChangePWTemplate renders the template appContext.Templates["change-pw"].
RenderDomainsTemplate renders the template appContext.Templates["domains"].
RenderLicenseTemplate renders the template appContext.Templates["license"].
RenderLoginTemplate renders the template stored in appContext.Templates["login"].
RenderRootTemplate renders the template appContext.Templates["root"].
RenderUsersTemplate renders the template appContext.Templates["users"].
RootBootstrapTemplate is the template for the main page (/).
RootPageHandler is a handler that returns the root page.
StaticHandler is a http handler that serves files in the static directory.
WriteKeyPairs writes the key pairs to the file specified in path.