docker-mailserver: Cant send email on the server itself

Subject

I cant send emails on the server from one mailbox to another.

Description

Hello everybody 😃 I am trying to get this mailserver running but I am failing on some point and I dont really know where… I just set the server up with the documentation and I tried sending E-Mails to GMail, that didnt work for authentication reasons or sth like that… Now I created a second mail account on the server and try to send e-mails between both of them, but they dont appear in the others mailbox. I dont know why, does anybody know what might happen there? Because its all on one server it cant be a network problem like ports/dns records, aight?

mailserver    | Apr 19 12:03:51 mail amavis[1448]: (01448-01) Passed CLEAN {RelayedInbound}, [91.0.109.71]:52295 [91.0.109.71] <me@mail.domain.de> -> <test@mail.domain.de>, Queue-ID: 3E2B513BF21, Message-ID: <0226d13f-9cf3-a531-ac7e-2d2b732d713c@mail.domain.de>, mail_id: lhqkVefUn2F2, Hits: 2.175, size: 1236, queued_as: 1A60113BF2D, 1726 ms
mailserver    | Apr 19 12:03:51 mail postfix/smtp[1517]: 3E2B513BF21: to=<test@mail.domain.de>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.9, delays=0.14/0.02/0.01/1.7, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1A60113BF2D)
mailserver    | Apr 19 12:03:51 mail postfix/qmgr[1431]: 3E2B513BF21: removed
mailserver    | Apr 19 12:03:51 mail postfix/local[1527]: 1A60113BF2D: to=<test@mail.domain.de>, relay=local, delay=0.03, delays=0.01/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "test")

Thats the log after sending the email, I hope its all the important part, if not please just ask.

When I go for ./setup.sh email list I get those 2 mailboxes I created

* me@mail.domain.de
* test@mail.domain.de

The sent emails appear in the sent folder of the mailbox but the other mailbox does not receive them.

Thanks for any help, have a good one!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

Hello everybody! I figured sth out… I had the mailserver running on mail.domain.de and so I created my mailboxes like ā€œme@mail.domain.deā€, but at that moment this domain (mail.domain.de) gets added as vhost and from that on I get this warning, like mentioned in the warning text. So I removed my data folder and started all from scratch, this time I added ā€œme@domain.deā€, so this domain got added as vhost and it works just fine! There seems to be a problem when adding mailboxes with the same domain/host the mailserver is running on, is that intentionate? Atm I can just receive mails from GMail and cannot send any to gmail, because of authentication reasons, even tho I setup spf and DKIM, but maybe it just need some time…

I guess I’m closing this because my problem is solved. If I can help you with some tests just inform me.

Hey guys, I did some more tests on that one…

Now I got 2 mailboxes added:

me@domain.de
test@mail.domain.de

My Mailserver is still running on host mail.domain.de.

The mailbox me@domain.de is working fine, I can send and receive emails without any problems. The mailbox test@mail.domain.de can send emails but cannot receive any. As soon as there is an email coming for that mailbox I’m getting the good old warning (warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains) and the email can not be delivered.

I didn’t send any emails, as I thought the warning came on DMS startup. But I don’t have time right now to test further.

Like mentioned above, on startup I had the same output like he got.

My output never changed on startup, it was always like:

Attaching to mailserver
mailserver    | [ TASKLOG ]  Welcome to docker-mailserver 10.5.0
mailserver    | [ TASKLOG ]  Initializing setup
mailserver    | [ TASKLOG ]  Checking configuration
mailserver    | [ TASKLOG ]  Configuring mail server
mailserver    | [ TASKLOG ]  Post-configuration checks
mailserver    | [ TASKLOG ]  Starting daemons & mail server
mailserver    | cron: started
mailserver    | rsyslog: started
mailserver    | dovecot: started
mailserver    | update-check: started
mailserver    | opendkim: started
mailserver    | opendmarc: started
mailserver    | postgrey: started
mailserver    | postfix: started
mailserver    | clamav: started
mailserver    | changedetector: started
mailserver    | amavis: started
mailserver    | [ TASKLOG ]  mail.domain.de is up and running
mailserver    | Apr 19 22:09:41 mail amavis[524]: starting. /usr/sbin/amavisd-new at mail.domain.de amavisd-new-2.11.1 (20181009), Unicode aware, LC_CTYPE="C.UTF-8"
mailserver    | Apr 19 22:09:41 mail amavis[524]: perl=5.032001, user=, EUID: 112 (112);  group=, EGID: 114 114 (114 114)
mailserver    | Apr 19 22:09:41 mail amavis[524]: Net::Server: Group Not Defined.  Defaulting to EGID '114 114'
mailserver    | Apr 19 22:09:41 mail amavis[524]: Net::Server: User Not Defined.  Defaulting to EUID '112'
mailserver    | Apr 19 22:09:41 mail amavis[524]: No ext program for   .zoo, tried: zoo
mailserver    | Apr 19 22:09:41 mail amavis[524]: No ext program for   .doc, tried: ripole
mailserver    | Apr 19 22:09:41 mail amavis[524]: No decoder for       .F
mailserver    | Apr 19 22:09:41 mail amavis[524]: No decoder for       .doc
mailserver    | Apr 19 22:09:41 mail amavis[524]: No decoder for       .zoo
mailserver    | Apr 19 22:09:41 mail amavis[524]: Using primary internal av scanner code for ClamAV-clamd
mailserver    | Apr 19 22:09:41 mail amavis[524]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
mailserver    | Apr 19 22:09:42 mail postfix/master[1428]: daemon started -- version 3.5.6, configuration /etc/postfix

I was just getting the warning message when sending/receiving emails, I dont know if @casperklein also tried that out. I just created 2 mailboxes (me@mail.domain.de and test@mail.domain.de), connected via IMAP with Thunderbird and then tried to send an email from me to test.

That resulted in the following:

mailserver    | Apr 19 22:15:19 mail postfix/submission/smtpd[2246]: connect from <numbers>.dip0.t-ipconnect.de[91.x.x.x]
mailserver    | Apr 19 22:15:19 mail postfix/submission/smtpd[2246]: Anonymous TLS connection established from <numbers>.dip0.t-ipconnect.de[91.x.x.x]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
mailserver    | Apr 19 22:15:19 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains
mailserver    | Apr 19 22:15:19 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains
mailserver    | Apr 19 22:15:19 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains
mailserver    | Apr 19 22:15:19 mail postfix/submission/smtpd[2246]: 6D4BF13BF2E: client=<numbers>.dip0.t-ipconnect.de[91.x.x.x], sasl_method=PLAIN, sasl_username=me@mail.domain.de
mailserver    | Apr 19 22:15:19 mail postfix/sender-cleanup/cleanup[2256]: 6D4BF13BF2E: message-id=<926cfaa7-bbd3-d706-94cb-b6eed10cbfc9@mail.domain.de>
mailserver    | Apr 19 22:15:19 mail postfix/sender-cleanup/cleanup[2256]: 6D4BF13BF2E: replace: header MIME-Version: 1.0 from <numbers>.dip0.t-ipconnect.de[91.x.x.x]; from=<me@mail.domain.de> to=<test@mail.domain.de> proto=ESMTP helo=<[192.168.178.133]>: Mime-Version: 1.0
mailserver    | Apr 19 22:15:19 mail opendkim[229]: 6D4BF13BF2E: DKIM-Signature field added (s=mail, d=mail.domain.de)
mailserver    | Apr 19 22:15:19 mail postfix/qmgr[1431]: 6D4BF13BF2E: from=<me@mail.domain.de>, size=371, nrcpt=1 (queue active)
mailserver    | Apr 19 22:15:19 mail postfix/submission/smtpd[2246]: disconnect from <numbers>.dip0.t-ipconnect.de[91.x.x.x] ehlo=2 starttls=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=8
mailserver    | Apr 19 22:15:19 mail dovecot: imap-login: Login: user=<me@mail.domain.de>, method=PLAIN, rip=91.x.x.x, lip=172.x.x.x, mpid=2260, TLS, session=<h3IwiQfdBPFbAG1H>
mailserver    | Apr 19 22:15:20 mail dovecot: imap-login: Login: user=<me@mail.domain.de>, method=PLAIN, rip=91.x.x.x, lip=172.x.x.x, mpid=2263, TLS, session=<9943iQfdBfFbAG1H>
mailserver    | Apr 19 22:15:21 mail postfix/smtpd[2265]: connect from localhost[127.0.0.1]
mailserver    | Apr 19 22:15:21 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains
mailserver    | Apr 19 22:15:21 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains
mailserver    | Apr 19 22:15:21 mail postfix/smtpd[2265]: 161AD13BF2F: client=localhost[127.0.0.1]
mailserver    | Apr 19 22:15:21 mail postfix/cleanup[2266]: 161AD13BF2F: message-id=<926cfaa7-bbd3-d706-94cb-b6eed10cbfc9@mail.domain.de>
mailserver    | Apr 19 22:15:21 mail postfix/qmgr[1431]: 161AD13BF2F: from=<me@mail.domain.de>, size=1823, nrcpt=1 (queue active)
mailserver    | Apr 19 22:15:21 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains
mailserver    | Apr 19 22:15:21 mail amavis[1449]: (01449-01) Passed CLEAN {RelayedInbound}, [91.x.x.x]:61699 [91.x.x.x] <me@mail.domain.de> -> <test@mail.domain.de>, Queue-ID: 6D4BF13BF2E, Message-ID: <926cfaa7-bbd3-d706-94cb-b6eed10cbfc9@mail.domain.de>, mail_id: Tq4S6DD69O_n, Hits: 2.175, size: 1243, queued_as: 161AD13BF2F, 1482 ms
mailserver    | Apr 19 22:15:21 mail postfix/smtp[2257]: 6D4BF13BF2E: to=<test@mail.domain.de>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.7, delays=0.16/0.03/0.03/1.5, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 161AD13BF2F)
mailserver    | Apr 19 22:15:21 mail postfix/qmgr[1431]: 6D4BF13BF2E: removed
mailserver    | Apr 19 22:15:21 mail postfix/local[2267]: 161AD13BF2F: to=<test@mail.domain.de>, relay=local, delay=0.02, delays=0.01/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "test")
mailserver    | Apr 19 22:15:21 mail postfix/cleanup[2266]: 1A7F213BF2E: message-id=<20220419201521.1A7F213BF2E@mail.domain.de>
mailserver    | Apr 19 22:15:21 mail postfix/bounce[2268]: 161AD13BF2F: sender non-delivery notification: 1A7F213BF2E
mailserver    | Apr 19 22:15:21 mail postfix/qmgr[1431]: 1A7F213BF2E: from=<>, size=3797, nrcpt=1 (queue active)
mailserver    | Apr 19 22:15:21 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains
mailserver    | Apr 19 22:15:21 mail postfix/qmgr[1431]: 161AD13BF2F: removed
mailserver    | Apr 19 22:15:21 mail postfix/local[2267]: 1A7F213BF2E: to=<me@mail.domain.de>, relay=local, delay=0, delays=0/0/0/0, dsn=5.1.1, status=bounced (unknown user: "me")
mailserver    | Apr 19 22:15:21 mail postfix/qmgr[1431]: 1A7F213BF2E: removed

I was only getting this warnings, when receiving or sending (I dont really know which one of them) emails to/from the mailbox, on startup I didnt got that warning too.

warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains

And I use hostname: mail + domainname: domain.de at the moment, without an override inside the env. EDIT: I now tried hostname: mail.domain.de and its also working fine. (All with the me@domain.de mailbox)

Okay, thank you! Now I have sth to work on, I’ll text you again if I’m really stuck or get it to work.

I have no aliases or sth, I only added those 2 mailboxes and the DKIM keys with the setup.sh.

mailserver | Apr 19 22:15:19 mail postfix/trivial-rewrite[2255]: warning: do not list domain mail.domain.de in BOTH mydestination and virtual_mailbox_domains

This is not normal and likely your problem. That’s why I suggested to test with OVERRIDE_HOSTNAME. Do you have setup aliases or something?