Using an Office 365 distribution group to send emails to UserVoice

We recently migrated our email infrastructure for Fabrik to Office 365. For support and feedback we use UserVoice.

There are a few ways to forward emails to an external address in Exchange/Office 365.

The first, which was how we had it configured originally, is to create a standard mailbox and set a forwarding address. In Office 365 this is done via Outlook Web Access.

The downside of this approach (if you're not bothered about keeping a copy of your support emails) is that it will require a user license/seat.

The second option (which does not incur a license) is to use a distribution group. You'll need to set your UserVoice address up as an external mail contact so that they can be added to the group.

Unfortunately, after doing so you'll find that emails are not making it into UserVoice. After speaking with the guys at UserVoice/Mailgun it turns out that emails sent to distribution groups in Office 365 contain an empty return path. Mailgun subsequently treats such emails as system messages and doesn't forward them.

This can be fixed using the Powershell Cmdlets for Exchange. I've included the necessary commands below taken from this article.

Connect to Office 365 with PowerShell:

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

Check to see whether the return paths are enabled:

Get-DistributionGroup | fl *report*

Set the Return-Path to the sender of the message:

Set-DistributionGroup –ReportToOriginatorEnabled $TRUE

Finally run the following command again:

Get-DistributionGroup | fl *report*

And verify that the return Return-Path has been enabled:

ReportToManagerEnabled : False
ReportToOriginatorEnabled : True

Further reference.

You should now see your emails hitting UserVoice. Happy days!

Thanks for the guys at UserVoice and Mailgun for their help.

Ben Foster

About Me

I'm a software engineer and aspiring entrepreneur with 12+ years experience in the tech industry and have worked with startups and SMB’s in areas such as healthcare, recruitment and e-commerce (I even worked in enterprise, once). I founded my first startup Fabrik in 2011.

I now head up the engineering team at If you're interested in working in an exciting fin-tech company, drop me a message on Twitter.

Creative Commons Licence