Score:0

Why do I get this error in my postfix/dovecot set up: NOQUEUE: reject: RCPT from?

ca flag

Here is my main.cf:

myhostname = mail.mydomain.co.za
myorigin = mydomain.co.za
mydestination = mail.mydomain.co.za, mydomain.co.za, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/24 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

smtpd_tls_cert_file=/etc/letsencrypt/live/mail.mydomain.co.za/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.mydomain.co.za/privkey.pem
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level=may
smtpd_tls_protocols = !SSLv2, !SSLv3

local_recipient_maps = proxy:unix:passwd.byname $alias_maps

smtpd_relay_restrictions = permit_mynetworks, reject

smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination

maillog_file = /var/log/mail.log

and here is my master.cf:

smtp      inet  n       -       n       -       -       smtpd

submission     inet     n    -    y    -    -    smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_tls_wrappermode=no
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth

smtps     inet  n       -       y       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth

pickup    unix  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr

tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
        -o syslog_name=postfix/$service_name

showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache
postlog   unix-dgram n  -       n       -       1       postlogd


policyd-spf  unix  -       n       n       -       0       spawn
    user=policyd-spf argv=/usr/libexec/postfix/policyd-spf

Now I have tried it without "smtpd_recipient_restrictions" in main.cf,just in master.cf, but postfix gave an error. I tried it with "smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject" in both files and "smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination" still got the title error. I tried commenting "-o smtpd_recipient_restrictions" out in master.cf, but it doesn't help.

Please help, what can I do? I am new to this.

anx avatar
fr flag
anx
Your configuration shows relaying only allowed to either local submission, or authenticated submission via port 465 - if your mail is rejected, I'd assume what you are testing is simply not one of those permitted cases?
anx avatar
fr flag
anx
Quote the command you are using to test, and the entire log line stored by postfix, then it would be less ambiguous which service is rejecting what.
Clifton Zama avatar
ca flag
Could you elaborate.
Clifton Zama avatar
ca flag
So you are saying the issue is here: -o smtpd_relay_restrictions ?
vidarlo avatar
ar flag
Please tell us how you test, and the complete error message seen in the log file.
Clifton Zama avatar
ca flag
So what would I need to include, simply to have an email from the google server go through?
Clifton Zama avatar
ca flag
I am not using any command. I am simply sending the address emails from a gmail account.
Clifton Zama avatar
ca flag
Guys, after posting here with my real domain name, I've been flooded with attempts to connect to my postfix, as though somebody is using a robot to do so. Please be warned not to post your real domain on here if you are new like me. And to the guy doing it: Please stop.
Score:0
ca flag

Thanks for the clue on it being a relay problem. I changed smtpd_relay_restrictions = permit_mynetworks, reject to smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination and it now works.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.