Skip to main content

How to configure s-nail/s-mailx/mailx for use with Manitu

In context of Sending e-mail on successful SSH login I needed to configure s-nail 14(.9.25) (also known as s-mailx or command mailx) to send e-mail using hoster Manitu.

The working result for file ~/.mailrc was this:

set v15-compat
set mta=smtps://EMAIL:PASSWORD@mail.manitu.de:465 \
  smtp-auth=login

Without the set v15-compat I would get this error:

s-nail: New-style URL used without *v15-compat* being set                                                                                                               
/root/dead.letter 4/88                                                                                                                                                  
s-nail: ... message not sent

It is worth nothing that both parameters EMAIL and PASSWORD will need to have special characters percent-encoded — e.g. @ becomes %40 — to not violate URI syntax; see section "3.2.1. User Information" of RFC 3986 for details if curious.

Here is one way how to percent-encode a string on the command line:

# echo -n 'user@host.invalid' | python3 -c 'from urllib.parse import quote; import sys; print(quote(sys.stdin.read(), safe=""))'
user%40host.invalid
    ^^^

Please note that passwords should be passed through standard input rather than the command line, to not end up in shell history and to not be visible to other users of the system.

Did my post help? Let me know!