Use Confluence with MS Exchange and distribution addresses
Asked by Martin Boehme:

One of our customers uses Confluence and MS Exchange.

In Exchange they've got **personal** email addresses (like **monica.lewinsky** @example.com) and **distribution** mail addresses (like **it-staff**@example.com). An email that is sent to distribution addresses is being distributed to further (mostly personal) addresses (e.g. to all employees working in the IT department).

**Distribution** mail addresses are configured to **NOT accept** emails with an **anonymous** flag in the mail header (*X-MS-Exchange-Organization-AuthAs: anonymous*). This is because spam is often sent from anonymous senders to those addresses and could be spread very largely across the company.

The problem is: Emails sent by Confluence to a distribution address contain those anonymous flags -- although the server connection in Confluence is configured to use a user and a password. Therefore those emails are not delivered by MS Exchange.

**How do we get Confluence to not flag the mails as anonymous?**

(In case you wonder: Distribution mail addresses are used when sharing a page in Confluence and also by some apps. Actions that result in a mail to a certain Confluence group are being resolved **at user level**, so they are directly sent to the personal addresses and are therefore delivered, because personal addresses accept anonymous flags.)

Has somebody had the same problem and found a solution?


Answers:
author: James Richards
body: Hi Martin,

Interesting question. Confluence doesn't add the *X-MS-Exchange-Organization-AuthAs: anonymous* header, nor can I see a way that you can make it add the header (Jira has some options for this.)

What I'd suggest is you set up a simple email client with the Confluence SMTP username/password settings and send a test email and see if the header turns up. I'm thinking it's the Mail Server that is adding the header, so let's take Confluence out of the mix and see if it turns up.

The next test would be to change the SMTP server for Confluence to something else like Google Apps, and see if the header turns up. Obviously, don't try this on production but a test environment.

Regards, James

comments: author: M.Sauer
body: Hi James,

thanks a lot for your answer.

The adding of the header happens at MS-Exchange site as far as i know. We already test a simple emailclient with the confluence SMTP username/password. Then we get the suggested *X-MS-Exchange-Organization-AuthAs: internal Header, wich means we are correct authenticated against the Exchange Server.*

*Also if we use other software for sending notifications to our internal staff we get the correct Header.*

*If i use my username in test environment with my credentials it also send as X-MS-Exchange-Organization-AuthAs: anonymous.*

*So i have the opinion that Confluence possibly is not able to authenticate properly against the MS-Exchange. If you say that JIRA has another way of sending then i am able to check that inside our JIRA environment.*

*Do you know the difference between JIRA and Confluence in that case?*

*Thanks a lot*

*Michael*


author: James Richards
body: Hello Martin,

I can't say for 100%, but based on what I can see Jira also uses the same mechanism (that is library) for sending email.

Do you have Confluence configured for SMTP or JNDI email? Also, what version of Confluence are you running?

Ultimately, it looks like a configuration issue at the Exchange side of things. I found this KB from Microsoft which might help, or at least give an indication

* <https://support.microsoft.com/en-us/help/2663556/email-messages-that-are-sent-from-the-on-premises-environment-to-offic>

Regards, James