I don't receive emails in the last 2 days

Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz, 4 cores
OS type and version Ubuntu Linux 20.04.4
Virtualmin version 7.0-4

Guys, I started having problems with emails on my server, I don’t remember making any changes. Everything was working until the 8th, now, I don’t receive any more e-mails, but I send them with ease. I accessed the mail log and discovered SEVERAL records like this (some data I will censor for privacy)

May 11 09:45:55 NAMEOFMYMACHINE postfix/smtpd[314319]: NOQUEUE: reject: RCPT from s4.fe.registro.br[200.160.2.29]: 451 4.3.5 <address@ofmydomain.com.br>: Recipient address rejected: Server configuration problem; from=<nicmailer@registro.br> to=<address@ofmydomain.com.br> proto=ESMTP helo=<s4.fe.registro.br>
May 11 09:45:55 NAMEOFMYMACHINE postfix/smtpd[314319]: disconnect from s4.fe.registro.br[200.160.2.29] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=6/8
May 11 09:45:56 NAMEOFMYMACHINE postfix/smtpd[312237]: disconnect from unknown[IP ADDRESS] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4

address@ofmydomain.com.br it’s just a censored email not to reveal the real content.

This has been happening with all my accounts (servers) hosted on my machine. I’m very layman, so if you have a solution, try to be as clear as I don’t have all the technical knowledge, but I’m trying to learn. Thank you very much.

Hello,

Does Postfix accepts connections on port 25? Presumably it does, based on logs but anyway, what is the output of the following commad:

netstat -tnlp | grep 25

Does restarting Postfix service by running systemctl restart postfix fixes the problem? Also, what is the output of systemctl status postfix command ran right after restart?

It is hard to tell off-hand what is wrong exactly, without looking into master.cf and main.cf files.

Do you remember if you made any mail-related changes on Virtualmin side?

Hi Ilia,

  • Output of the following command:
root@mymachine:~# netstat -tnlp | grep 25
tcp        0      0 127.0.0.1:11000         0.0.0.0:*               LISTEN      1025/lookup-domain-
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1333/master
tcp6       0      0 :::25                   :::*                    LISTEN      1333/master

Postfix restart: dont fix the problem.

Output of status postfix:


root@MYMACHINE:~# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
     Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor prese>
     Active: active (exited) since Thu 2022-05-12 07:10:48 CDT; 1min 25s ago
    Process: 100170 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 100170 (code=exited, status=0/SUCCESS)

May 12 07:10:48 myaddress.contaboserver.net systemd[1]: Starting Postfix Mail T>
May 12 07:10:48 myaddress.contaboserver.net systemd[1]: Finished Postfix Mail T>
lines 1-8/8 (END)

I remember just do try greylisting and blacklisting some domains, but i already deleted that records. I know they may not even be related to the problem, but in the concern of reversing I already undid everything I had tried to do.

Where i can find the master.cf and main.cf? I can post it here or its better send you via PM?

Please don’t.

Ok. Still waiting, hope that we can fix this :frowning:

You can find it by running:

find /etc/ -name master.cf

Or easy also

Mlocate.

Hi Ilia, master.cf:

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (no)    (never) (100)
# ==========================================================================
smtp	inet	n	-	y	-	-	smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may
#smtp      inet  n       -       y       -       1       postscreen
#smtpd     pass  -       -       y       -       -       smtpd
#dnsblog   unix  -       -       y       -       0       dnsblog
#tlsproxy  unix  -       -       y       -       0       tlsproxy
#submission inet n       -       y       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_tls_auth_only=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       y       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       y       -       -       qmqpd
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
        -o syslog_name=postfix/$service_name
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       1       scache
postlog   unix-dgram n  -       n       -       1       postlogd
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix	-	n	n	-	2	pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

submission	inet	n	-	y	-	-	smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may
smtps	inet	n	-	y	-	-	smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_security_level=may -o smtpd_tls_wrappermode=yes

Main.cf:

# 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

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2



# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level = may

smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = MYADDRESS.contaboserver.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, _HOSTNAME_, MYADDRESS.contaboserver.net, localhost.contaboserver.net, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination check_policy_service inet:127.0.0.1:10023
allow_percent_hack = no
tls_server_sni_maps = hash:/etc/postfix/sni_map

And yeah, i changed the ip address to MYADDRESS.

Thanks for the help anyway.

Hello,

May be some internet issue from your side or may be new mails are coming in spam folder. I suggest you to check all of your folders.

Regards: Çeşme Escort

No, its not buddy.

It looks that check_policy_service inet:127.0.0.1:port wasn’t cleared correctly.

You can edit main.cf manually and fix smtpd_recipient_restrictions line, removing check_policy_service option:

smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination

… and reloading Postfix configuration afterwards.

A good question – how did this happen? Can you describe what exactly did you do with Greylisting feature?

Wow, it really works.

Thank you Ilia.

How did this happen? I really dont know. Im am a newbie user so i didnt even get closer of this codes, as you know early, i even found the main.cf without your guys help.

I was trying to block a domain from send us e-mail, so i start to look at SpamAssassin, i dont know if was ClamAV or something else that make sense to you. I remember that i tryed to enable On ClamAV Server at Spam and Virus Scanning section and i remember that the pages refreshes and the button stays the same thing, like it wasnt enable yet. So i just give up and i keep traveling around the panel for see solutions to block a domain to send for a specific user. Then i found greylisting and i was trying to block that domain. And that was it.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.