[Home]

Summary:ASTERISK-27199: Voicemail emails ignoring "serveremail" setting
Reporter:Allison Walters (teleute)Labels:
Date Opened:2017-08-15 12:47:59Date Closed:2017-08-31 08:21:51
Priority:MinorRegression?
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:13.16.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:FreePBX 13.0.192.9 bundled distroAttachments:( 0) voicemail.Yr1VXT
Description: (Note: this was originally reported as a bug to FreePBX - they verified that they're setting the config properly for the underlying asterisk system, and so suggested it be reported here instead.  I've included that bug report in the external issue ID field on this report.)

I have entered the email address I want to use for voicemail sending (voicemail@<ourdomain>) into the SMTP authentication settings (not sure exactly where this lies in the asterisk settings), and into the voicemail/email settings.  I've verified that this address is then put into the voicemail.conf file as the serveremail setting.  However, this fails, and in the maillog I can see that the email is sending from "asterisk@<ourdomain>", which of course doesn't match the authentication info I've put in, so O365 rejects it.  If I create asterisk@ in our O365, and use that info everywhere, it all works fine, but it seems to ignore the serveremail setting when I'm telling it to send from a different address.

I've tried both voicemail@<ourdomain> and just voicemail as the setting, and again can see that they're getting successfully written to the voicemail.conf file; they're just not getting used when the email is composed.
Comments:By: Asterisk Team (asteriskteam) 2017-08-15 12:48:00.086-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Sean Bright (seanbright) 2017-08-17 10:04:59.077-0500

You put IMAP in the component field. Is this only happening with the IMAP backend?

By: Sean Bright (seanbright) 2017-08-17 10:36:29.270-0500

I just tried this with the latest version of Asterisk 13 and this is the partial header of an e-mail that was generated:

{noformat}
Date: Thu, 17 Aug 2017 11:31:47 -0400
From: Asterisk PBX <voicemail@cawst.org>
To: "Example Mailbox" <root@localhost>
{noformat}

So this doesn't appear to be a bug in Asterisk. Sounds like this might be a FreePBX issue after all?


By: Allison Walters (teleute) 2017-08-17 13:42:42.099-0500

Sorry - not sure ho the IMAP snuck on there.  Corrected it.

Curious.  But if freePBX is setting the voicemail.conf file correctly, what else could it be doing between that file and the email send?  I didn't think they had anything that would be in between.  :-(  Anything else you'd suggest I could try re: logging/troubleshooting to track down exactly where the issue is happening?  I'm not super conversant with FreePBX or asterisk code, but I'm quite comfortable in Linux and in code in general.  I'll keep trying to peek on my own, as well.

By: Sean Bright (seanbright) 2017-08-17 13:52:41.637-0500

Try, this.. Create a bash script at {{/usr/local/bin/fake-sendmail}} with the following contents:

{noformat}
#!/bin/bash
logfile=$(mktemp /tmp/voicemail.XXXXXX)
cat - > $logfile
{noformat}

Make it executable ({{chmod +x /usr/local/bin/fake-sendmail}}). Update your FreePBX configuration to use {{/usr/local/bin/fake-sendmail}}. And then run a few tests. You should end up with some {{voicemail.*}} files in {{/tmp}}. Redact one of those files as necessary and then upload.

By: Sean Bright (seanbright) 2017-08-22 14:17:03.697-0500

[~teleute], were you able to try the testing I suggested?

By: Allison Walters (teleute) 2017-08-23 22:05:39.501-0500

I haven't yet...sorry!  Been putting out fires left and right the last few days.  Hopefully tomorrow.  Thanks!

By: Allison Walters (teleute) 2017-08-30 19:05:09.525-0500

The file shows the correct email address - voicemail@ourdomain.com (this domain is of course changed here in the comments, but all correct on the system/in the file)  I can upload the whole file as well, but here's the seemingly relevant portion...
----------------------------------------------------------------------------

Date: Wed, 30 Aug 2017 17:59:30 -0600
From: "Voicemail System" <voicemail@ourdomain.com>
To: "Allison Walters" <myaddress@ourdomain.com>
Subject: Voicemail Notification
Message-ID: <Asterisk-2-996758302-264-27253@freepbx>
X-Asterisk-CallerID: xxxxxxxxxx
X-Asterisk-CallerIDName: xxxxxxxxxx
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----voicemail_2264272531424793480"

<then message here - no email address info shows after this point>

By: Sean Bright (seanbright) 2017-08-31 08:21:51.845-0500

[~teleute], based on the information you provided, this is not a bug in Asterisk. There are two settings in {{voicemail.conf}} that affect the {{From}} header of a generated e-mail: {{serveremail}} and {{fromstring}}. From the examples you provided, Asterisk is generating the {{From}} header as expected, using the {{serveremail}} value that you supplied.

These settings *do not* affect any SMTP authentication. That is left up to your sendmail configuration. So you will need to fix/edit your local sendmail configuration to authenticate against Office 365 using the correct principal. I don't know what FreePBX provides as a sendmail implementation, but that is out of scope for the Asterisk project.

If you feel this issue was closed in error, feel free to re-open.

By: Allison Walters (teleute) 2017-08-31 11:26:23.768-0500

The issue isn't the authentication - it authenticates as whatever I tell it to auth as in the SMTP settings.  But the auth credentials have to match what the email is sending as, or O365 rejects it.  And if I put all of the settings to the voicemail address, it auths as voicemail but is trying to send as asterisk, so O365 rejects it.

Anyway, I'll re-raise it back at FreePBX.  Thanks.

By: Asterisk Team (asteriskteam) 2017-08-31 11:26:24.191-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: Sean Bright (seanbright) 2017-08-31 13:41:54.930-0500

[~teleute], I understand what you are saying, but Asterisk is not an SMTP client, it relies on sendmail or whatever you have configured as your {{mailcmd}} to actually send the e-mail.

Asterisk is generating the e-mail that you are asking it to, but your SMTP server (Office 365) is rejecting it for reasons outside of Asterisk's control.

By: Allison Walters (teleute) 2017-08-31 13:49:08.330-0500

The sendmail log is showing the failed emails as coming from asterisk@ (i.e. not the auth, but the email header), though, when I have it configured to be voicemail@ .  That's why I'm confused...  Anyway, I've reopened back at FreePBX.  Thanks again.

By: Asterisk Team (asteriskteam) 2017-08-31 13:49:08.785-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.