[HELP] Using a simple email client instead of sendmail

I would like for our Asterisk users to receive their voicemail messages via email, but I would prefer not to have sendmail running on my system. It seems to me that a mail tranfser agent (MTA) like sendmail is overkill when I can simply use an email client like sendEmail. Further, sendemail seems like something of a pain to configure, where a simple email client requires almost no configuration at all.

The problem is, I don’t know how to configure Asterisk to use a more simple client like sendEmail. I have been experimenting with the “mailcmd” setting in voicemail.conf, but not having much luck.

Has anyone tried this? Can anyone tell me what command Asterisk actually attempts if I set “mailcmd” to “/usr/local/bin/sendEmail -f joe@greatco.com -s mail.qwest.com -t”?

Thanks!

google ssmtp

You can install it and run the ssmtp-config command and it will run when sendmail is called.

d

Yeah, but if you just want to use sendmail as a client and not a mail server, there’s not much to configure, you just need to tell sendmail which mail server you do want to use.

Just edit your /etc/mail/sendmail.mc file by uncommenting the SMART_HOST statement, pointing it to the mail server that you want to use, and then process the file using make, and then restart sendmail.

Just edit your /etc/mail/sendmail.mc file to tell sendmail what mail server you want to use.

define(`SMART_HOST',`mail.domain.com')

Process sendmail.mc file and Restart sendmail


cd /etc/mail
make
newaliases
/etc/init.d/sendmail restart
 

am800 -

Thanks for the tip. That is exactly what I was looking for. Unfortunately, I think I still have something configured incorrectly.

My guess is that I need to pass some sort of authentication to the email server I want to use. Note that I DO NOT need to pass any authentication if I use an email client like sendEmail or Evolution. The reason I think I might need it when using sendmail is in the mail log below where it says:

stat=User unknown

The name of the email server is mail.allguardpc.com. If you see anything in this mail.log file that might give you a clue, please let me know.

Thanks!

Apr 20 14:08:58 localhost sendmail[7117]: gethostbyaddr(192.168.0.9) failed: 1
Apr 20 14:08:58 localhost sendmail[7117]: alias database /etc/mail/aliases rebuilt by mkennedy
Apr 20 14:08:58 localhost sendmail[7117]: /etc/mail/aliases: 1 aliases, longest 8 bytes, 12 bytes total
Apr 20 14:09:22 localhost sm-mta[6364]: restarting /usr/sbin/sendmail-mta due to signal
Apr 20 14:09:22 localhost sm-mta[6364]: gethostbyaddr(192.168.0.9) failed: 1
Apr 20 14:09:22 localhost sm-mta[7143]: starting daemon (8.13.4): SMTP+queueing@00:10:00
Apr 20 14:09:37 localhost sendmail[7158]: k3KK9WIS007158: from=mkennedy, size=34, class=0, nrcpts=1, msgid=200604202009.k3KK9WIS007158@localhost.localdomain, relay=mkennedy@localhost
Apr 20 14:09:38 localhost sm-mta[7160]: k3KK9bbC007160: from=mkennedy@localhost.localdomain, size=381, class=0, nrcpts=1, msgid=200604202009.k3KK9WIS007158@localhost.localdomain, proto=ESMTP, daemon=MSP-v4, relay=localhost.localdomain [127.0.0.1]
Apr 20 14:09:38 localhost sendmail[7158]: k3KK9WIS007158: to=kennedymat@aol.com, ctladdr=mkennedy (1000/1000), delay=00:00:06, xdelay=00:00:01, mailer=relay, pri=30034, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (k3KK9bbC007160 Message accepted for delivery)
Apr 20 14:09:40 localhost sm-mta[7162]: STARTTLS=client, relay=allguardpc.com., version=TLSv1/SSLv3, verify=FAIL, cipher=AES256-SHA, bits=256/256
Apr 20 14:09:41 localhost sm-mta[7162]: k3KK9bbC007160: to=kennedymat@aol.com, ctladdr=mkennedy@localhost.localdomain (1000/1000), delay=00:00:03, xdelay=00:00:03, mailer=relay, pri=120381, relay=allguardpc.com. [67.15.235.37], dsn=5.1.1, stat=User unknown
Apr 20 14:09:41 localhost sm-mta[7162]: k3KK9bbC007160: k3KK9fbC007162: DSN: User unknown
Apr 20 14:09:41 localhost sm-mta[7162]: k3KK9fbC007162: to=mkennedy@localhost.localdomain, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent

Well ok, maybe a few more things…
Here is how you can enable authentication.

Uncomment the two lines in your sendmail.mc


TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

Add the following line to your sendmail.mc:


FEATURE(`authinfo',`hash -o /etc/mail/authinfo.db')dnl

Regenerate the sendmail.cf file by running make


cd /etc/mail
make

Create a file called /etc/mail/authinfo, add the following line (see AUTH related at sendmail.org/~ca/email/sm-812.html#812AUTH for more details):


AuthInfo:mail.allguardpc.com "U:<username>" "P:<password>" "M:PLAIN"
AuthInfo: "U:<username>" "P:<password>" "M:PLAIN"

Create the authinfo database by running the command


makemap hash /etc/mail/authinfo.db < authinfo

Restart sendmail


/etc/init.d/sendmail restart