Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
Jul 15 20:33:32 ubuntu-server postfix/smtpd[2294]: connect from[]
Jul 15 20:33:32 ubuntu-server postfix/smtpd[2294]: NOQUEUE: reject_warning: RCPT from[]: 504 5.5.2 <MitjaBNotebok>: Helo command rejected: need fully-qualified hostname; from=<> to=<> proto=ESMTP helo=<MitjaBNotebok>
Jul 15 20:33:32 ubuntu-server postfix/smtpd[2294]: NOQUEUE: reject: RCPT from[]: 554 5.7.1 <>: Relay access denied; from=<> to=<> proto=ESMTP helo=<MitjaBNotebok>
Jul 15 20:33:35 ubuntu-server postfix/smtpd[2294]: disconnect from[]

my /etc/hosts       localhost        ubuntu-server

why i always get this error when sending mail from client?

share|improve this question
up vote 2 down vote accepted

This error is because your client doesn't have a fully qualified hostname. If you look at the error message, it says that your server (ubuntu-server) has got a connection from MitjaBNotebok (presumably your laptop). When the laptop connected, it said "HELO MitjaBNotebok". MitjaBNotebok isn't a fully qualified hostname, and your mailserver is set to reject clients that don't have a correct hostname.

This is usually an anti-spam feature, and if your mailserver is primarily used to receive mail from the rest of the world it will cut down on spam - but it will also cut down on regular mail, especially when you use it as your outgoing mailserver.

To make your mailserver accept mails from clients like your laptop, you need to look at the parameter

smtp_helo_restrictions = reject_non_fqdn_helo_hostname

Usually if you want to cut down a little on spam, but still allow clients that don't have a full hostname configured, it'll be enough to set it as

 smtp_helo_restrictions = reject_invalid_helo_hostname

That means that all clients will need to use the correct syntax, but you'll still accept mail even if they don't have a complete host name.

In all cases, you will want to have

smtp_helo_required = yes

or none of the rules about helo will be enforceable.

share|improve this answer
thank you. I think you solve my problem :) Thank you again – senzacionale Jul 16 '12 at 5:37
You're welcome! – Jenny D Jul 16 '12 at 7:06

It looks like you're trying to log in to your own mail server to send outgoing mail.

To do this securely and properly, you need to set up SMTP authentication for Postfix. This is a non-trivial task, but the Postfix docs should get you started.

Once set up properly, you will connect to your mail server on port 587 (instead of 25), authenticate to it with your username and password, and your mail will go through.

The benefit of this is that when you have SMTP authentication set up, authenticated users do not have to deal with the usual restrictions of having an IP address with a reverse DNS entry or a fully qualified hostname or the other restrictions that mail servers impose for security reasons.

share|improve this answer
Thank you Michael Hampton. My mail server already works with SSL/TLS. I was using this howto:… Why to use 587 instead of 25? – senzacionale Jul 16 '12 at 5:15
Port 587 is the preferred port for submitting mail originating with your domain (see RFC 2476). Among other things, it neatly solves the problem of port 25 being blocked, as well as allowing authenticated senders to be identified and trusted as such. – Michael Hampton Jul 16 '12 at 5:38
I agree - it's always better to separate outgoing mail from incoming mail, and using 587 for submission is best current pracitce. – Jenny D Jul 16 '12 at 12:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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