- How to add/edit email aliases:
This is useful when you have to send a report to many emails and you don't want to stress out too much the command line.
For example, you need to send email to asd@domain.com, fred@domain.com and dust@domain.com.
You open /etc/mail/aliases
in your favorite editor and add the following line:
reporting: asd@domain.com, fred@domain.com, dust@domain.com
Save the file and execute the command newaliases
(or sendmail -bi
):
gzaix@root:/etc/mail # newaliases WARNING: Group writable directory /var/spool WARNING: Group writable directory /var/spool/mqueue /etc/mail/aliases: 8 aliases, longest 121 bytes, 374 bytes total
Now your command line will be much simpler:
/some/script.sh | mail -s "Reporting of the script.sh" [color=green]reporting[/color]
PS: this was done on AIX but it should work on all distributions.