Jul 15 20:33:32 ubuntu-server postfix/smtpd[2294]: connect from cpe-90-157-232-208.static.amis.net[]
Jul 15 20:33:32 ubuntu-server postfix/smtpd[2294]: NOQUEUE: reject_warning: RCPT from cpe-90-157-232-208.static.amis.net[]: 504 5.5.2 <MitjaBNotebok>: Helo command rejected: need fully-qualified hostname; from=<webmaster@agadomarketing.com> to=<mitja_agad@gmail.com> proto=ESMTP helo=<MitjaBNotebok>
Jul 15 20:33:32 ubuntu-server postfix/smtpd[2294]: NOQUEUE: reject: RCPT from cpe-90-157-232-208.static.amis.net[]: 554 5.7.1 <mitja_agado@gmail.com>: Relay access denied; from=<webmaster@agadomarketing.com> to=<mitja.bombac@gmail.com> proto=ESMTP helo=<MitjaBNotebok>
Jul 15 20:33:35 ubuntu-server postfix/smtpd[2294]: disconnect from cpe-90-157-232-208.static.amis.net[]

my /etc/hosts       localhost       ubuntu-server.agadomarketing.com        ubuntu-server

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

2 Answers 2


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.

  • thank you. I think you solve my problem :) Thank you again Jul 16, 2012 at 5:37
  • You're welcome!
    – Jenny D
    Jul 16, 2012 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.

  • Thank you Michael Hampton. My mail server already works with SSL/TLS. I was using this howto: pixelinx.com/2010/10/… Why to use 587 instead of 25? Jul 16, 2012 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. Jul 16, 2012 at 5:38
  • 1
    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, 2012 at 12:18

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.