In mail service we can use alias function to forward the mails  coming to a mail id to a another mail address, In some cases the destination mail address may be one for more. Basically they are 5 different types of alias methods which can be used to forward the mails.

The 5 types are

1. one to one

2. one to many

3. Include function

4. File function

5. Pipe Function

One to One

This is the common forward method used  in the mail service, in this method mail coming to user inbox is forward to a another user.

Ex: If we need to forward a user mail to another user

eldo@linuxbuddies.com: riyesh@linuxbuddies.com

By adding this entry in /etc/aliases  the mail coming to eldo is forwarded to riyesh

One to Many

In the previous method we seen that the incoming mail is forwarded to a another single mail id, some cases we need to add more users id at the receivers area.

Ex: If  Eldo and Riyesh were in the admin group, and they also need the mails coming to the admin@linuxbuddies.com in that situation we can use the followwing entry in /etc/aliases

admin@linuxbuddies.com: eldo@linuxbuddies.com, riyesh@linuxbuddies.com

Include Function

Using the one to many method we can add multiple mail id’s at the destination area, but there areas this method are not recommended in areas like mailing list, if they are ten thousand users in receivers section we cannot one to many function because it is diffcult to manage that number of users. In include function we include a file which contains the users

Ex: If maillinglist@linuxbuddies.com contains users like eldo,riyesh,arun,philip……………………

For this need create a file

vi /etc/postfix/maillinglist then add mail id’s in that file, one id per line

then add the entry in /etc/aliases

maillinglist@linuxbuddies.com:  :include: /etc/postfix/maillinglist

File Function

In all mail systems we make particular mail id to capture the abuse mails, if we need to store the mails coming to abuse mail id.  In that case we can use the file function, by this method the mails coming for the abuse id is appened to a file and can be used for later reference in need.

Ex: create a file /var/log/abusemaillog

make the following entry in /etc/aliases

abuse@linuxbuddies.com:  /var/log/abusemaillog

Pipes Function

They are situations that we need to run a script in server only on particular times, for that we can use pipe function for that. We need to create a particular mail id for that, when ever a mail for id comes the script will get executed. We can use perl or shell script for this.

Ex: If there is alert program on the server, when ever a mail for alert@linuxbuddies.com comes the alert binary get executed.

for this need, add like this on /etc/aliases

alert@linuxbuddies.com:  |/usr/local/bin/alert

Venue Details:
Survey #13/1, KB halli ,
Varthur Hoobli,
Outer ring road,
Marathahalli
Bangalore – 87