vasko
By:
vasko

Postfix not sending email

November 28, 2015 14.2k views
Email Ubuntu

Hey,

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 524AC878.cm-4-3d.dynamic.ziggo.nl[82.74.200.120]: 554 5.7.1 <slash-vasko@mail.slash-it.eu>: Recipient address rejected: Access denied; from=<slash-matthew@mail.slash-it.eu> to=<slash-vasko@mail.slash-it.eu> proto=ESMTP helo=<[192.168.178.11]>

Any ideas?

2 Answers

Hello,

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 main.cf of Postfix:

    See /usr/share/postfix/main.cf.dist 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
    smtpd
    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 = mail.sash-it.eu
    aliasmaps = hash:/etc/aliases
    alias
    database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mail.slash-it.eu, Slash-IT, localhost.localdomain, localhost
    relayhost =
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mailboxcommand = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m "${E$
    mailbox
    sizelimit = 0
    recipient
    delimiter = +
    inetinterfaces = all
    inet
    protocols = all
    homemailbox = Maildir/
    smtpd
    saslauthenable = yes
    smtpdsasltype = dovecot
    smtpdsaslpath = private/dovecot-auth
    smtpdsaslauthenticatedheader = yes
    smtpd
    saslsecurityoptions = noanonymous
    smtpdsasllocaldomain = $myhostname
    broken
    saslauthclients = yes
    smtpdrecipientrestrictions = rejectunknownsenderdomain, rejectunknownrec$
    smtpd
    senderrestrictions = rejectunknownsenderdomain
    smtpusetls = yes
    smtpdtlsreceivedheader = yes
    smtpd
    tlsmandatoryprotocols = SSLv3, TLSv1
    smtpdtlsmandatoryciphers = medium
    smtpd
    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 main.cf 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 mail.slash-it.eu" 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.

Have another answer? Share your knowledge.