If I try to send an email as follows, the process hangs and nothing happens:
>>> from django.core.management import setup_environ
>>> from cube import settings
>>> setup_environ(settings)
'cube'
>>> from django.core.mail import send_mail
>>> send_mail('Subject', 'Message', '[email protected]', ['[email protected]'], fail_silently=False)
However, doing telnet to port 25 works just fine
$ telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet>
and here's this just in case
$ netstat -a | grep :smtp
tcp 0 0 *:smtp *:* LISTEN
tcp 0 0 localhost:smtp localhost:44932 ESTABLISHED
tcp 0 0 localhost:44932 localhost:smtp ESTABLISHED
tcp 0 0 localhost:smtp localhost:60964 ESTABLISHED
tcp 0 0 localhost:60964 localhost:smtp ESTABLISHED
tcp 0 0 localhost:37247 localhost:smtp FIN_WAIT2
tcp 1 0 localhost:smtp localhost:37247 CLOSE_WAIT
tcp 9 0 localhost:smtp localhost:37245 CLOSE_WAIT
I run Ubuntu 10.04 and Python 2.6.5
I don't know where to look next to figure out what's wrong. Please help me. Thank you.
Your mail server isn't working fine. When you connect to it using telnet, you should see a welcome message along the lines of:
220 your.server.name ESMTP Postfix
(You can check the greeting that you should be seeing by running postconf smtpd_banner.)
You don't get that, so the mail server isn't running properly. send_mail is probably hanging waiting for that initial message.
Restart Postfix, and look in the /var/log/mail.* log files; there may be a clue in there as to why it's not working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With