Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

outgoing mail server not working with smtp.office365.com

By
patrick cadonau
on 11/5/13, 4:03 PM 26,203 views

I cannot send outgoing emails with the microsoft office 365 email server. I configured an IMAP & SMTP Client with Thunderbird, working perfectly. I configured OpenErp with a Google account - works perfectly --> the only emailserver not working seems to be office 365, but as a standalone client using smtp (not native exchange protocol) I guess the issue is not at the Microsoft offering.

Please help, attached my log file error message I get when trying to send an email.

OpenERP Server 7.0-20131103-002534:DBprod:ERROR:openerp.addons.base.ir.ir_mail_server:Mail Versand schlug via SMTP Server 'smtp.office365.com' fehl.#012SMTPDataError: 550#0125.7.1 Client does not have permissions to send as this sender#012Traceback (most recent call last):#012 File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_mail_server.py", line 463, in send_email#012 smtp.sendmail(smtp_from, smtp_to_list, message.as_string())#012 File "/usr/lib/python2.7/smtplib.py", line 737, in sendmail#012 raise SMTPDataError(code, resp)#012SMTPDataError: (550, '5.7.1 Client does not have permissions to send as this sender')

OpenERP Server 7.0-20131103-002534:DBprod:ERROR:openerp.addons.mail.mail_mail:failed sending mail.mail 46#012Traceback (most recent call last):#012 File "/usr/lib/pymodules/python2.7/openerp/addons/mail/mail_mail.py", line 308, in send#012 mail_server_id=mail.mail_server_id.id, context=context)#012 File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_mail_server.py", line 476, in send_email#012 raise MailDeliveryException(_("Mail delivery failed"), msg)#012MailDeliveryException: (u'Mail Auslieferung fehlgeschlagen', u"Mail Versand schlug via SMTP Server 'smtp.office365.com' fehl.\nSMTPDataError: 550\n5.7.1 Client does not have permissions to send as this sender")

1
Manish
On 5/24/16, 6:58 AM

I would suggest you to recheck the Outgoing email server settings. Make sure the following:

  • Company email address and outgoing email server email address should be same.

  • The alias domain should be blank

  • priority should be less than the SMTP server - localhost, i.e. 10

1
patrick cadonau
On 11/5/13, 4:38 PM

ok - got a little bit closer. it works with a workaround - but unsure if this is the wanted design?

openerp sends the email under the emailadress which is registered in the user profile who logs into the system. (see /usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_mail_server.py, line 301:

    email_from = email_from or tools.config.get('email_from')
    assert email_from, "You must either provide a sender address explicitly or configure "\
                       "a global sender address in the server configuration or with the "\
                       "--email-from startup parameter."

how can I now configure multiple users in the outgoing mail server when the SMTP server needs authentication? Is there a workaround? It would be nice having the email-adress and password configuration dialog in the user preferences?

It has been working fine for me for about 4 months. I started having this problem 2 days ago. None of my settings in OpenERP have changed. Something must have changed at outlook.office365.

Matt Taylor
on 11/6/13, 10:31 AM

Okay, so i tried a different provider (godaddy). The error message was similar, but gave some insight: Sender Rejected - MAIL FROM must be a valid domain.\nadmin@xxx.xx.xxxx.xx. Turns out I only needed to change the alias domain from the default (ip address) to my email domain name, on the General Settings. Now smtp through office365 works again. Not sure why it worked before.

Matt Taylor
on 11/7/13, 12:44 AM
0
Eladio Abquina
On 11/5/16, 11:21 AM

As a workaround, I changed the Outgoing settings to just set-up SMTP Relay for Office365

hostname yourdomain-com.mail.protection.outlook.com  

port            25

security      None

Username  <blank>

Password    <blank>

Worked like a charm!

Make sure to set-up your connector as described here:

https://support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-email-using-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4

0
Jean-Claude Rieth
On 8/22/16, 2:35 PM

I did as Manish said, and it works.

Just beware that the blank alias domain: that's on the General settings page.

Thanks!

0
Michael van de Ven
On 10/26/15, 1:22 PM

Setup Office 365 SMTP outlook.office365.com 995 SSL/TLS fails -> Client does not have permissions to send as this sender

1. In Odoo setup a SMTP server using your mail exchange (MX) endpoint record with port 25 no security

2. In Office 365 configure a connector so Odoo can send email to Office 365. Office 365 can then relay email to your organization mailboxes and to external recipients. Office 365 > admin > exchange > mail flow > connectors: configure a connector for your Odoo ("email") server with the internet connecting IP address (CIP: [IP address] from the internetheader the email). In my testcase the IP address of the router connecting to the internet. 

0
Kris Krnacs
On 11/4/15, 4:43 PM

Hi!

So my fix is change code in /opt/odoo/odoo-server/openerp/addons/base/ir/ir_mail_server.py

You need to change "smtp_from" to "smtp_user" and also replace

after this:

If "mail.catchall.alias" is not set it defaults to "postmaster-odoo".

this:

default='postmaster',

#Because you have "postmaster", but you don't have "postmaster-odoo" on your own provider.

Hope it helps!

Kris

0
Frank Lee
On 9/25/15, 9:44 AM

I have same problem with office365, 

SMTPDataError:550

i have changed alias on General Settings into our own domain name 

Outgoing set up all ready test connection successfully

imcoming set up confirmed

still not able to send email and received email


SMTPDataError: 550

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/5/13, 4:03 PM
Seen: 26203 times
Last updated: 11/5/16, 11:21 AM