Categorygithub.com/rverst/go-miab
module
1.0.0
Repository: https://github.com/rverst/go-miab.git
Documentation: pkg.go.dev

# README

go-miab

go-miab is a simple command-line tool, designed to manage a Mail-in-a-Box, written in Go.

Go Report Card

Overview

go-miab contains the package miab that wraps the API of a Mail-in-a-Box instance. Additionally there is an command-line interface (CLI) to access the Mail-in-a-Box API directly. Most of the endpoints, that the Mail-in-a-Box API provides should be covered (Mail-in-a-Box v0.42b).

  • Query custom DNS records
  • Add or set (overwrite) custom DNS records
  • Delete custom DNS records
  • Query e-mail users
  • Create e-mail users and mail-domains
  • Delete e-mail users
  • Set e-mail users privileges
  • Query e-mail aliases
  • Create e-mail aliases
  • Delete e-mail aliases

There is also a small tool to update a custom DNS address record regularly. I use this tool, running in a docker container on my NAS, to update my address record (changing IP's) at home. This tool was the occasion to write go-miab at all :-).

Installation

Binary Release

Download a binary release from the release page.

Build miab in the official golang docker container:

git clone https://github.com/rverst/go-miab.git
cd go-miab
sudo docker run --rm -it -v "$PWD":/usr/src/miab -w /usr/src/miab golang:1.12.9 ./build_miab.sh

Go

go get github.com/rverst/go-miab

// to install the cli
cd $GOPATH/src/github.com/rverst/go-miab
go install ./cmd/cli/miab.go

Usage

First you have to provide the credentials and endpoint for your Mail-in-a-Box instance. There are several ways to do so:

  1. Command-line

    miab --user [email protected] --password secretpassword --endpoint https://box.example.org
    or
    miab -u [email protected] -p secretpassword -e https://box.example.org
    
  2. Environment variables

    [email protected] \
    export MIAB_USER \
    MIAB_PASSWORD=secretpassword \
    export MIAB_PASSWORD \
    MIAB_ENDPOINT=https://box.example.org \
    export MIAB_ENDPOINT
    
  3. Config file

    user: [email protected]
    password: supersectet
    endpoint: https://box.example.org
    

    The default location for the config file is $HOME/.config/go-miab/miab.yaml. The location can be specified via the config flag.

Run miab help for available commands.

Dependencies

go-miab uses and relies on the following, awesome libraries (in lexical order):

DependencyLicense
github.com/mitchellh/go-homedirMIT License
github.com/spf13/cobraApache License 2.0
github.com/spf13/pflagBSD 3-Clause "New" or "Revised" License
github.com/spf13/viperMIT License
gopkg.in/yaml.v3MIT License and Apache License 2.0

# Packages

No description provided by the author
Package miab is a wrapper for the API of a Mail-in-a-Box instance (https://mailinabox.email).