Sendmail for Email Notification

Sendmail for Email Notification of Voicemail

Introduction

sipXecs is able to forward incoming voicemail messages by email directly to the user's inbox. The actual message can optionally be attached to the email as a .wav file. The email includes links to the user's voicemail portal. Ability to access that portal depends on whether Wen User Portal is accessible by the client. We therefore recommend the .wav file to be attached to the message, which allows local listening on the user's PC.

Configuration of sipXecs for Voicemail Forwarding by Email

Voicemail forwarding can either be setup by the administrator or the individual users using the User Portal. One or two email addresses can be specified. The screen shot below is from the User Portal.

Troubleshooting

sipXecs relies on a local Mail Transport Agent (MTA) installed on the sipXecs server. You must have such an MTA (sendmail, exim, postfix) or some other SMTP server running on the same host that serves the VXML for the voicemail application in order to use the email notification feature.

On Red Hat / Fedora distributions sendmail is installed and started by default after the installation of the Linux operating system. No further configuration is required.

The following represents additional information that could be useful for troubleshooting. The Red Hat / Fedora distributions should install, configure and start sendmail automatically. With other distributions you might have to do some of this manually.

Installing sendmail

Most likely sendmail is already installed on your system and should be running. You can verify this as follows:

rpm -q sendmail
ps aux | grep sendmail

Note: sendmail is installed with yum: yum install sendmail. You also need sendmail-cf and possibly sendmail-doc if you want to make configuration changes. chkconfig sendmail on adds it to the runlevel.

Configuring sendmail

The default configuration of sendmail listens on port 25 and will accept connections from localhost only. You can verify this using telnet (type quit to exit):

telnet localhost 25

This default configuration of sendmail is sufficient to use sendmail as your mail server for sipX. No changes have to be made.

You can test sending mail from your server. Try it with a command like this from your server (this command requires the mailx package to be installed):

echo "test" | mail -s testsubject someemail@hotmailorwherever.com

sipXecs is already configured to use the mail server on localhost to forward mail to an account of your choosing. That means you can use an existing mail account you already have to forward email notifications of voicemail.

Note: Make sure that your firewall settings allow the mailserver to send email messages on port 25.

Optional: Using sendmail to also receive email

In a more general case and before you try to use sendmail for any additional tasks, you should make sure that the MX record for your domain is properly set in the DNS zone file. Refer to DHCP and DNS Server Configuration. You can verify current settings as follows:

dig -t mx domain.com

Receiving System Messages from your sipX Server

Your Linux system will generate a daily system administration status email sent to the root account. Also, the sipX watchdog process will send an email to the user sipx if processes of the sipx system had to be restarted or other error conditions the administrator would like to be informed about. If you would like to get these messages forwarded to your email account, edit the last line in the file /etc/aliases as follows:

  1. Error messages from sipx
    sipx: root
  2. Person who should get root's mail
    root: user@gmail.com

Note: Run the command newaliases after changing the /etc/aliases file to make changes effective (or restart sendmail).

Ways to Debug your Setup

As a first step you should be looking at the logs:

tail -f /var/log/maillog

You can also try and send a message using the command line interface on your sipX server, where user@domain.com can be any valid email address. To complete the message enter a dot "." at the beginning of a new line. The "d" flag only determines the debugging output you get and is optional. The "v" flag is for verbose mode.

sendmail -v -d8 -d38 user@domain.com

Go to Pingability to get a detailed report on your DNS entries and mail server setup as seen from the Internet.

Addendum: Configuring sendmail to also receive email (POP3)

the following is not required to simply use sendmail to send email notification of voice mails. However, you might be interested how sendmail can be used in a simple email configuration with POP3 access.

Create a User for the mail Account

adduser -s /sbin/nologin emailusername; passwd emailusername

The /sbin/nologin option will prevent the user from logging in to your server.

Install dovecot as your POP3 Server

We use dovecot as the POP3 mail server. There are other possibilities, but this is one of the easy ones that uses not much resources.

yum install dovecot

Change the configuration so that only POP3 is available (unless you need IMAP too):
{{Box File| /etc/dovecot.conf|

# protocols = imap imaps pop3 pop3s
protocols = pop3

}}
Now start the dovecot POP3 server:

service dovecot start
chkconfig dovecot on

Modify sendmail configuration to accept mail from the Internet

sendmail uses a rather complex configuration setup. Config files are in the directory /etc/mail. The package sendmail-cf includes the macros required to create the file sendmail.cf from the file sendmail.mc. The make command generates the required sendmail.cf config file.

yum install sendmail-cf

{{Box File| /etc/mail/sendmail.mc|

 # Change this line:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

 # To this line:
DAEMON_OPTIONS(`Port=smtp,Name=MTA')dnl

}}
Now generate the sendmail.cf configuration file and restart the service:

cd /etc/mail
make
service sendmail restart