Simpler wrapper around the API for forwardmx.io
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src/forwardmx
test/forwardmx
.gitignore
CHANGELOG.md
LICENSE
README.md
project.clj

README.md

forwardmx

A Clojure library to wrap the API for the forwardmx.io email forwarding service.

forwardmx.io provides a simple service for forwarding mail for multiple domains.

This library simplifies using it from clojure and, in particular, provides a single function to populate forwardmx.io from a Postfix virtual file.

Usage

You will need to set up an API key where it can be found by the environ library. For example it could simply be in the environment as API_KEY.

(ns this.app
  (:require
   [forwardmx.core :as fmx]
   [forwardmx.domain :as domain]   
   [forwardmx.alias :as alias]
   ))
   
   
;; Import the aliases for a particular domain from a Postfix virtual file
(fmx/import-postfix-virtual "virtual" "example.com")

;; Import all aliases  from a Postfix virtual file
(fmx/import-postfix-virtual "virtual")

(domain/create! "x.y.com")
(alias/create! "x.y.com" "ian" "ian@otherdomain.com" )
(alias/update! "x.y.com" "" "ian@domatogetcatchall.com" ) ;; catchall address for this domain

(alias/update! "x.y.com" "ian" "janine@example.com")

(alias/destroy! "x.y.com" "ian")

(domain/destroy! "x.y.com")


License

Copyright © 2017

Distributed under the Eclipse Public License either version 1.0 or any later version.