Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fd0/vmail

command-line for managing mailboxes and aliases for mail server setups based on the howto (English) (German) by Thomas Leister
https://github.com/fd0/vmail

Last synced: 3 months ago
JSON representation

command-line for managing mailboxes and aliases for mail server setups based on the howto (English) (German) by Thomas Leister

Awesome Lists containing this project

README

        

vmail - command-line tool for managing mailboxes and aliases for mail server
setups based on the [howto (English)](https://thomas-leister.de/en/mailserver-debian-stretch)
([German](https://thomas-leister.de/mailserver-debian-stretch/))
by [Thomas Leister](https://thomas-leister.de).

This one is written in Go, there's also a version in Rust here: https://github.com/awidegreen/vmail-rs

Rationale: I was unable to compile a static binary using Rust locally, and the
version available in Debian stable (stretch) was too old to build it. So I
wrote my own version of the program in Go, which results in a static binary.

Building
========

You need Go >= 1.16, then run the following command inside the checked-out repository:

$ go build

This will pull the needed dependencies, verify them cryptographically and build
a static binary called `vmail`.

Database Connection
===================

The `vmail` binary will try to connect to the MySQL socket
`/run/mysqld/mysqld.sock` as the current user and tries to use the `vmail`
database. If you need to connect to a different database, you can pass the connection string (format described [here](https://github.com/go-sql-driver/mysql#dsn-data-source-name)) in the environment variable `$VMAIL_DB`. The format is:

[username[:password]@][protocol[(address)]]/dbname

For connecting a database on localhost via TCP with the user `foo`, the password `bar` and the database name `zzz`, use the following string:

$ export VMAIL_DB='foo:bar@tcp(localhost:3306)/zzz'

Managing Domains, Mailboxes, and Aliases
========================================

Create new domain:

$ vmail create domain example.com

Create new alias:

$ vmail create alias [email protected] [email protected]

Add a new email address to an existing alias:

$ vmail create alias [email protected] [email protected]

Create a mailbox:

$ vmail create mailbox [email protected]
enter password:
repeat password:
mailbox [email protected] created

List a domain:

$ vmail show example.com
Mailbox Quota Enabled
---------------------------------------
[email protected] true
---------------------------------------

Alias Destinations
----------------------------------------------
[email protected] [email protected]
[email protected]
----------------------------------------------

Add a catch-all alias (mind the quotes):

$ vmail create alias '*@example.com' [email protected]

List the domain again:

$ vmail show example.com
Mailbox Quota Enabled
---------------------------------------
[email protected] true
---------------------------------------

Alias Destinations
----------------------------------------------
*@example.com [email protected]
[email protected] [email protected]
[email protected]
----------------------------------------------

List all domains:

$ vmail domains
example.com

Change the password for a mailbox:

$ vmail password [email protected]
enter password:
repeat password:
password for [email protected] updated