How to change "From" in mailx


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to change "From" in mailx
# 1  
Old 08-31-2006
How to change "From" in mailx

Hi

I'd like to have a "From" such as the company name or my name instead of the the user@domain.name while using mailx.

Please let me know how I can achieve that.

Also, Im using uuencode and plaintext, so the mail goes with body and attachment. So any solution has to take this into consideration.

Thanks!!
# 2  
Old 08-31-2006
mailx creates the from header using system information, to prevent mail spoofing.
# 3  
Old 08-31-2006
You can use sendmail directly, which will let you change "From"
# 4  
Old 09-01-2006
use the -r option of mailx
# 5  
Old 09-01-2006
mailx -r <address> does not change the From headers, according my man page....

Maybe we're talking about different things. My bad.
I was referring to changing the actual smtp headers. It will make change:
Code:
From: jmcnama@someplace.com
to
From: Jim

But the jmcnama part isn't lost. It's still in the header.
Example:
Code:
"echo "hi there" | mailx -r 'jim your buddy' -s 'test of dash r' jmcnama@somewhere.com

Gives this on the receiving end - a linux box in this case
+ N  18 Sep  1 jim.your.buddy@somewhere.com        (1743) test of dash r


Last edited by jim mcnamara; 09-01-2006 at 11:32 AM..
# 6  
Old 09-08-2006
i think..

the string that is specified with -r option will be displayed as the "From" Clause in any of the mail client used to view the mail received ...

Once you had used mailx... could you please check in the administrative logs ( i checked in /var/adm/messages for Sun Solaris) .. with -r option in mailx there would be a warning message that sender is being reset ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

4. Shell Programming and Scripting

Awk,sed : change every 2nd field ":" to "|"

Hi Experts, I have a string with colon delimited, want 2nd colon to be changed to a pipe. data: 101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3: I am trying with sed, but can change only 1 occurance: echo "101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3:" | sed 's/:/|/2'... (5 Replies)
Discussion started by: rveri
5 Replies

5. Ubuntu

How to change "more" to "more or equal" in this line?

Hi, Below line selects only dates comes after than today. I need to change below line as "more or equal": awk -F\## -v d=$(date +%Y%m%d) '{if($NF>d)print}' /usr/batch/pill.txt > /usr/batch/pill_in_use.txt When we change the code, it will print today's date and following dates only. ... (2 Replies)
Discussion started by: baris35
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Find and change flag "Yes to No" or "No to Yes"

name:age:girlfriend aa:11:yes bb:22:yes cc:33:no dd:44:no ee:55:yes I want to change the cc, the status of girlfriend to yes. Find cc, and then change! how can i do this? (16 Replies)
Discussion started by: rafazz
16 Replies

8. Shell Programming and Scripting

Help to change the file with "sed" and "awk"

Hi experts I want your help to change the file format to my wanted version, please give me a hand thanks $cat file install pass make os pass make build kernel failed usb storage pass chane to | *install* | *make os* | *make build kernel* | *usb storage* | | pass | pass... (7 Replies)
Discussion started by: yanglei_fage
7 Replies

9. Shell Programming and Scripting

Using mailx to send in the future? Also change "from" address?

Hey, I've got a script using mailx to send an email to the user, but i'd like it if I could have it send the email sometime in the future, not right away. And by future, i mean like 1 minute in the future. And I don't want it to halt the script in anyway. Perhaps there's a way to have it... (3 Replies)
Discussion started by: paqman
3 Replies

10. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question