3

i have a problem with my mail server (Postfix, Dovecot and MySQL). I can't recieve emails nor send emails with a script that trys to authentificate to a mail-server user account.

I use piwik wich is a script like Google Analytics. I want it to send me a weekly email. In the settings I set the following things:

SMTP server address: domain.tld
SMTP Port: 25
Authentication method for SMTP: Login
SMTP username: [email protected]
SMTP password: *******
SMTP encryption: TLS

Now I try to send the report and I get the following error:

An error occured while sending 'HTML Email Report - 6.2013-04-15.1.en.html' to [email protected]. Error was '5.5.2 : Helo command rejected: need fully-qualified hostname'

My email log says this:

Apr 16 04:22:06 s1 postfix/smtpd[2106]: connect from s1.domain.tld[xx.xxx.xxx.xxx]
Apr 16 04:22:06 s1 postfix/smtpd[2106]: setting up TLS connection from s1.domain.tld[xx.xxx.xxx.xxx]
Apr 16 04:22:06 s1 postfix/smtpd[2106]: Anonymous TLS connection established from s1.domain.tld[xx.xxx.xxx.xxx]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Apr 16 04:22:06 s1 postfix/smtpd[2106]: NOQUEUE: reject: RCPT from s1.domain.tld[xx.xxx.xxx.xxx]: 504 5.5.2 <localhost>: Helo command rejected: need fully-qualified hostname; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<localhost>
Apr 16 04:22:06 s1 postfix/smtpd[2106]: lost connection after RCPT from s1.domain.tld[37.221.195.121]
Apr 16 04:22:06 s1 postfix/smtpd[2106]: disconnect from s1.domain.tld[xx.xxx.xxx.xxx]

Also I can't receive any E-Mails except from big services like iCloud, GMail, Hotmail ect.

If I log in via a mail client like Thunderbird, Mail App or Sparrow everything works fine and the logs also say that there is no error.

in my main.cf file I use the following:

smtpd_tls_auth_only = yes

At the moment I have no idea why I have these problems. I hope someone can help me!

2
  • It seems that piwik is not authenticating. you should see a message like: postfix/smtpd[16156]: .....: client=<client-hostname> ... sasl_method=PLAIN, [email protected] Please post postconf -n in your question so that we see the relevant configuration. Also which postfix version are you using. Commented Apr 16, 2013 at 8:49
  • I didn't know how to write the entire code into a comment. Here is my output that I get: click me Commented Apr 16, 2013 at 12:03

1 Answer 1

7

It seems that you restrict EHLO for your authenticated users. Change:

smtpd_helo_restrictions = permit_mynetworks,
    reject_non_fqdn_hostname,
    reject_invalid_hostname,
    permit

to:

smtpd_helo_restrictions = permit_mynetworks,
    permit_sasl_authenticated,
    reject_non_fqdn_hostname,
    reject_invalid_hostname,
    permit
2
  • 1
    Your reaponse solved my problem. I added it and it finally worked without any problems. Thank you very much for that! Commented Apr 17, 2013 at 22:51
  • 1
    This is good. I had HELO restrictions setup this way also, as per the Centos wiki. Adding permit_sasl_authenticated is the solution.
    – Jimbo
    Commented Jun 19, 2020 at 16:46

You must log in to answer this question.

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