Es una pregunta bastante común y pese a que su respuesta es la misma, voy intentar dejarlo tan claro como sea posible. It is a question quite common and although his answer is the same, I try to leave it as clear as possible.
Asterisk es una aplicación, como cualquier otra que corra bajo Linux, y por lo tanto sigue una norma que siguen todas las aplicaciones en Linux: Asterisk NO ENVIA EMAILS, si no que se comunica con el servidor SMTP que tengamos instalado en nuestro sistema local y es este el que envía el email. Asterisk is an application, like any other that run on Linux, and thus continues to follow a rule that all applications on Linux: Asterisk NOT send emails, if not that communicates with the SMTP server that we have installed in our local system and this is sending the email. Incluso si queremos utilizar un servidor remoto con una cuenta, el procedimiento sigue siendo el mismo. Even if we use a remote server with an account, the procedure remains the same.
Por este motivo, y por que todas las aplicaciones en linux funcionan prácticamente igual (apache, pureftpd, syslog, etc…) suelen darle los emails que quieren enviar a una aplicación bastante conocida: SendMail. For this reason, and that all applications on Linux operating virtually unchanged (apache, pureftpd, syslog, etc…) tend to give those who want to send emails to an application quite familiar: SendMail.
SendMail es un servidor de envío de emails (SMTP) y fue uno de los primeros y más avanzados servidores de este tipo, pero su poca fiabilidad (demasiados bugs para los administradores de redes) unido a su complejidad si queríamos configurar un servidor serio, hizo que apareciesen otros servidores SMTP más ligeros, simples y rápidos que Sendmail. SendMail a server sending emails (smtp) and was one of the earliest and most advanced servers such, but its unreliability (too many bugs for network administrators) coupled with its complexity if we wanted to configure a server seriously, he other SMTP servers that appear lighter, simpler and faster than Sendmail.
No obstante, todos los sistemas continúan intentando enviar emails dejándolos a Sendmail y es por esto por lo que los nuevos y más sencillos servidores SMTP utilizan un truco para hacerse pasar por Sendmail y poder “suplantarlo”, esto es, crean un enlace simbólico en el sistema con el nombre “sendmail”, de manera que cuando una aplicación intenta acceder a “sendmail”, realmente quien contesta es esta aplicación. However, all systems continue trying to submit Sendmail leaving them emails and that's why so the new simpler and SMTP servers use a trick to pretend to be able Sendmail and "impersonation", ie create a symbolic link in system under the name "sendmail" so that when an application tries to access "sendmail", who actually answered is this implementation. 
Como ya he comentado, casi todas las aplicaciones que tienen la necesidad o la opción de enviar emails utilizan el servidor SMTP local, esto ha hecho que muchas distribuciones, para facilitar la configuración y envío de emails, instalen por defecto algunos sustitutos de sendmail como por ejemplo exim o postfix son las más conocidas. As I said, almost all applications that have the need or the option of sending emails using local SMTP server, this has meant that many distributions, to facilitate the configuration and sending emails, installed by default some substitutes for sendmail exim example or postfix are the best known.
El principal problema de utilizar el servidor SMTP local es el proveedor: Debido al aumento de correos SPAM, los proveedores y los servidores de correo que van a recepcionar tu email comprobarán si realmente el servidor del que procede el email es realmente un servidor “oficial” o bien un servidor que se dedica a enviar SPAM, y como el servidor local no es realmente un servidor en toda regla (no tiene registros MX en el DNS de algún dominio, tiene una dirección IP dinámica, o ha sido utilizado por otro spamer) es por lo que se aconseja encarecidamente utilizar una cuenta de algún servidor de emails ya verificado y seguro. The main problem with using SMTP server is the local provider: Due to increased postal SPAM, suppliers and mail servers that will recepcionar your email actually verify whether the server from which the email is actually a server "official" or a server that is dedicated to sending SPAM, and as the local server is not really a full-fledged server (no MX records in the DNS in any domain, has a dynamic IP address, or has been used by other spam) it is therefore strongly advised to use an account of some server emails already verified and secure.
Posiblemente, tras la instalación de nuestra distribución preferida, podremos enviar emails con el comando: Possibly, after installing our preferred distribution, we can send emails with the command:
echo “Prueba de email” |mail -s “Prueba de email” miUsuario@miDominio.com echo "Proof of email" | mail-s "Proof of email" miUsuario@miDominio.com
Pero cuando hayamos enviado varios de este tipo y empecemos a confiarnos, veremos como nuestro cliente de correo empezará a considerarlo spam, o puede que ni llegue. But when we sent more of this type and begin to rely, as we will see our mail client will start to consider spam, or may not arrive. Es entonces cuando tendremos que configurar nuestro servidor SMTP local para que envíe los emails mediante una cuenta autentificada. This is when we will have to configure our local SMTP server to send emails through an account authenticated.
Para el ejemplo de configuración voy a hacerlo con Exim (el servidor que viene por defecto con Debian), quizá sea uno de los más sencillos de configurar y de manejar, aunque personalmente siempre he preferido Qmail por ser mucho más seguro, no obstante, como nuestro objetivo no es configurar un servidor de correos en toda regla, vamos a hacerlo con Exim (versión 4) que es la que trae Debian (y Ubuntu) de serie. For example configuration'm going to do with Exim (the default server that comes with Debian), is perhaps one of the simplest to configure and manage, although personally I have always preferred Qmail to be much safer, however, as our goal is not to set up a mail server in any rule, we're going to do with Exim (Version 4) which is what brings Debian (and Ubuntu) series.
Lo primero que tenemos que hacer es asegurarnos que lo tenemos instalado: The first thing we have to do is make sure that what we have installed:
apt-get install exim4 exim4-config aptitude install exim4 exim4-config
Una vez que lo hayamos instalado, aparecerá una pantalla de configuración. Once we have installed, you'll see a configuration screen. Si no aparece, podremos acceder a ella en cualquier momento ejecutando el comando: If not, we can access it at any time by running:
dpkg-reconfigure exim4-config dpkg-reconfigure exim4-config
¿Sencillo verdad? Simple Is not it? 
Será entonces cuando nos pregunte por distintas opciones de configuración: It is then when we ask for different settings:
- ¿Quiere utilizar archivos separados para la configuración? -- Do you want to use separate files for configuration?
Respondemos SI Answer yes
- ¿De qué forma queremos configurar nuestro servidor? -- How do we configure our server?
Respondemos “ enviar por SMARTHOST, y recibir por SMTP o Fetchmail” We respond "by smarthost send and receive SMTP or Fetchmail"
- Escriba el nombre del sistema: -- Enter the name of the system:
Respondemos con nuestro dominio: miDominio.com We respond with our domain: miDominio.com
- Escriba la dirección IP desde donde va a atender las conexiones al SMTP: -- Enter the IP address from where they will meet the SMTP connections:
Respondemos: 127.0.0.1 We respond: 127.0.0.1
- Escriba otros servidores destino que el SMTP será aceptado: -- Write other SMTP servers that destination will be accepted:
Aquí no respondemos nada, lo dejamos en blanco. Here we do not respond anything, we leave it blank.
- Sistemas a los que reenviar emails ? -- Systems to which forward emails?
No piques, esto también hay que dejarlo en blanco. Not pique, this must also be blank.
- Escribe el sistema que gestionará el correo saliente de este sistema: -- Write the system that will manage the outgoing mail from this scheme:
(Aquí escribimos nuestro servidor SMTP remoto, por ejemplo…) (Here we write our remote SMTP server, for example…)
smtp.miDominio.com smtp.miDominio.com
Si queremos utilizar una cuenta de gmail, el servidor SMTP de gmail hay que especificarlo junto con el puerto que va a utilizar, y sería esto: smtp.gmail.com::587 (ojo que lleva dos simbolos de dos puntos antes del puerto) If we use an account gmail, SMTP server must be gmail specify together with the port to be used, and it would be this: smtp.gmail.com: 587 (eye that carries two symbols of two points before the port)
- ¿Quiere ocultar el nombre local del sistema local del email saliente? -- Do you want to hide the local name of the local system outgoing email?
Pues NO. Well NO.
- Quiere cachear las peticiones DNS para ahorrar ancho de banda? -- Want caching DNS requests to save ancho de banda?
Pues NO. Well NO.
Bien, hasta ahora tenemos algunos parámetros básicos configurados, pero no hemos indicado el usuario ni la contraseña con el que queremos autentificarnos para enviar emails. Well, so far we have some basic parameters set, but we have not indicated the user or password with which we want to authenticate send emails. Si probásemos a enviar emails, seguramente nuestro servidor remoto recibiría un email de un tal root@localhost y nos lo rechazaría. If you try to send emails, surely our remote server would receive such an email from a root @ localhost and what we reject. 
Vamos a configurar los datos importantes: We will set up important data:
1º. 1. - Editamos el archivo /etc/exim4/passwd.client y escribimos algo como esto: -- Edit your / etc/exim4/passwd.client and write something like this:
smtp.miDominio.com:usuario:contraseña smtp.miDominio.com: user: password
En el caso de que queramos utilizar la cuenta de email, deberíamos poner algo como esto: In case you want to use the email account, we should put something like this:
gmail-smtp.l.google.com: usuario@gmail.com :contraseña gmail-smtp.l.google.com: usuario@gmail.com: password
*.google.com: usuario@gmail.com :contraseña *. google.com: usuario@gmail.com: password
smtp.gmail.com: usuario@gmail.com :contraseña smtp.gmail.com: usuario@gmail.com: password
De esta manera, sea cual sea el nombre del servidor SMTP que utilicemos en gmail, le enviaremos los parámetros correctos y nos aceptará el envío. Thus, whatever the name of the SMTP server that we use in gmail, we'll send you the correct parameters and we accept the shipment.
2º.- Protegemos el archivo para que nadie tenga acceso a leer nuestros datos: 2 .- protect the file so that nobody has access to our data read:
chown root:Debian-exim /etc/exim4/passwd.client chown root: Debian-exim / etc/exim4/passwd.client
3º.- Si estamos configurando nuestra cuenta de Gmail, hay que indicarle (otra vez) que el envío debe hacerlo por el puerto 587 en lugar del estandar (el 25), por lo que tendremos que editar el archivo: 3 .- If we are setting our Gmail account, you must tell (again) that it must do by sending port 587 instead of the standard (25), we'll edit that file:
/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost / etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost
y justo debajo de la línea que dice algo como: ( hosts_try_auth… ) añadir lo siguiente: and just below the line that says something like: (hosts_try_auth…) add the following:
port=587 Port = 587
4º.- Por último, vamos a configurar nuestra identificación saliente: 4 .- Finally, let's configure our outgoing identification:
echo “ root@localhost: usuario@miDominio.com” >> /etc/exim4/email-addresses echo "root @ localhost: usuario@miDominio.com">> / etc/exim4/email-addresses
Y listo, lo último que nos queda es recargar la configuración: And ready, the last thing we have left is to recharge the setting:
ejecutamos: update-exim4.conf (es un comando running: update-exim4.conf (is a command 
Y probamos a enviar un email como hemos hecho antes… And tried to send an email as we have done before…
echo “Prueba de email” |mail -s “Prueba de email” miUsuario@miDominio.com echo "Proof of email" | mail-s "Proof of email" miUsuario@miDominio.com
y veremos cómo nos llega con el usuario y dominio correcto. and see how it comes with the user domain and correct. 
Bueno, parece más complicado de lo que realmente es. Well, it seems more complicated than it really is. Una vez que se ha configurado unos cuantos sistemas con esta técnica, se hace todo diréctamente y sin tener que recordar los pasitos. Once you have configured a few systems with this technique, everything is done directly and without having to remember the pasitos.
Una vez tengamos esto hecho y podamos enviar emails con nuestra cuenta oficial, entonces podremos recibir los emails que hayamos configurado en el buzón de voz de Asterisk, o incluso nuestras alertas de arranque de asterisk o incluso enviar faxes mediante Hylafax,… Once we have this done and we can send emails to our official account, then we can receive emails that we have set in the voicemail Asterisk, or even our alerts boot asterisk or even send faxes through Hylafax,…
Más información: More information:
http://www.exim.org/ http://www.exim.org/
http://wiki.debian.org/GmailAndExim4 http://wiki.debian.org/GmailAndExim4
http://wiki.debian.org/PkgExim4 http://wiki.debian.org/PkgExim4