2

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
[email protected]

/etc/nullmailer/defaultdomain is empty

sudo less /etc/nullmailer/remotes
mail.gmx.net smtp --port=465 --starttls [email protected] --pass=someSecret

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

....
root: [email protected]

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 ?

Edit1:

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

Edit2:

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.

1 Answer 1

4

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 [email protected] or similar.

What works is if you send a mail via nullmailer-inject -f [email protected].

I just tested my old GMX account successfully with cat testmail.mail | nullmailer-inject -h -f [email protected]. You need to force an envelope with your real address with the -f [email protected] 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  <[email protected]>
To: Yourfirst Yourlast  <[email protected]>
Cc: Friendfirst Friendlast <[email protected]>

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.

Sincerely
Yourfirst Yourlast

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

mail.gmx.net smtp --port=587 --starttls --auth-login [email protected] --pass=password

If you want to use mail like you did, make sure that the -f [email protected] 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 [email protected] 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
SECURETRANSFER
STARTTLS
MASQUERADE [email protected]

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

5
  • Thanks! However TLS / port 587 seems not to work .. I get another error. I added it to the question.
    – Alex
    Commented Apr 21, 2016 at 6:17
  • Same for SSL / port 465 :(
    – Alex
    Commented Apr 21, 2016 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
    Commented Apr 21, 2016 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
    Commented Apr 21, 2016 at 19:14
  • Thanks, the 587 tip works also with swaks Commented Mar 26 at 4:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .