Last time I used postfix, and it was a mess until everything was configured to send my root-mail to my gmx-address .. however in the end it worked.

This time I wanted to prevent that mess by using nullmailer .. however nullmailer as well provides some trouble.

Here my settings:

sudo less /etc/nullmailer/adminaddr

/etc/nullmailer/defaultdomain is empty

sudo less /etc/nullmailer/remotes
mail.gmx.net smtp --port=465 --starttls --user=myMailProxy@gmx.de --pass=someSecret

I as well configured /etc/aliases ... no idea if that matters at all:

root: myMailAddress@gmx.de

After configuration and restarting the service:

sudo service nullmailer restart

I tried to send a testmail:

mail -s "whatever" root < /dev/null

But it failed ... I can read the following error in /var/log/mail.err:

Apr 20 22:20:58 desktop-pc nullmailer[4727]: smtp: Failed:
Apr 20 22:20:58 desktop-pc nullmailer[4717]: Sending failed:  Protocol error

So how to get things debugged now ? Or should I pick another mail provider to send my root-mails ?


Using port 587 with TLS leads to another error: ( Same when using port 465 with --ssl )

Apr 21 08:12:43 schwinn-desktop nullmailer[1319]: smtp: Failed: 550-Requested action not taken: mailbox unavailable#012550 Sender address is not allowed.
Apr 21 08:12:43 schwinn-desktop nullmailer[1285]: Sending failed:  Permanent error in sending the message


Finnaly, thanks to emk2203, I use dma(dragonfly mail transfer agent) instead of nullmailer, which I was able to bring to work in less than 5min.


The way GMX documents it, you have to use port 465 with SSL - you are using it with TLS, which should use port 587. So either change your port or your protocol, both should work.

Also, as an anti-spam measure, GMX only accepts messages from a valid GMX sender - no stuff like root@mymachine.local or similar.

What works is if you send a mail via nullmailer-inject -f myaccount@gmx.de.

I just tested my old GMX account successfully with cat testmail.mail | nullmailer-inject -h -f myaccount@gmx.de. You need to force an envelope with your real address with the -f myaccount@gmx.de option, otherwise it gets rejected. The -h option is just so only the information in the email file is used, no command line information for to: and other fields.

My format for the test mail was below. Taken from nullmailer troubleshooting, fill out the From:, To:, and Cc: fields, otherwise it won't work!

Subject: Nullmailer test at Do 21. Apr 13:56:57 CEST 2016
From: Yourfirst Yourlast  <yourself@yourdomain.com>
To: Yourfirst Yourlast  <yourself@yourdomain.com>
Cc: Friendfirst Friendlast <friend@friendsdomain.com>

Sent at Do 21. Apr 13:56:57 CEST 2016

Yourfirst Yourlast was here
and now is gone
but left his name
to carry on.

This is a second paragraph thats kinda long, really really long, so long that I truly hope that it does the right thing and wraps.

Yourfirst Yourlast

My /etc/nullmailer/remotes file looks like this:

mail.gmx.net smtp --port=587 --starttls --auth-login --user=myaccount@gmx.de --pass=password

If you want to use mail like you did, make sure that the -f myaccount@gmx.de option is used. How to do this depends on your MUA (mail user agent) which is behind the mail alias.

Lastly, I want to point out that nullmailer has an inherent security flaw. Even though the /etc/nullmailer/remotes file is only readable by root and the user mail, it calls the smtp program with the content of this file as options, so every user on the system can see your credentials while smtp runs via ps aux or htop. Maybe this is fixed in 2.0, but even 16.04 has only a 1.x version, and no ppa is offering a newer one.

A nice alternative to nullmailer is dma, the dragonfly mail transfer agent. I could set it up to use my GMX credentials in less than one minute. If you use the MASQUERADE=myaccount@gmx.de option in the settings file, you don't even need to fool around to pass options with mail.

Put just the following into /etc/dma/dma.conf, your credentials into /etc/dma/auth.conf, and you are done:

SMARTHOST smtp.gmx.net
PORT 587
AUTHPATH /etc/dma/auth.conf
MASQUERADE myaccount@gmx.de

No further configuration or adaptation needed, easy, and secure.

  • Thanks! However TLS / port 587 seems not to work .. I get another error. I added it to the question. – Alex Apr 21 '16 at 6:17
  • Same for SSL / port 465 :( – Alex Apr 21 '16 at 6:39
  • 1
    You are getting closer, it's like peeling an onion. Can you login to the WebGUI with this username + password combination? Are there special characters in the password? Try `--pass="SomeSecret" if you can login to the WebGUI with no issues. – emk2203 Apr 21 '16 at 7:11
  • Wow, thanks for all the research you did. Yes I as well got dma to work in less than 5min. Much better than nullmailer. Thanks alot for the excellent tip ! – Alex Apr 21 '16 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.