Postfix not sending email

Posted November 28, 2015 48.6k views


We have an Ubuntu 15.10 server running, we managed to get Postfix and Dovecot set up, however Postfix can not send any email to the outside world. We have checked around and tried a lot of different stuff, but still it is like that.
Thanks for the help.

Nov 27 15:46:00 packer-ubuntu-15-10-amd64 postfix/smtps/smtpd[16693]: NOQUEUE: reject: RCPT from[]: 554 5.7.1 <>: Recipient address rejected: Access denied; from=<> to=<> proto=ESMTP helo=<[]>

Any ideas?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers


Please output your main.cnf and your full log file. This is probably being caused because you haven’t got the proper setup for a relay (for example in smtpdrelayrestriction)

  • That’s the of Postfix:

    See /usr/share/postfix/ for a commented, more complete version

    Debian specific: Specifying a file name will cause the first

    line of that file to be used as the name. The Debian default

    is /etc/mailname.

    myorigin = /etc/mailname

    smtpdbanner = $myhostname ESMTP $mailname (Ubuntu)
    biff = no

    appending .domain is the MUA’s job.

    appenddotmydomain = no

    Uncomment the next line to generate “delayed mail” warnings

    delaywarningtime = 4h

    readme_directory = no

    TLS parameters

    smtpdtlscertfile = /etc/dovecot/dovecot.pem
    tlskeyfile = /etc/dovecot/private/dovecot.pem
    smtpdusetls = yes
    smtpdtlssessioncachedatabase = btree:${datadirectory}/smtpdscache
    smtptlssessioncachedatabase = btree:${datadirectory}/smtpscache

    See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for

    information on enabling SSL in the smtp client.

    smtpdrelayrestrictions = permitmynetworks permitsaslauthenticated deferun$
    myhostname =
    aliasmaps = hash:/etc/aliases
    database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination =, Slash-IT, localhost.localdomain, localhost
    relayhost =
    mynetworks = [::ffff:]/104 [::1]/128
    mailboxcommand = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m “${E$
    sizelimit = 0
    delimiter = +
    inetinterfaces = all
    protocols = all
    homemailbox = Maildir/
    saslauthenable = yes
    smtpdsasltype = dovecot
    smtpdsaslpath = private/dovecot-auth
    smtpdsaslauthenticatedheader = yes
    saslsecurityoptions = noanonymous
    smtpdsasllocaldomain = $myhostname
    saslauthclients = yes
    smtpdrecipientrestrictions = rejectunknownsenderdomain, rejectunknownrec$
    senderrestrictions = rejectunknownsenderdomain
    smtpusetls = yes
    smtpdtlsreceivedheader = yes
    tlsmandatoryprotocols = SSLv3, TLSv1
    smtpdtlsmandatoryciphers = medium
    tlsauthonly = yes
    tlsrandomsource = dev:/dev/urandom

    • @vasko

      The first thing I’d modify is smtpdrelayrestrictions so that it reads:

      smtpdrelayrestrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination

      Since the configuration posted above isn’t formatted with a code block, I can’t tell if you already have this set and it was simply cut off, or if you actually have un$ at the end of this line (I’m guessing you copy & pasted from the CLI, thus it cut this portion off?).

      For mydestination, you need to remove Slash-IT as this isn’t a domain or a hostname.

      Once that’s in place, reload Postfix and see if you’re still having issues. If so, please either post the entire configuration and place it in code blocks (you can do this by placing 3 backticks above the code and 3 backticks below it) or paste it to a PasteBin and post the link here.

      This helps keep formatting. To do this, you may need to download the actual configuration files as copying from the CLI is going to result in the same as you have above.

    • Zoals hieronder aangegeven smtpdrelayrestrictions even aanpassen en dan kijken.
      Als het nog niet lukt, kun je me ook op Skype toevoegen: cryptic-designs

Okay, I’ve hit the file and changed the smtpdrelayrestrictions, and deleted Slash-it from the my destinations part.

however, if I now try to send internal or external email through the Apple mail client. I get the following error. “cannot send email through” the error message reads “recipient address rejected: access denied”

  • little notice, I’m the other part of the Slash-IT team

  • @matthewwaanders

    Let’s take a look at smtpd_recipient_restrictions. The copy and paste above cut off a portion of what is set, though what I would do now is comment out smtpd_recipient_restrictions so that it looks like

    #smtpd_recipient_restrictions = ....

    and then add the following below it:

    smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

    and then restart Postfix.