Hello, I have trouble with SMTP.
in the smtp log:
namshi gmail-smtp-in.l.google.com ... Cannot assign requested address
Why could this be?
1. I read the discussion here:
here
The local project is set up with a protonmail address
I have not configured SSL certificates for the domain.
I used the command line
tutor config save --set EMAIL_HOST_USER=
etc. to configure and it did save these settings in .local/share/tutor/config.yml
:
CONTACT_EMAIL: ptm_user@protonmail.com
EMAIL_HOST: smtp.gmail.com
EMAIL_HOST_PASSWORD: secret
EMAIL_HOST_USER: gmail_user
EMAIL_PORT: 587
EMAIL_USE_TLS: true
~/.local/share/tutor/env/apps/openedx/config$ nano lms.env.json
"EMAIL_HOST": "smtp",
"EMAIL_PORT": 25,
"EMAIL_USE_TLS": false,
"EMAIL_HOST_USER": "",
"EMAIL_HOST_PASSWORD": ""
My guess is that setting “allow less secure apps” in gmail is sufficient and that either SSL certificates are required on the client or there is a protonmail/gmail conflict. Who knows? How to further analyse?
2. I read
this and it is true that I also cannot traceroute via port 25. I am also running tutor on EC2.
sudo traceroute -n -T -p 25 gmail-smtp-in.l.google.com
shows only ***
sudo traceroute -n -T -p 80 gmail-smtp-in.l.google.com
does seem to resolve:
sudo traceroute -n -T -p 80 gmail-smtp-in.l.google.com
traceroute to gmail-smtp-in.l.google.com (74.125.24.26), 30 hops max, 60 byte packets
1 * * *
2 * * *
3 * * *
4 * * *
5 * * *
6 100.65.10.161 0.395 ms 100.65.8.161 0.389 ms 100.65.10.129 0.285 ms
7 52.95.38.155 1.795 ms 52.95.38.18 1.024 ms 52.95.38.155 1.075 ms
8 52.95.36.62 1.792 ms 52.95.36.142 1.910 ms 52.95.36.94 1.984 ms
9 54.240.203.232 1.701 ms 54.240.203.222 1.681 ms 54.240.203.232 1.890 ms
10 99.82.183.99 1.164 ms 1.192 ms 1.157 ms
11 72.14.236.69 1.162 ms 108.170.247.33 2.616 ms 2.614 ms
12 108.170.247.90 1.295 ms 1.289 ms 108.170.247.34 1.668 ms
13 172.253.79.100 93.441 ms 142.250.63.0 93.432 ms 172.253.79.104 93.414 ms
14 209.85.245.232 93.416 ms 108.170.230.73 104.172 ms 209.85.243.180 93.164 ms
15 172.253.68.247 93.375 ms 66.249.94.59 92.745 ms 172.253.68.251 94.307 ms
16 * * *
3. I also have about 100 times:
[django.security.DisallowedHost] [user None] exception.py:77 - Invalid HTTP_HOST header: xx.AWS-IP.xx.xx:80'. You may need to add 'xx.AWS-IP.xx.xx' to ALLOWED_HOSTS.
and the same for 0.0.0.0
and the same for You may need to add ‘smtp.243.38.a6gvhbavpxxcxau.com’ to ALLOWED_HOSTS.
smtp.243.38.a6gvhbavpxxcxau.com leads to match-room.jp (I’m in Japan but I don’t know what this is).
Later in the log, ^[[34;1mnginx_1 |^[[0m 209.17.96.82 - - [25/Jul/2020:16:54:22 +0000] http://smtp.243.38.a6gvhbavpxxcxau.com "GET / HTTP/1.1" 400 37 "-" "Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)" "-"
Note that 209.17.96.82 is Cogent, which I don’t recognize and
I have no limits on the outgoing traffic from the EC2 instance. This may be from the CMS container, but how can I change ALLOWED_HOSTS from the tutor command line?
4. I see that
^[[32msmtp_1 |^[[0m 674 Connecting to gmail-smtp-in.l.google.com [2404:6800:4003:c04::1b]:25 ... failed: Cannot assign requested address ^[[32msmtp_1 |^[[0m 674 LOG: MAIN ^[[32msmtp_1 |^[[0m 674 H=gmail-smtp-in.l.google.com [2404:xx:xx:xx::xx] Cannot assign requested address ^[[32msmtp_1 |^[[0m 674 Connecting to gmail-smtp-in.l.google.com [xx.xx.xx.xx]:25 ... failed: Connection timed out (timeout=5m)
here it seems that port 25 is used. This seems correct, that the gmail server can be connected to over this port, but I don’t see 587 being used locally.