SMTP accounts overridden by default outgoing


In my recent ERPNext v12 instance, I have 2 email domains set up with one account on each domain.

One account is meant for bulk emails and notifications, so it’s configured accordingly as “Default Outgoing”. Let’s call this my notifications account. Incoming emails are disabled. This seems to work fine, notifications are sent as expected.

The other account is a mailbox for ERP related messages sent by a user with the expectation that he may get a reply. Let’s call this my IMAP account. It’s an entirely different server than the SMTP account. Both outgoing and incoming communication is accepted on this account.

In my user’s settings, both accounts are enabled so I can choose from which to send an email.

Unfortunately, this doesn’t work as expected. First of all, incoming emails from the IMAP account work fine, they arrive in the communications list. When I reply or create a new email from the communications document and choose the email address connected to the IMAP account, this also seemingly works fine, the email is in fact sent.

However, as it turned out, these emails are always sent from the notifications account, even if I specifically choose the IMAP account.

This can easily be verified from the communications document that is associated with the email. Under reference, it indeed confirms that the email was sent form the wrong account.

Since there really isn’t anything else I can configure, I believe this is a bug. Which surprises me, after all, ERPNext v12 has been in use for a while now and I couldn’t find any other references to this bug.

That’s why I thought I’ll put this up for discussion first. Can anyone else confirm this behavior? Or on the contrary, confirm it doesn’t exist for them?

I don’t think these are absolutely necessary, but here some screenshots to visualize what’s described above.

Email Domain 1 (with notifications as a primary purpose):

Email Domain 2 (for customer interaction):

Email account 1 called “Notifications” connected to Domain 1 - outgoing only

Email account 2 connected to Domain 2

Choice between account 1 and account 2 when creating a new email message

Account 1 being used for outgoing transmission even when Account 2 was selected

Some help on this would really be appreciated. For starters, just a confirmation would suffice.

For us, this problem is quite substantial as we are not able to use ERPNext for outside communication as long as we can’t solve it.

Sorry, I’m not able to reproduce this. It could be that the issue has been fixed in v13, or it could be that you’ve found some sort of glitch emerging from particular configurations. I don’t have a v12 system to test on.

There are a few settings with very confusing names related to outgoing email, referring to “always send with user email”, or something like that. Have you tried tweaking those?

Hi Peter,

Yes, I tried those settings, too. I actually work with a professional service company for ERPNext and they were also very surprised at this and couldn’t figure out a way to make ERPNext do what the configuration states. They believe this never came to light becasue most users use one email server for all communication. And even if they had multiple servers, depending on how these servers to the rewrite of the email address, outgoing emails would still arrive at their destination.

We, on the other hand, are using a special email server for transactional emails over SMTP. Using DKIM and DMARC we can make sure that these emails arrive at their destination. We could configure this server to accept outgoing emails for other addresses but we don’t want to do this. All our company email addresses are with Microsoft 365 and we would like for outgoing emails to remain in the sent folder of the respective mailbox it was sent from.

So, I’m trying to figure out if this is indeed a bug in ERPNext v12 or if it’s something special to our system.