Supongamos que por cada llamada entrante a un Queue o a una extensión especifica deseáramos enviar un correo electrónico. O por ejemplo que por pudiéramos tener una extensión especifica donde quien nos llama a nuestra central graba un mensaje y luego ese mensaje se nos envía por correo electrónico.
Bueno aquí les dejo los pasos
*
yum install ssmtp
- Edit the ssmtp config file :
gksu gedit /etc/ssmtp/ssmtp.conf
- Enter this in the file:
root=username@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=username
AuthPass=password
FromLineOverride=YES
UseTLS=YESInstalamos el MPACKapt-get install mpack
usage:mpack -s "file you wanted" ./data.pdf ambiorixg12@gmail.com
[grabadora]
exten => _205,1,Answer() exten=>_205,2,Set(FECHA=${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}) exten => _205,3,Wait(2) exten => _205,4,Record(${FECHA}:wav) exten => _205,5,Wait(2) exten => _205,6,Playback(${FECHA}) exten => _205,7,Wait(2) same =>n,set(calltime=${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}) exten=>h,1,System(/usr/bin/mpack -s "Asterisk Dominicana ${calltime}" /var/lib/asterisk/sounds/${FECHA}.wav ambiorixg12@hotmail.com,ambiorixg12@gmail.com)
Instalamos el mail
apt-get install mailutils
Probamos echo "This is a test" | mail -s "Test" ambiorixg12@hotmail.comhttp://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line
Si tenemos sendmail o postix corremos este comando
alternatives --config mta
There are 2 programs which provide 'mta'.
Selection Command
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.ssmtp
Si tenemos error con ssl
SSL not working: certificate verify failed (20)
EDIT 2 This has been resolved by adding the following to my
ssmtp.conf
fileTLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
Centos Config
1) Installation
yum install ssmtp
2) Configuration nano /etc/ssmtp/ssmtp.conf
root=asterisk.dominicana@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=asterisk.dominicana
AuthPass=N2012
FromLineOverride=YES
UseTLS=YES
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
3) change client to ssmtp
alternatives --config mta
4)Allow on the google account the device login
https://www.google.com/settings/security/lesssecureapps
https://accounts.google.com/DisplayUnlockCaptcha
5) test
echo "This is a test" | mail -s "Test" ambiorixg12@gmail.com
Or this way
echo -e "Subject: Este es el Asunto\n\nEste es el cuerpo" | sudo ssmtp -vvv ambiorixg12@gmail.com
##########################
1) Download epel repo rpm file wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2) Install epel repo rpm -ivh epel-release-6-8.noarch.rpm
3)Install ssmtp mta yum --enablerepo=epel install ssmtp
4)configure the client with this config
6) vi /etc/ssmtp/ssmtp.conf
root=asterisk.dominicana8@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=asterisk.dominicana
AuthPass=13333
FromLineOverride=YES
UseTLS=YES
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
Enable google access to less secure app and disable capchat
https://www.google.com/settings/security/lesssecureapps
https://accounts.google.com/DisplayUnlockCaptcha
yum -y install mailxchange alias file /etc/ssmtp/revaliasesroot:asterisk.dominicana8@gmail.com
test yum install mailx echo "This is a test" | mail -s "Test" ambiorixg12@gmail.com
No hay comentarios:
Publicar un comentario