Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-21-2006, 05:09 PM   #1
LQ Newbie
Registered: Sep 2006
Posts: 1

Rep: Reputation: 0
Sendmail Forward Questions

Ok I am pretty new to using linux and sendmail and I have two questions.

1. So lets say from the list below I want to forward the first message to another email outside like how would I do that via the command line?

Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/root": 3 messages 3 unread
>U  1 root@onefish.domain  Wed Sep 20 04:02  99/4299  "LogWatch for"
 U  2 root@onefish.domain  Thu Sep 21 04:02  99/4299  "LogWatch for"
 U  3 root@onefish.domain  Thu Sep 21 16:05  23/972   "Cron <root@onefish> root /home/kshscripts/danrestart.ksh >> /home/kshscripts/logs/danrestart.log"
2. My second question is how do you forward all email sent to root?

Now I know you have to use the .forward file and I have it in /home of root and the contents of the .forward file is.

Thanks for your time.
Old 09-23-2006, 03:49 AM   #2
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
You won't be able to forward messages from the command line with the 'nail' application. If your using a mail client like mutt, they have inbuilt key-combinations. For mutt, view the message that you would like to forward and then press the 'f' key. This will prompt you for the address that you would like to forward the message to.

If you want copies of mail to be automatically sent whenever a particular user receives mail, you can use the /etc/aliases file (/etc/mail/aliases on some systems). Here is an example of the layout:

username: username,,

Each user is separated from the next by a comma. after your done editing the aliases file type the command newaliases or sendmail -bi

Last edited by SlackDaemon; 09-23-2006 at 04:20 AM.
Old 09-23-2006, 12:27 PM   #3
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Using Berkeley Mail, you can include message n into the current message with '~f n' or '~m n', depending on whether you want the indentprefix (for forwarding, you probably wouldn't). The mail client SlackDaemon mentioned, nail (now called mailx), is an extension of Mail having the 'fwd' command, as well as numerous others for handling things such as MIME messages.
Old 09-24-2006, 12:29 AM   #4
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
I stand corrected. Thanks for that Berhanie, I wasn't aware of that.


email, forward, sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail forward brentos Linux - Newbie 1 04-21-2004 09:13 AM
sendmail copy and forward steve_babbage Linux - Software 3 03-01-2004 06:48 AM
SENDMAIL: Forward only? tracer Linux - Software 5 09-11-2003 09:36 AM
Sendmail .forward Help echid Linux - Newbie 2 05-29-2002 02:09 PM
Using forward in sendmail for linux uglyjoe Linux - General 2 05-22-2002 03:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration