Setting up voicemail as email manually

I’m trying to set up voicemail as email manually using instructions in the wiki. My main.cf file looks exactly as printed in the wiki, except I’m using Gmail as my SMTP server.

I’ve tried several times, and I never get voicemail as email. How do I go about troubleshooting this?

your mail log will be authoritative

I broke down and purchased the Pro version of Systems Admin. I used email settings for a Gmail account with proper address and password as credentials, and then used Debug to send an email and view the mail log. The log says “Network is unreachable”. The next line has “530 5.7.0 Must issue a STARTTLS command first”. Not sure what I’m missing here.

That’s a smart decision for all of the different aspects that are included with SysAdmin Pro. When you are setting up the email account, make sure to select the Gmail preset button. The username should be the full gmail email address. Follow the link it shows on the page for information on what’s needed for this type of use.

I tried the Google App password. I set it up on my google account and then entered the 16 digit password in FreePBX. I get the same results when I try to send a test email. Do I need something in My Hostname, My Origin, and My Domain? I left those as is and only clicked Gmail and entered my email credentials. Still not sure what I’m missing here for the email to work.

I think app passwords only work if and when you have enabled 2-factor authentication on the account. Is that enabled for your Google account? If not, it’s not absolutely required, but there is a different setting you need to enable in the Google settings, “Less Secure App Access”. You’ll find this under Managing Your Google Account → Security. You can turn that On and instead of using an app password, you just use the regular password you use to sign into your Google account.

Yes, I have two-factor turned on for this account. Looks like enabling “Less Secure App Access” is not available when using two-factor authentication. So since 2-factor is on, and I’m using an app password, any other thoughts on why I can’t connect?

Is it possible that my initial attempts to set up postfix manually left some entries that are causing a problem connecting to Gmail? …specifically in /etc/postfix/main.cf and /etc/postfix/sasl_passwd (and the postmap hash of /etc/postfix/sasl_passwd)?

I remmember that I had to change and open the port before Gmail worked for me.
“Network is unreachable” and “530 5.7.0 Must issue a STARTTLS command first” might be related to port issues.

Look at this article:
https://support.managed.com/kb/a2283/how-to-configure-postfix-to-use-an-alternate-port-for-smtp.aspx

You can try ports 25, 465, or 587 if you are planning to use Gmail.

Finally I used this article to Generate an App Password for Gmail:

Good luck!

I cleaned up my main.cf file and removed credentials from sasl_passwd and now it seems to work. However, the emails arrive and are put in spam. How do we address that? Simply have each user mark them as “not spam”?

Is the email coming from [email protected]?

I have not have issue with spam.

Yes, my from: email and to: email are both @gmail.com. The test email went to spam, but I haven’t tested with an actual voicemail. I assume I’ll get the same results.

Actually, in looking at the email that was marked spam by Gmail, it looks like the email says it’s from [email protected] Why is it not my email? Do I need to change My Hostname, My Origin, and My Domain on the System Admin, Email Settings form?

Edit /etc/postfix/generic and put this at the end:

root [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
asterisk [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]

Make sure you change the entry [email protected] to be your server’s fqdn.

Then in /etc/postfix/main.cf put at the end:

smtp_generic_maps = hash:/etc/postfix/generic

Then run

postmap /etc/postfix/generic
service network restart