MyNixOS website logo
Description

Minimal mail delivery agent (MDA) for local mail with maildir support.

Acts as a minimal (local delivery only, many features un-implemented) mail delivery agent (or MDA), delivering mail to a local maildir format spool. Handy when you don't want to install an MTA (Mail Transfer Agent) or fuller-featured MDA - you just want a program which accepts sendmail-style delivery of messages from local programs, and dumps them somewhere you can read them.

attomail Hackage version

Minimal mail delivery agent (MDA) for local mail with maildir support - a Haskell re-implementation of femtomail

quick installation

$ stack install attomail && sudo cp ~/.local/bin/attomail /usr/local/bin
$ cat << EOF | sudo tee -a /etc/attomail.conf
mailDir = /path/to/my/home/dir/Maildir/new 
userName = myuserid
EOF
$ mkdir -p /path/to/my/home/dir/Maildir/new

prerequisites

  • Haskell
  • unlikely to work properly on anything but a Linux system

purpose

Acts as a minimal (local delivery only, many features un-implemented) mail delivery agent, or MDA, delivering mail to a local maildir format spool. Handy when you don't want to install an MTA (Mail Transfer Agent) or fuller-featured MDA - you just want a program which accepts sendmail-style delivery of messages from local programs, and dumps them somewhere you can read them.

It is a port of femtomail to Haskell. (See this StackExchange posting for femtomail's inception.)

configuration

By default, uses /etc/attoparse.conf as a configuration file.

/etc/attoparse.conf needs to contain two lines, specifying the path to a directory where messages should be delivered, and the userid of the person who owns that directory.

e.g.:

mailDir = /path/to/my/home/dir/Maildir/new 
userName = myuserid

So that other programs can find it, you probably want to install attomail somewhere on the system path - e.g. in /usr/local/bin/attomail.

attomail needs to be either run by the user specified in the config file, or (more likely, if being called by, say, some cron job) root (or some other account with permission to change uid, etc.). This is because it makes use of the setresgid and setresuid C functions to change its uid etc to that user, and ability to do that is normally restricted.

To use some other location for the configuration file, define CONF_PATH as a macro when running ghc.

e.g.:

stack build --ghc-options -optP-DCONF_PATH=/some/dir/my.conf 

or

cabal build --ghc-option=-optP-DCONF_PATH=/some/dir/tmp.conf  

No claims that this program is at all secure, use at your own risk.

command-line arguments

Usage:

  • attomail [-f ADDRESS] [-F NAME] [-b MODE] [-i] [-o ARG] [-O ARG] [-B ARG] [-q ARG] [-v] RECIPIENTS...

Arguments that are actually processed:

  -bm         Read input from stdin, deliver mail in the usual way (default).
  -Ffullname  Set the full name of the sender.
  -fname      Sets the name of the `from' person (i.e., the sender of the mail put on the enevelope)

Various ignored options, included only for compatibility with sendmail: -i, -o, -O, -B, -q, -v.

testing

  • If you have a mail program installed, just use that for testing the installation. Messages to any address at all, local or remote, should go to the mail spool specified.

  • Alternatively:

    $ cat | sendmail [email protected] << EOF 
    To: someone@somewhere
    Subject: mysubject
    
    some body
    EOF
    

    <ctrl-d>

portability

Probably won't work on anything but Linux systems.

API

None, yet, there's only an executable, not a library. But (sssh) take a peek here if you like, there should be some minimal documentation of the internal modules.

Metadata

Version

0.1.0.2

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows