FreePBX 17 refusing to even try to send mail after VM left

Hello all,

We’re trying to get FreePBX 17 (running on Ubuntu 22.04 LTS) to send mail via Google Workspace when someone calls and leaves a voicemail. We have a script that behaves like sendmail -t, and can successfully send mail using Gmail’s OAuth API with this script (I’ve just tested it; the script still works).

We have been able to get FreePBX to send mail exactly one time. We’ve gone back to the exact state the PBX host was in and tried again, and we still cannot send a second email from PBX. The voicemail inbox works, incoming calls work, the extensions all work, the only thing that’s broken is FreePBX will not send mail.

What do I do? How do I force it to always send mail? Should I just disable the email components of FreePBX and manage it myself?

mail logs needed and clarification of MTA being used (Debian’s defauilt is exim, but postfix is generally preferred.man sendmail should confirm at the top, what your box is using)

Our MTA is Google Mail (using a Python script that behaves like sendmail as a communication bridge.) I tried generating logs but it’s like the script is never getting called in the first place. Mail command is set correctly (/usr/local/bin/emailproc for reference)

Here’s some additional context on why our setup is the way it is:

  • In our initial research and design phase for our voicemail notifications, we found that FreePBX’s (or perhaps Asterisk’s) built in mail notification system did 99% of the legwork for us; GMail (via this API) expects a Base64 encoded MIME message with minimal JSON overhead. FreePBX/Asterisk generates this MIME message (that we then base64 and wrap in the relevant overhead), and expects to be able to print this into the stdin of sendmail (or something that acts like it). Configuring and maintaining a full mail stack for PBX is not within our capabilities, but a small Python script that acts like “sendmail for Gmail”, combined with a service address our organization already had? Easy.
  • When we first piloted this phone program, FreePBX 17 was in an earlier state in the beta, and ISOs had not been generated yet. Our organization requires a review of software and operating systems before use within the company; Ubuntu 22.04 was already vetted, Debian 12 was not. We chose to deploy to Ubuntu to reduce our internal process overhead, and because of Ubuntu’s origins as a descendant of Debian. We’ve been rolling upgrades out to our existing instance as they get approved.
  • We chose FreePBX 17 knowing it was in beta because our understanding at the time was that by the time our processes were done, FreePBX 17 would be released, or at least in the release candidate stage, and upgrading would be non-Herculean, at the least.

Won’t be easy helping you with your home brewed python script :wink: , as a first point of strategy install postfix, it’s probably more robust and /var/mail/mail.log will likely be instructional

If your are still not feeling up to it, there are at least 101 postfix recipes for you to simply\ relay to your personal gmail account

We can’t.

Postfix isn’t approved by our information security department, and we do NOT have the resources to maintain a full sized mail stack like Postfix or exim. The script itself isn’t even the problem; FreePBX is just pretending it doesn’t exist.

Do I have to rename it to /usr/bin/sendmail?

This isn’t at my house. This is at the office of a large (1000+ employee) organization.

Any binary needs to have execute permission for the asterisk user, if it is not in the $PATH just fully qualify it , which sendmail you get depends on the users and Asterisk will look in home directory first

su asterisk -c "which sendmail"     
echo $HOME
echo $PATH
 cat /etc/passwd|grep asterisk
`

Support for Google Business accounts is probably not best found here.If your proprietary script doesn’t work have you considered mal-chimp mail-gun or whatever

I know you said you cannot use it, but postfix configured through the system admin pro module works perfectly for me using my Google workspace account as the sending agent.

I don’t see how postfix in this mode is any different from your script?