ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

SMTP AUTH extension not supported by server

bug
email

#1

Checked multiple discussions here but couldn’t find any that would fix the issue in my environment.

Tried using corporate SMTP settings for authenticated connection and anonymous, even installed STMP server (postfix) on erpmext machine and made appropriate changes in Email Domain settings. No improvement, getting same error:

SMTP AUTH extension not supported by server.
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 420, in send_one
    smtpserver.sess.sendmail(email.sender, recipient.recipient, encode(message))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py", line 195, in sess
    (self.password or "").encode('utf-8'))
  File "/usr/lib/python2.7/smtplib.py", line 585, in login
    raise SMTPException("SMTP AUTH extension not supported by server.")
SMTPException: SMTP AUTH extension not supported by server.

ENV:
OS: Debian GNU/Linux 8.10 (jessie)
Inst. instruction: sudo python install.py --production
ERPNext: v10.0.6 (master)
Frappe Framework: v10.0.7 (master)


Email account setup error
#2

Restarting OS apparently helped at least with SMTP server installed on same OS. Will report if last restart helped solving other scenarios.

EDIT

Still getting error even with successful settings:

Title

frappe.email.queue.flush

Error

SMTP AUTH extension not supported by server.
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 420, in send_one
    smtpserver.sess.sendmail(email.sender, recipient.recipient, encode(message))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py", line 195, in sess
    (self.password or "").encode('utf-8'))
  File "/usr/lib/python2.7/smtplib.py", line 585, in login
    raise SMTPException("SMTP AUTH extension not supported by server.")
SMTPException: SMTP AUTH extension not supported by server.

EDIT:

Only localhost SMTP server works.
Reinstalled erpnext, will check if error keeps popping up.

EDIT

After erpnext reinstall no SMTP related errors were noticed, but only for localhost smtp server install.


#3

SMTP still caused problems even after installing Postfix on ernext localhost.
Some destination servers bounce emails from internal servers causing 550 error.
By configuring Postfix to send via relay server (the default SMTP server) finally solved all issues realting to SMTP.


#4

GitHub Issue submitted.

@clarkej, @Julian_Robbins, @Pawan


#5

Hi @aleksas,

could you please share the connection settings (SSL yes/no, port) here? SMTP seems to work fine with SSL on Submission (Port 587), but fail on the standard port…


#6

No, SSL is not used.

Reproduced error in a test python script:

import smtplib
from email.mime.text import MIMEText

msg = MIMEText("Hello world")

me = 'name@companydomain.com'
you = 'name@gmail.com'
server = 'internaldomain'

msg['Subject'] = 'The HW'
msg['From'] = me
msg['To'] = you

password = ''
login = ''

# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP(server.encode('utf-8'), None)
if login and password:
    s.login(login.encode('utf-8'), password.encode('utf-8'))

s.sendmail(me, [you], msg.as_string())
s.quit()

In case of login and password being empty s.login( is not executed and everything is fine. If condition if login and password: to be deleted s.login( causes:

Traceback (most recent call last):
  File "test_smtp.py", line 24, in <module>
    s = s.login(login.encode('utf-8'), password.encode('utf-8'))
  File "c:\Python27\lib\smtplib.py", line 586, in login
    raise SMTPException("SMTP AUTH extension not supported by server.")
smtplib.SMTPException: SMTP AUTH extension not supported by server.

So if I understand correctly, the issue in frappe is that it doesn’t allow empty auth fields unless it’s localhost for given environment.


#7

I had the same problem with each mail being bounced. the fix was actually easy if you know how

in ERPNext, go to /etc/postfix/main.cf

You should relayhost as @aleksas suggests.

In my case my relayhost line incorrectly had

relayhost = [mail.relaydomain.com]:587

removing the ‘:587’ and restarting postfix ie
sudo service postfix reload

was enough to allow proper relaying …