LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-01-2014, 08:54 AM   #1
techie_san778
Member
 
Registered: Jul 2011
Posts: 90

Rep: Reputation: Disabled
Exclamation How to forward mail in mailx ?


Hello Everybody !!

I want to forward mail using mailx. I want to preserve the header information as we see in gmail,yahoo etc. These are my system details :
OS : RHEL 5.5
mailx version : mailx-8.1.1-44.2.2

I tried the 'm' option but it is not working. Can anyone help me in this ??

Thanks in advance..
 
Old 02-02-2014, 06:39 AM   #2
Rawcous
Member
 
Registered: Jan 2014
Location: Farnborough, Hampshire - UK
Distribution: 2 * CentOS 6.10 Self-Hosted Domain Servers (Mail & Web Server / FTP & VPN Server)
Posts: 99

Rep: Reputation: Disabled
Hello "techie...",

If you are saying that you want to forward all mail that arrives for one particular account to another then try the following..

This is how I set mine up yesterday coincidentally using sendmail at least.. (This method lets you preserve the mail header info....)

Let's assume that the original account receiving the mail is A and the account receiving the forwarded mail B

(On my system - Centos 6.5 /home/xxxx is the user's mail directory)

Remember to substitute all occurrences A and B with the user accounts!!

1. cd /home

2. chmod 700 A

3. chmod 700 B

4. cd A

5. touch 644 .forward

6. chown A .forward

7. chgrp mail .forward

8. echo "\B, A" > .forward i.e if the user account you wish to forward the mail to is a local account simply enter the username i.e echo "\john, A" > .forward

If the user account you wish to forward the mail to is not a local account simply enter something along the lines of echo "\john@external_domain.com, A" > .forward

Hope this is what you are after....

Regards,

Rich
 
  


Reply


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
[SOLVED] How to send a mail in HTML format using mailx or mail or sendmail commands vishnu_knl Linux - Newbie 8 04-05-2012 10:00 AM
setup for mail/mailx smoooth103 Slackware 5 05-18-2010 09:25 PM
mailx sending mail via axigen johnh10000 Linux - Server 2 02-24-2010 08:37 AM
mail(mailx) to be nullclient? Chowroc Linux - Networking 0 12-18-2004 05:17 AM
cant see .forward file in home directory >> mail forward/copy steve_babbage Linux - Newbie 0 03-02-2004 06:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:09 AM.

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