Say you want to forward your BIC email to other accounts out there. Here’s the recipe:
- Create a file at the top of your BIC home directory,
rw-,---,---(ie use the command
chmod 600 ~/.forward).
- If your username is
jane, then the forward file should be located in
/home/bic/jane/.forward. NOTE THE DOT IN THE FILENAME.
The mail server will refuse to use a
~/.forward if it is write-enabled by others than you — a security feature.
- With you favorite editor (nano, pico, gedit, vi, etc….) insert the email addresses that you want to forward to, either one by line:
or, all on one line with addresses delimited by commas ‘,’ like
- You can also simply use the command
echo firstname.lastname@example.org > ~/.forward. Beware: this will clobber any pre-existing
- If you preprend a forwarded address with a backslash “\” no further forwarding is done, ie the email is delivered locally. Useful to avoid mail loops…
- You can also use
procmail, a program to process emails (see
man procmailexfor examples). The syntax is more complicated but allows to do complex tasks. Note that your
~/.forwardwill be disregarded if you create a
procmailrecipes in it.
- An example of a
procmailrecipe that does the same as the above