Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I've set up postfix (Debian) and it works fine. I can recieve mail and I can send them, but I can only send them to local (and local virtual) adresses.

But when I try to send the mail for example to my Gmail account, I get this in syslog:

Jun 30 18:34:44 vps postfix/smtpd[9087]: NOQUEUE: reject: RCPT from vps[]: 554 5.7.1 <hrdina.pavel@gmail.com>: Relay access denied; from=<info@w-cms.cz> to=<hrdina.pavel@gmail.com> proto=ESMTP helo=<localhost.localdomain>

I've googled a lot but I did figure it out thought. I think that something is wrong with my* directives. Here are mine:

myhostname = mail.xxx.cz
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = xxx.cz, vps, localhost.localdomain, localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
share|improve this question
Isn't your hostname w-cms.cz? – ott-- Jun 30 '13 at 19:18
up vote 2 down vote accepted

You need to allow relaying for hosts you trust.

If vps has a static IP address, you might simply add it to mynetworks. Another popular option is to set up authentication between trusted hosts

See furthermore http://www.postfix.org/SMTPD_ACCESS_README.html

share|improve this answer

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.