Aliases is used to handle mails to a non existing address. This will allow to redirect the msgs destined to a given name to a real user.
eg:-
postmaster: kiran@domain.com,jrkiran@domain.com
The Aliases File:
Default Aliases in system:
MAILER-DAEMON: postmaster
postmaster: root
i.e, if a mail is send to a non existing user then the mail header is modified to MAILER-DAEMON as user.
This means the problem msg or bounced msg has to go some where, and sendmail delivers it to MAILER-DAEMON.
MAILER-DAEMON is aliased to postmaster, and postmaster aliased to root - hence the mail is delivered to root.
Aliases File is case insensitive:
The aliases defined in sendmail is case insensitive.
After changing the aliases no need to restart or reload the sendmail service because in each and every request sendmail consults the db of aliases.
Types of aliases defined
There are 5 types of aliases:
1. 1-to-1 Aliases.(1 alias map to one local username)
eg:-
postmaster: root
bin: root
support: kiran
eg:-
info: kiran,jithu,rinz
sales: hr,joe,nick
This will allow aliases to include the list from separate file
eg:-
finance: :include:/full/path/to/list.list
4. File Redirection Aliases - Re-route the message to file
eg:-
abuse: root,/var/log/abuse/mail
help: /var/log/help
5.Redirecting the E-mail to PIPE (redirecting the output to an application)
when a mail comes we can send the output to certain commands. for example if mail comes for the user john and the is in vacation then we can redirect the mail to the program "vacation" to send the automated reply.
eg:-
kiran: "|/usr/bin/vacation kiran"
Add entry
#vim /etc/mail/aliase
support: kiran
#newaliases
#sendmail -bi
# sendmail -bv support
kiran... deliverable: mailer local, user kiran
Vacation Program
To enable the vacation program for an user called fazi install the vacation program that comes along with the sendmail binary.
Create a forward file
# vim ~/.forward
\fazi, "|/usr/bin/vacation -t0 fazi"
# vim ~/.vacation.msg
Hi Thanks for you mail !
hai i am on vacation
will ping you once i'm back
No comments:
Post a Comment
tag ur valuable ideas below