Postfix-Fehler mit mailman-web
Hello, I installed mailman with Docker already a while ago, now running v0.4.5 with: Mailman Core-Version 3.3.8 (Tom Sawyer) Mailman Core API-Version 3.1 Mailman Core Python-Version 3.10.9 Postorius Version 1.3.8
Already a while I get this type of error:
2023-08-26T08:21:59.517986+02:00 postfix/smtpd[2843414]: connect from unknown[192.168.176.6] 2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]; from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web> 2023-08-26T08:21:59.575145+02:00 postfix/smtpd[2843422]: connect from unknown[192.168.176.6] 2023-08-26T08:21:59.581227+02:00 postfix/smtpd[2843422]: NOQUEUE: reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]; from=<root@$mailman.mydomain.de> to=<root@localhost> proto=ESMTP helo=<mailman-web> 2023-08-26T08:21:59.581548+02:00 postfix/smtpd[2843422]: disconnect from unknown[192.168.176.6] ehlo=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=4/5
Where
- $admin@mydomain.de is set in MAILMAN_ADMIN_EMAIL (mm-web) and as site_owner in mailman-extra.cfg (mm-core) and as DEFAULT_FROM_EMAIL in settings_local.py (mm-web)
- $mailman.mydomain.de is set in SERVE_FROM_DOMAIN (mm-web)
For me it seems, that mm-web-container is trying to send mail, but don't know why and which ... I can't reproduce it. Does anybody have a clue on wehere I can have a look what happens ... and how to change it?
Thank you, Jens.
Jens Günther writes:
Already a while I get this type of error:
2023-08-26T08:21:59.517986+02:00 postfix/smtpd[2843414]: connect from unknown[192.168.176.6] 2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]; from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web>
and similar except for
from=<root@$mailman.mydomain.de> to=<root@localhost> proto=ESMTP [...] Where
- $admin@mydomain.de is set in MAILMAN_ADMIN_EMAIL (mm-web) and as site_owner in mailman-extra.cfg (mm-core) and as DEFAULT_FROM_EMAIL in settings_local.py (mm-web)
- $mailman.mydomain.de is set in SERVE_FROM_DOMAIN (mm-web)
The first one is probably a Django error. You can probably find a trace of it in the Mailman's mailman-web.log. The second one could be any number of things but I would guess for starters it's a cron report. That might show up in a cron.log or syslog or messages.
Sorry I can't be of more help.
Steve
Hey there, this already helped a lot! (I also think this is logged double, because of another configuration problem: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...)
Am 26.08.23 um 15:56 schrieb Stephen J. Turnbull:
Jens Günther writes:
Already a while I get this type of error:
2023-08-26T08:21:59.517986+02:00 postfix/smtpd[2843414]: connect from unknown[192.168.176.6] 2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]; from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web>
and similar except for
from=<root@$mailman.mydomain.de> to=<root@localhost> proto=ESMTP [...] Where
- $admin@mydomain.de is set in MAILMAN_ADMIN_EMAIL (mm-web) and as site_owner in mailman-extra.cfg (mm-core) and as DEFAULT_FROM_EMAIL in settings_local.py (mm-web)
- $mailman.mydomain.de is set in SERVE_FROM_DOMAIN (mm-web)
The first one is probably a Django error. You can probably find a trace of it in the Mailman's mailman-web.log. The second one could be any number of things but I would guess for starters it's a cron report. That might show up in a cron.log or syslog or messages.
With hte log I could reproduce it and it happens, when somebody tries to reset the password:
ERROR 2023-08-26 19:41:00,863 22 django.request Internal Server Error: /accounts/password/reset/ Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/usr/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3.10/site-packages/django/views/generic/base.py", line 84, in view return self.dispatch(request, *args, **kwargs) File "/usr/lib/python3.10/site-packages/django/utils/decorators.py", line 46, in _wrapper return bound_method(*args, **kwargs) File "/usr/lib/python3.10/site-packages/allauth/decorators.py", line 20, in wrap resp = function(request, *args, **kwargs) File "/usr/lib/python3.10/site-packages/django/views/generic/base.py", line 119, in dispatch return handler(request, *args, **kwargs) File "/usr/lib/python3.10/site-packages/allauth/account/views.py", line 105, in post response = self.form_valid(form) File "/usr/lib/python3.10/site-packages/allauth/account/views.py", line 700, in form_valid form.save(self.request) File "/usr/lib/python3.10/site-packages/allauth/account/forms.py", line 580, in save self._send_password_reset_mail(request, email, self.users, **kwargs) File "/usr/lib/python3.10/site-packages/allauth/account/forms.py", line 620, in _send_password_reset_mail get_adapter(request).send_mail( File "/usr/lib/python3.10/site-packages/allauth/account/adapter.py", line 140, in send_mail msg.send() File "/usr/lib/python3.10/site-packages/django/core/mail/message.py", line 298, in send return self.get_connection(fail_silently).send_messages([self]) File "/usr/lib/python3.10/site-packages/django/core/mail/backends/smtp.py", line 131, in send_messages sent = self._send(message) File "/usr/lib/python3.10/site-packages/django/core/mail/backends/smtp.py", line 149, in _send self.connection.sendmail( File "/usr/lib/python3.10/smtplib.py", line 901, in sendmail raise SMTPRecipientsRefused(senderrs) smtplib.SMTPRecipientsRefused: {'$Accountaddress': (450, b'4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]')}
- where $Accountaddress is the mail-address I registered with
-> it seems to me, that in this process the hostname for the web-container is missing and can't be found, right? I mean the hostname for the core-container must be there, since mail is accepted :-D
Thanks for looking into this.
Jens Günther writes:
2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]; from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web>
There are a bunch of $myxxxx variables in Postfix, I think $myhosts might be the right one. If you add the IP 192.168.176.6 to that variable, it will be whitelisted and this problem should go away. There may be better ways to handle this, but don't mess with hostnames. Find the "right" way to permit that IP should do the job.
I mean the hostname for the core-container must be there, since mail is accepted :-D
That's not the way this works. Postfix accepts the mail because it's arrives at the physical host, then looks up routing for the mailbox and discovers it should be delivered via LMTP to the core container's IP. No hostname needed.
Steve
On 8/28/23 13:51, Stephen J. Turnbull wrote:
Jens Günther writes:
2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]; from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web>
There are a bunch of $myxxxx variables in Postfix, I think $myhosts might be the right one.
It should be under $mynetworks as per documentation:
https://asynchronous.in/docker-mailman/#postfix
Also, official postfix docs says the same:
https://www.postfix.org/BASIC_CONFIGURATION_README.html
-- thanks, Abhilash Raj (maxking)
Thank you Abhilash,
probably it's hard to tell, but somehow the container started with a different IP now. Do you have any clew, how this can happen? The network part is as follows:
networks:
mailman:
ipv4_address: 172.22.0.4
-> but it has 192.168.176.6
Thank you in advance.
Am 28.08.23 um 14:11 schrieb Abhilash Raj:
On 8/28/23 13:51, Stephen J. Turnbull wrote:
Jens Günther writes:
> 2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: > reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host > rejected: cannot find your hostname, [192.168.176.6]; > from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web>
There are a bunch of $myxxxx variables in Postfix, I think $myhosts might be the right one.
It should be under $mynetworks as per documentation:
https://asynchronous.in/docker-mailman/#postfix
Also, official postfix docs says the same:
https://www.postfix.org/BASIC_CONFIGURATION_README.html
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to jens.guenther@posteo.de
On 8/28/23 18:15, Jens Günther wrote:
Thank you Abhilash,
probably it's hard to tell, but somehow the container started with a different IP now. Do you have any clew, how this can happen? The network part is as follows:
networks: mailman: ipv4_address: 172.22.0.4
-> but it has 192.168.176.6
Can you share the entire compose file? I am not sure without looking at the entire file why the IP wasn't assigned correctly.
Abhilash
-- thanks, Abhilash Raj (maxking)
Am 28.08.23 um 10:21 schrieb Stephen J. Turnbull:
Jens Günther writes:
2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host rejected: cannot find your hostname, [192.168.176.6]; from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web>
There are a bunch of $myxxxx variables in Postfix, I think $myhosts might be the right one. If you add the IP 192.168.176.6 to that variable, it will be whitelisted and this problem should go away. There may be better ways to handle this, but don't mess with hostnames. Find the "right" way to permit that IP should do the job.
Thank you, adding the IP/network under mynetworks, as Abhilash writes, the error is gone.
(this is so dumb, somehow docker started with a different IP and I have to figure out why ... and there is another Django-error -> shall I open a new thread? "OSError: [Errno 99] Address not available")
I mean the hostname for the core-container must be there, since mail is accepted :-D
That's not the way this works. Postfix accepts the mail because it's arrives at the physical host, then looks up routing for the mailbox and discovers it should be delivered via LMTP to the core container's IP. No hostname needed.
Ok, probably a misunderstanding. I was saying, that mails from core are relayed correctly to the outside world ... that's because the mailman-network was was relayed, but as I wrote, the web-container somehow got a different IP now.
Thanks again.
So rounding it up, we figured it out (thanks to Abhilash).
- After an update from docker-compose v1 to v2, the core-components of my setup suddenly started with a different IP-subnet (192.168.x.y instead of 172.16.0.0/12 ... probably because there were not enough left or so)
- The mailman-web-container always got an extra IP within core to talk to the outside world, so always had 2 IPs (1 fixed within mailman subnet, 1 drawn from the external network)
- This second IP was before within the 12 subnet and being approved in Postfix.
- Probably it was luck, that the correct one was chosen before :-D
The solution now was to set the variable SMTP_HOST to the gateway of the mailman subnet within mailman-web, and NOT to the domain of the host: SMTP_HOST=172.22.0.1 (DB, core and web are then 2,3 and 4)
I also set this within core-container so that IPs are fixed now.
Regards, Jens.
Am 28.08.23 um 14:42 schrieb Jens Günther:
Am 28.08.23 um 10:21 schrieb Stephen J. Turnbull:
Jens Günther writes:
> 2023-08-26T08:21:59.522238+02:00 postfix/smtpd[2843414]: NOQUEUE: > reject: RCPT from unknown[192.168.176.6]: 450 4.7.25 Client host > rejected: cannot find your hostname, [192.168.176.6]; > from=<$admin@mydomain.de> to=<$recipient> proto=ESMTP helo=<mailman-web>
There are a bunch of $myxxxx variables in Postfix, I think $myhosts might be the right one. If you add the IP 192.168.176.6 to that variable, it will be whitelisted and this problem should go away. There may be better ways to handle this, but don't mess with hostnames. Find the "right" way to permit that IP should do the job.
Thank you, adding the IP/network under mynetworks, as Abhilash writes, the error is gone.
(this is so dumb, somehow docker started with a different IP and I have to figure out why ... and there is another Django-error -> shall I open a new thread? "OSError: [Errno 99] Address not available")
participants (3)
-
Abhilash Raj
-
Jens Günther
-
Stephen J. Turnbull