Let’s say the voice mail is configured as I described in the article – Setting up voicemail in Asterisk.
There is the following context:
[voicemailcontext] 207 => 1111,Username,email@example.com,,attach=yes|tz=ua|delete=yes
If you want to send a voice message to several email addresses, then instead of firstname.lastname@example.org, for example, testmail:
[voicemailcontext] 207 => 1111,Username,testmail,,attach=yes|tz=ua|delete=yes
Then open the /etc/aliases file in a text editor:
sudo nano /etc/aliases
And let’s specify aliases for testmail:
For the changes to take effect, you need to update the alias database with the command:
cd /etc sudo newaliases
Done, Asterisk will send a message to testmail, and it will be automatically forwarded to the specified addresses.
Redirecting mail for the root user