I want to test sending out emails. My app used to worked perfectly well in sending notification emails, but for some reason Ubuntu stopped sending emails.
in the settings I have:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = 'Domain <noreplay@example.com>'
But now it just result in this in postfix mail.log:
Sep 25 15:51:12 mypc postfix/qmgr[15230]: 45353742FF3: from=<ma@mine.com>, size=368, nrcpt=1 (queue active)
Sep 25 15:51:16 mypc postfix/smtp[16989]: connect to alt4.gmail-smtp-in.l.google.com[1.2.3.4]:25: Connection timed out
Sep 25 15:51:16 mypc postfix/smtp[16989]: 4224474301B: to=<somerecepient123@gmail.com>, relay=none, delay=150, delays=0/0/150/0, dsn=4.4.1, status=deferred (connect
to alt4.gmail-smtp-in.l.google.com[1.2.3.4]:25: Connection timed out)
Sep 25 15:51:31 mypc postfix/smtp[17491]: connect to gmail-smtp-in.l.google.com[4.5.6.7]:25: Connection timed out
Sep 25 15:51:42 mypc postfix/smtp[17512]: connect to gmail-smtp-in.l.google.com[4.5.6.7]:25: Connection timed out
This is while postfix seems to work:
$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mypc.localdomain ESMTP Postfix (Ubuntu)
And can even telnet to gmail:
$ telnet smtp.gmail.com 587
Trying 2a00:1450:400c:c09::6d...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP h7sm3532809wjz.7 - gsmtp
I have reinstalled postfix and copied original main.cf. no chance! I also tried to send emails using a gmail account:
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'someuser@gmail.com'
EMAIL_HOST_PASSWORD = 'somesupersecret'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = 'domain <noreplay@example.com>'
But I get similar timeout error in the mail.log
It is really frustrating because the app used to send emails to gmail before. After hours of struggling I'm left clueless. So really appreciate your hints.