Operating System - HP-UX
1823913 Members
3379 Online
109667 Solutions
New Discussion юеВ

Re: Options for the .foward file?

 
SOLVED
Go to solution
Daniel M. Gonzales
Frequent Advisor

Options for the .foward file?

Besides other username(s) and my own username (\me), are there any other designations/options that can go into the .forward file?
5 REPLIES 5
Michael Tully
Honored Contributor

Re: Options for the .foward file?

Hi,

The .forward file in your home directory can be used to send e-mail to anyone that is listed in it. For example, I want to send e-mail to myself but I go through a mail relay host, so I use a fully qualified address to send it. The 'root' account can generally have this setup so that mail is forwarded to various address such as system admins.

# cat .forward
michael.tully@mydomain.com

Make sure that sendmail has been setup correctly for this.

-Michael
Anyone for a Mutiny ?
Steven Sim Kok Leong
Honored Contributor

Re: Options for the .foward file?

Hi,

You can also use pipes in your .forward file so that a script can act on your mail buffer eg.:

|~/sendrootmail

This will allow you to customize actions or filter rules to be taken on the received emails.

Hope this helps. Regards.

Steven Sim Kok Leong
SHABU KHAN
Trusted Contributor

Re: Options for the .foward file?

Hi,

You could also have something like this...if you would like it short..

In root's .forward

Your username only..(without the fully qualified name)

For e.g.
skhan

and in my home directory I have a .forward which has

skhan
skhan@mydomain.com



-Shabu
Daniel M. Gonzales
Frequent Advisor

Re: Options for the .foward file?

Michael & Shabu - Thanks, I'm looking for options other than the standard usernames. Looking for the "advanced" .forward options, if there are any.

Steve - That's more of what I'm looking for....thanks!
Bill Hassell
Honored Contributor
Solution

Re: Options for the .foward file?

.forward can contain anything that you can place into the /etc/mail/aliases file. So you can pipe the email to another command, send it to an included distribution list, redirect it into a file and so on. See:

man 5 aliases


Bill Hassell, sysadmin