Some e-mails bounced with unknown user but are forwarded

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.2
Webmin version 2.013
Virtualmin version 7.5
Related packages SUGGESTED

Hello folks,

I’m new to virtualmin (coming from plesk obsidian), but i have some troubles with getting my mailserver to work. I can’t receive any mails in my VM mailbox but they are forwarded to my gmail account and i can send mails to other domains without a problem. I had prepared a topic with list of information en logs i collected aground that problem. But, because i’m a new user here, i got the message that i only can post 2 links. So i hope that i can put this information on the next reply. This is the message from my undelivered mail i received in hotmail. ( for secutity reasons domains and my ip’s are changed )

This is the mail system at host mail.srv1.maindomain.be.

I’m sorry to have to inform you that your message could not
be delivered to one or more recipients. It’s attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

               The mail system

info-guestdomain.be@mail.srv1.maindomain.be (expanded from
info@guestdomain.be): unknown user: “info-guestdomain.be”

Thanks in advance.

Gunther

So my guess is that postfix works because it deliverce to the virtualmin emailaccount that was created when you create a virtual server but not to the second user/email i created? Anyone that can help me please?

I have a trusted level now so here is the info.

I installed a fresh ubuntu 22.04 on a VPS (Contabo) Changed the hostname to srv1.maindomain.be, and installed Virtualmin.
I let it create the first domain automatically (srv1.maindomain.be) and added a second domain (guestdomain.be) both with letsencrypt certificates.

Then i created a user in virtualmin in the second domain (info@guestdomain.be) with a forwarder to my gmail. (my_gmail@gmail.com)

Now when i try to send a mail from gmail or msn to info@guestdomain.be, the mail is getiing bounced with the message that the user is unknown but forwarding the mail to my gmail account succeeded.

When i send a mail from msn or gmail to the mailaddress that is automatically created when u create a virtual server on VM then the mail is received and forwarded without a problem.

What is going on here? What do i miss ?

Here some info
<------------------------------------------>
root@srv1:~# hostname
srv1.maindomain.be
<------------------------------------------>
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 srv1.maindomain.be srv1

The following lines are desirable for IPv6 capable hosts

::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
xx.xxx.xxx.161 srv1.maindomain.be srv1

<------------------------------------------>
changed my /etc/postfix/main.cf to this :

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 Postfix Backwards-Compatibility Safety Net – default to 3.6 on

fresh installs.

compatibility_level = 3.6

TLS parameters

smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem
smtpd_tls_security_level = may

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

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.srv1.maindomain.be
mydomain = srv1.maindomain.be
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, mail.srv1.maindomain.be
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
recipient_delimiter = +
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
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
smtp_dns_support_level = dnssec
smtp_host_lookup = dns
allow_percent_hack = no
resolve_dequoted_address = no
tls_server_sni_maps = hash:/etc/postfix/sni_map
smtpd_tls_CAfile = /etc/postfix/postfix.ca.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
milter_default_action = accept
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
mynetworks_style = subnet

<------------------------------------------>

When i send a mail from my msn mail to info@guestdomain.be the email get bounced with unknown user message but the mail is forwarded to my gmail account. syslog tells me this:

Mar 27 01:03:43 srv1 postfix/smtpd[24702]: connect from mail-am0eur02olkn2026.outbound.protection.outlook.com[40.92.49.26]
Mar 27 01:03:43 srv1 postfix/smtpd[24702]: 45B46121509: client=mail-am0eur02olkn2026.outbound.protection.outlook.com[40.92.49.26]
Mar 27 01:03:43 srv1 postfix/cleanup[24705]: 45B46121509: message-id=AS2PR02MB951187FADFB3A8610C25E322EA8A9@AS2PR02MB9511.eurprd02.prod.outlook.com
Mar 27 01:03:43 srv1 opendkim[697]: 45B46121509: DKIM verification successful
Mar 27 01:03:43 srv1 opendkim[697]: 45B46121509: s=selector1 d=msn.com a=rsa-sha256 SSL
Mar 27 01:03:43 srv1 postfix/qmgr[24124]: 45B46121509: from=highlive777@msn.com, size=7036, nrcpt=1 (queue active)
Mar 27 01:03:43 srv1 postfix/smtpd[24702]: disconnect from mail-am0eur02olkn2026.outbound.protection.outlook.com[40.92.49.26] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7
Mar 27 01:03:43 srv1 postfix/local[24245]: 45B46121509: to=info-guestdomain.be@mail.srv1.maindomain.be, orig_to=info@guestdomain.be, relay=local, delay=0.48, delays=0.41/0/0/0.07, dsn=5.1.1, status=bounced (unknown user: “info-guestdomain.be”)
Mar 27 01:03:43 srv1 postfix/cleanup[24705]: 9A868121617: message-id=AS2PR02MB951187FADFB3A8610C25E322EA8A9@AS2PR02MB9511.eurprd02.prod.outlook.com
Mar 27 01:03:43 srv1 postfix/qmgr[24124]: 9A868121617: from=highlive777@msn.com, size=7395, nrcpt=1 (queue active)
Mar 27 01:03:43 srv1 postfix/local[24245]: 45B46121509: to=info-guestdomain.be@mail.srv1.maindomain.be, orig_to=info@guestdomain.be, relay=local, delay=0.5, delays=0.41/0/0/0.08, dsn=2.0.0, status=sent (forwarded as 9A868121617)
Mar 27 01:03:43 srv1 postfix/cleanup[24705]: AF22C121619: message-id=20230326230343.AF22C121619@mail.srv1.maindomain.be
Mar 27 01:03:43 srv1 postfix/qmgr[24124]: AF22C121619: from=<>, size=9272, nrcpt=1 (queue active)
Mar 27 01:03:43 srv1 postfix/bounce[24707]: 45B46121509: sender non-delivery notification: AF22C121619
Mar 27 01:03:43 srv1 postfix/qmgr[24124]: 45B46121509: removed
Mar 27 01:03:43 srv1 postfix/smtp[24708]: warning: DNSSEC validation may be unavailable
Mar 27 01:03:43 srv1 postfix/smtp[24708]: warning: reason: dnssec_probe ‘ns:.’ received a response that is not DNSSEC validated
Mar 27 01:03:43 srv1 postfix/smtp[24709]: warning: DNSSEC validation may be unavailable
Mar 27 01:03:43 srv1 postfix/smtp[24709]: warning: reason: dnssec_probe ‘ns:.’ received a response that is not DNSSEC validated
Mar 27 01:03:44 srv1 postfix/smtp[24708]: 9A868121617: to=my_gmail@gmail.com, orig_to=info@guestdomain.be, relay=gmail-smtp-in.l.google.com[64.233.167.26]:25, delay=1.2, delays=0.08/0.14/0.66/0.36, dsn=2.0.0, status=sent (250 2.0.0 OK 1679871824 x8-20020adfffc8000000b002c71e1c9582si21509654wrs.264 - gsmtp)
Mar 27 01:03:44 srv1 postfix/qmgr[24124]: 9A868121617: removed
Mar 27 01:03:45 srv1 postfix/smtp[24709]: AF22C121619: to=highlive777@msn.com, relay=msn-com.olc.protection.outlook.com[104.47.22.161]:25, delay=1.6, delays=0.02/0.17/0.48/0.96, dsn=2.6.0, status=sent (250 2.6.0 20230326230343.AF22C121619@mail.srv1.maindomain.be [InternalId=14804752270510, Hostname=GV2PR02MB8675.eurprd02.prod.outlook.com] 17016 bytes in 0.241, 68.787 KB/sec Queued mail for delivery → 250 2.1.5)
Mar 27 01:03:45 srv1 postfix/qmgr[24124]: AF22C121619: removed

<------------------------------------------>

When i send a mail from my msn mail to the mail account that was automatically created when i created the virtual server in Virtualmin, the mail then is received and forwarded to my gmail forwarder.

Mar 27 01:12:40 srv1 postfix/smtpd[25491]: connect from mail-am6eur05olkn2105.outbound.protection.outlook.com[40.92.91.105]
Mar 27 01:12:41 srv1 postfix/smtpd[25491]: 2A622121609: client=mail-am6eur05olkn2105.outbound.protection.outlook.com[40.92.91.105]
Mar 27 01:12:41 srv1 postfix/cleanup[25493]: 2A622121609: message-id=AS2PR02MB951148F7F193A6C5EA63DF38EA8A9@AS2PR02MB9511.eurprd02.prod.outlook.com
Mar 27 01:12:41 srv1 opendkim[697]: 2A622121609: DKIM verification successful
Mar 27 01:12:41 srv1 opendkim[697]: 2A622121609: s=selector1 d=msn.com a=rsa-sha256 SSL
Mar 27 01:12:41 srv1 postfix/qmgr[24124]: 2A622121609: from=highlive777@msn.com, size=7085, nrcpt=1 (queue active)
Mar 27 01:12:41 srv1 postfix/smtpd[25491]: disconnect from mail-am6eur05olkn2105.outbound.protection.outlook.com[40.92.91.105] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7
Mar 27 01:13:46 srv1 postfix/smtpd[25491]: connect from unknown[95.214.27.143]
Mar 27 01:14:11 srv1 spamd[816]: spamd: connection from 127.0.0.1 [127.0.0.1]:36084 to port 783, fd 5
Mar 27 01:14:11 srv1 spamd[816]: spamd: setuid to guestdomain succeeded
Mar 27 01:14:11 srv1 spamd[816]: spamd: processing message AS2PR02MB951148F7F193A6C5EA63DF38EA8A9@AS2PR02MB9511.eurprd02.prod.outlook.com for guestdomain:1002
Mar 27 01:14:12 srv1 spamd[816]: spamd: clean message (-0.9/5.0) for guestdomain:1002 in 1.3 seconds, 7308 bytes.
Mar 27 01:14:12 srv1 spamd[816]: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS scantime=1.3,size=7308,user=guestdomain,uid=1002,required_score=5.0,rhost=127.0.0.1,raddr=127.0.0.1,rport=36084,mid=AS2PR02MB951148F7F193A6C5EA63DF38EA8A9@AS2PR02MB9511.eurprd02.prod.outlook.com,autolearn=ham autolearn_force=no
Mar 27 01:14:12 srv1 postfix/local[25495]: 2A622121609: to=guestdomain@mail.srv1.maindomain.be, orig_to=guestdomain@guestdomain.be, relay=local, delay=91, delays=0.53/0.03/0/91, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Mar 27 01:14:12 srv1 postfix/qmgr[24124]: 2A622121609: removed
<------------------------------------------>

cat /etc/postfix/virtual

srv1@srv1.maindomain.be srv1
srv1.maindomain.be srv1.maindomain.be
abuse@srv1.maindomain.be srv1@srv1.maindomain.be
hostmaster@srv1.maindomain.be srv1@srv1.maindomain.be
postmaster@srv1.maindomain.be srv1@srv1.maindomain.be
webmaster@srv1.maindomain.be srv1@srv1.maindomain.be
guestdomain@guestdomain.be guestdomain
guestdomain.be guestdomain.be
postmaster@guestdomain.be guestdomain@guestdomain.be
abuse@guestdomain.be guestdomain@guestdomain.be
webmaster@guestdomain.be guestdomain@guestdomain.be
hostmaster@guestdomain.be guestdomain@guestdomain.be
info@guestdomain.be info-guestdomain.be

<------------------------------------------>
Reverse IP lookup

Hostname: srv1.maindomain.be.

<------------------------------------------>

Anybody that could help me with this problem please ?

Well i’m a bit further with troubleshooting this. Strange things happening. So the problem with bouncing the mails happens as soon when i add a forwarder, then the mail is NOT delivered to my mailbox in VM but is forwarded to the forwarder mail account. and mailer daemon is returning a mail that the mail could not be delivered because the user is unknown.

When i remove the email forwarder in VM then everything is working again. The mail is delivered in the VM mailbox .

When i add a forwarder in mail forwarder settings ‘Deliver to this user normally’ and ‘Forward to another address’ are both checked.

So, why it doesn’t deliver the mail in VM mailbox when i add forwarder but mail is forwarded ?

This is a strange behavior, not ?

I noticed now that the same problem is also mentioned here Forward email does not work

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