Page 1 of 1

Help setting up Email for voicemail

PostPosted: Mon Jan 15, 2018 10:16 am
by c20xh2
VERSION: 2.14-583a
BUILD: 161226-2224
Asterisk 11.25.1-vici

I'm trying to get the voicemail email working, what I don't understand is that I don't have a /var/log/mail logfile to see what is going on :(

I did :

yast -- Network Services
Mail Server

Code: Select all
(x) Permanent

Outgoing mail server
(mail.mydomain.com) , (server is outside my LAN)

TLS encryption
(x) Use

Authentification: (user/passsword)
[x] Open Port in Firewall
Delivery Mode: Directly


service postfix status

Code: Select all
 postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled)
   Active: active (running) since Mon 2018-01-15 10:11:56 EST; 7s ago


Any idea where to start ?

Re: Help setting up Email for voicemail

PostPosted: Mon Jan 15, 2018 1:07 pm
by c20xh2
My configuration was terrible, missing dependency and didn't had a valide ssl certificate,

Now I'm able to send emails using :

Code: Select all
mail -s "test" c20xh2@gmail.com </dev/null


Vicidial is unable to send the voicemail file:

Code: Select all
relay=smtp.office365.com[40.97.128.194]:587, delay=7.4, delays=0.01/0/2.2/5.3, dsn=5.7.60, status=bounced (host smtp.office365.com[40.97.128.194] said: 550 5.7.60 SMTP; Client does not have permissions to send as this sender [CY4PR1301MB1957.namprd13.prod.outlook.com] (in reply to end of DATA command))
]

Looks like the "from" that I'm sending to the smtp server is not what office365 need, but when I send from terminal it's working...

If anyone had this issue with office365, would love to have your input.

Thanks

Re: Help setting up Email for voicemail

PostPosted: Mon Jan 15, 2018 1:15 pm
by williamconley
professional email servers will often not accept email with a from address whose SPF is not configured to allow sending from your location.

You need to either use a paid smtp service (which will require using a user/pass to send the email through an smtp provider) or configure SPF for the domain you are sending FROM. This will also require that your FROM email address be a real email address on a domain you own (and obviously not "localhost").

Re: Help setting up Email for voicemail

PostPosted: Mon Jan 15, 2018 9:51 pm
by c20xh2
Using gmail (instead of Office365) and a couple of change in /etc/postfix/main.cf made it work for me:

First use :

Code: Select all
yast

Network Services
Mail server


To generate all the config file postfix need, enter the smtp server address/port and the email & password


Then:

1. You must create the certificate for TLS

Code: Select all
cd /etc/ssl/

sudo openssl req -new -outform PEM -out smtp.cert \
   -newkey rsa:2048 -nodes -keyout smtp.key -keyform PEM \
   -days 365 -x509


2. Tell postfix where the cert and key are

Code: Select all
nano /etc/postfix/main.cf

smtp_tls_CApath = /etc/ssl/certs
smtp_tls_cert_file = /etc/ssl/smtp.cert
smtp_tls_key_file = /etc/ssl/smtp.key



3. Set smtp_sasl_security_options to anonymous and use tls

Code: Select all
nano /etc/postfix/main.cf

smtp_use_tls = yes
smtp_sasl_security_options = noanonymous


Emails with voicemail audio file are working with this config