Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email Account Structure Not Compatble with Office365 #14766

Open
imllc opened this issue Oct 11, 2016 · 9 comments
Open

Email Account Structure Not Compatble with Office365 #14766

imllc opened this issue Oct 11, 2016 · 9 comments
Labels

Comments

@imllc
Copy link

imllc commented Oct 11, 2016

After a month of testing we have determined several major issues with how the email accounts are structured for sending and receiving.
1 it is a limitation for anonymous accounts that you have to have a ERPNext password in the configuration for an anonymous relay account. the existence of the password cause authentication failure when office 365 connector requires no password.
2 the utilization of only one outbound account doesn't allow the flexibility of branding for uses like support and billing. incoming and outgoing mail could be cataloged based on sending and receiving account. This also causes authentication errors when ERPNext send as, regardless of giving send as rights in office365. this syntax incompatibility also cause failure.
3In addition verified sending accounts randomly fail to stay verified so imap pulls fail simply re-verify works but is unreliable for something like support desk.

Below are the transaction tests to verify the problems in addition this was confirmed by Microsoft.
https://discuss.erpnext.com/t/office-365-mail/15981?u=imllc
https://discuss.erpnext.com/t/email-is-a-problem/16571?u=imllc

@mnaphade
Copy link

mnaphade commented Jun 25, 2018

I struggled with the similar issue for a whole day. I guess there's an easy way to handle it.

Here's what I did.

  1. Erpnext installation script also installed postfix.
  2. Without modifying anything on postfix, I added the ERP server IP to a receive connector on O365 for allowing inbound emails to O365.
  3. The SMTP server in ERP has a setting set to localhost with port 25.
  4. Notification email address was modified to match my domain name.
  5. Configured Postfix to relay emails via O365 MX record of my subscription.
    Here is how the main.cf looks like.
smtpd_banner = Company Name ESMTP System
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = SERVERNAME
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, SERVERNAME, localhost.localdomain, , localhost
relayhost = [domainname-com.mail.protection.outlook.com]
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
compatibility_level = 2

I think if you configure postfix to configure relay emails to your MX record on O365, that should take care of most of the issues that you have been reporting.

Inbound emails can always be synced using IMAP. I am sure you have done that.

I still agree that the documentation needs to be clearer. Can work with the contributors to improvise it. Just don't know how and where to start.

@nostahl
Copy link

nostahl commented Aug 9, 2019

this issue is still open, is office 365 still an issue with ERPNext??

@parsimonyERP
Copy link

Our experiences with Office365 closely followed this discussion: (we were getting random equals "=" signs in emails that we sent out.) [https://discuss.erpnext.com/t/random-characters-added-to-emails/51675]

@nostahl
Copy link

nostahl commented Aug 15, 2019

We have not setup this postfix portion but just simply trying to use office 365 with ERPNext results in emails coming through with no body for us.

@kennethsequeira
Copy link
Contributor

@parsimonyERP I believe the "=" showing up was solved with this PR and other related fixes: #8912

@kkulloters
Copy link
Contributor

I'm still having an error in using outlook microsoft 365 for my outgoing email it gives me an error "Invalid email and password"

@knimer
Copy link

knimer commented Jun 16, 2021

Same issue here...

Now the error logs shows much less details...

frappe.email.queue.flush

Which is not descriptive at all.

before the error logs became in short form. I was getting "Invalid username or password".

Also, we created a ticket with Microsoft, and all checks are done that all needed configurations are done.

We also tested on smtper.com and all messages got delivered so, no issues from Microsoft side. We really bugged them and reached that the setup they have is proper.

So, this is a 5 years old bug/issue. Why not prioritized? How can increase the priority?

@ankush ankush transferred this issue from frappe/erpnext Oct 29, 2021
@mvniekerk
Copy link

Still an issue.

@anjalij62460
Copy link

anyone can help me to setup office 365 account setup in erpnext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants