Skip to Content
Menu
This question has been flagged
1 Reply
1331 Views

Odoo.sh v16 using Google OAuth outgoing email server.  I setup the server and connection according to the documentation here: https://www.odoo.com/documentation/16.0/applications/general/email_communication/google_oauth.html

Emails are getting sent, however, when other internal users in my odoo database send out an email from odoo, the FROM field of the email header is USERNAME, MYEMAIL@company.com .  The from field will contain that users name, but it will have my (the admin) actual email address.  Looking through the email logs in odoo, it appears that odoo is sending out the email correctly, with the users actual email address.  Google must be changing the actual email address as it goes through their server.  

After reading through google developer docs, it appears that I need to setup a service account with domain wide delegation in order for my admin OAuth to allow the email server to send out emails of other users.  Can anyone confirm if this is true, and if so, how to do this?  Here are links to some articles/documentation that I have reviewed.

https://stackoverflow.com/questions/57927771/change-from-address-while-sending-email-via-gmail-api

https://support.google.com/cloud/answer/6158849#zippy=%2Cservice-accounts%2Cweb-applications%2Cauthorized-domains%2Cuser-consent%2Cpublic-and-internal-applications

https://developers.google.com/workspace/guides/create-credentials

https://cloud.google.com/iam/docs/service-account-overview


Avatar
Discard

Hey Rick! I just migrated my database over to using Google OAuth and Gmail as our outgoing server and I am having this exact same problem.

Have you found a solution to this yet?

Author Best Answer

Chris,

No, I didn't solve this issue, however, I am using a workaround which displays a generic email address.  I setup a new user in my google workspace called "catchall".  I am using this user/email address for the authentication in Odoo to the gmail server.  This is also acting as my catchall address for odoo.  Now, when a user in my odoo database sends an email, their name does show up, along with the catchall email address.  For example, the email shows Rick Applegate " rel="ugc">catchall@precision......net>.  The catchall email address shows up in the from field and the reply-to field of the email.  If you need me to, I could review my odoo and gmail settings if you want to use the same workaround.  Good luck and let me know if you find a valid solution.

Avatar
Discard
Related Posts Replies Views Activity
1
May 17
5308
1
Oct 24
2879
4
Jun 24
31864
7
Sep 17
9082
3
Apr 17
10393