How to change sender email address in mail -s command

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to change sender email address in mail -s command
# 1  
Old 02-11-2011
How to change sender email address in mail -s command

Just having trouble trying to figure out what the option is.

When I do

mail -s "Subject" someuser@example.com

I can't seem to specify "from" or "sender" option as I need it for my task. I tried using --f or -f though it didn't work.

Can someone please tell me what other option should do the above?

Cheers everyone,
Andy

---------- Post updated at 04:27 PM ---------- Previous update was at 04:08 PM ----------

Ok I managed to get it working by using following -

Code:
mail -s "subject" mail1@server.com -- -r "from@fromserver.com"

Thanks everyone,
Andy
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Mail command not working for Long Email Address with Dashes

My company has an email user group email address name that has 35 characters in front of the @ symbol where two of them are dashes. For some reason the mail command fails to send email to this address when I invoke it from the Linux command line. I don't understand the reason for the failure. Below... (5 Replies)
Discussion started by: Phil44
5 Replies

2. Red Hat

How to send mail with sender mail address and name?

Hi, I am trying to send a mail using "mail" command in unix. I wanted to give sender name and sender address. I tried different options ,but still it shows only mail address(No name). mail -s "Alert mail : Nothing running !!!" $email -- -F"Mail Alert" -fno-reply@alert.com But I am getting... (4 Replies)
Discussion started by: jaggy
4 Replies

3. UNIX for Advanced & Expert Users

Mail -s help ,change the sender to correct one

Hi expert I use mail -s "hello" bruce@sohu.com <kernel-img.conf send mail, it display the sender is lyang001@lyang001-OptiPlex-9010.corp.ad..com How can I change the sender to yanglei.fage@gmail.com to default ? (1 Reply)
Discussion started by: yanglei_fage
1 Replies

4. Shell Programming and Scripting

How to change the sender's name or E-mail address in mutt command

Can any one help me in this ??? How to change sender's name or email address in Mutt command??? (4 Replies)
Discussion started by: sarathi
4 Replies

5. Shell Programming and Scripting

Changing the sender Email address to Alias

Hi All, I want to change the email address of the sender to some alias for eg: FROM:noreplyecommerce@test.com needs to be changes to TEST Please help me. (3 Replies)
Discussion started by: sithara
3 Replies

6. Shell Programming and Scripting

how do I change the email sender if I donot have the -r option?

Hey, after I check the man page for mail and mailx, I did not find the -r option. But, I have to change the email sender, how can I do it? Send Mode mailx address... Receive Mode mailx -e mailx mailx -f ... (0 Replies)
Discussion started by: freelong
0 Replies

7. Shell Programming and Scripting

change mail sender in unix aix

Hi All, I have a ksh script, in which it sends mail successfully but from root id(root@system.com). I want it to be sent as customid@system.com. I verified man pages of mail, and found '-u userid' option. But it is failing. code snippet below: mail -s "subject" -u $customid... (7 Replies)
Discussion started by: Arunprasad
7 Replies

8. Shell Programming and Scripting

Sender email address has to changes

I am sending email with attachment using mail and uuencode command. Ex: (echo "$EMAIL_BODY"; uuencode $FILE ATTACH.TXT) || mail "$EMAIL_ID" -s "$EMAIL_SUB" I am getting email from "applmgr@rigelapp01.us.dell.com". I want to change this email address into... (1 Reply)
Discussion started by: balajiora
1 Replies

9. Shell Programming and Scripting

how to know if the mailx command really sends the mail to the email address?

Hi guys, I have a question about the returning message of the mailx command. if I run a mailx command, how can I know if the email has been sent to the email address? If the email address doesn't exist, is there any error message returned? If yes, how can I get the error message? Thanks... (3 Replies)
Discussion started by: sheenshine
3 Replies

10. AIX

Change sender e-mail address

When sending emails to the outside world, aix present itself as d_prod@production1.pdc.itercom.org. This is causing some issue with our e-mail server. So we need to change the name to d_prod@itercom.org... Does any one know how this can be accomplished? Thank you (3 Replies)
Discussion started by: cchiang12
3 Replies
Login or Register to Ask a Question
envelopes(5)							File Formats Manual						      envelopes(5)

NAME
envelopes - sender/recipient lists attached to messages INTRODUCTION
Electronic mail messages are delivered in envelopes. An envelope lists a sender and one or more recipients. Usually these envelope addresses are the same as the addresses listed in the mes- sage header: (envelope) from djb to root From: djb To: root In more complicated situations, though, the envelope addresses may differ from the header addresses. ENVELOPE EXAMPLES
When a message is delivered to several people at different locations, it is first photocopied and placed into several envelopes: (envelope) from djb to root From: djb Copy #1 of message To: root, god@brl.mil (envelope) from djb to god@brl.mil From: djb Copy #2 of message To: root, god@brl.mil When a message is delivered to several people at the same location, the sender doesn't have to photocopy it. He can instead stuff it into one envelope with several addresses; the recipients will make the photocopy: (envelope) from djb to god@brl.mil, angel@brl.mil From: djb To: god@brl.mil, angel@brl.mil, joe, frde Bounced mail is sent back to the envelope sender address. The bounced mail doesn't list an envelope sender, so bounce loops are impossi- ble: (envelope) from <> to djb From: MAILER-DAEMON To: djb Subject: unknown user frde The recipient of a message may make another copy and forward it in a new envelope: (envelope) from djb to joe From: djb Original message To: joe (envelope) from joe to fred From: djb Forwarded message To: joe A mailing list works almost the same way: (envelope) from djb to sos-list From: djb Original message To: sos-list (envelope) from sos-owner to god@brl.mil From: djb Forwarded message To: sos-list to recipient #1 (envelope) from sos-owner to frde From: djb Forwarded message To: sos-list to recipient #2 Notice that the mailing list is set up to replace the envelope sender with something new, sos-owner. So bounces will come back to sos- owner: (envelope) from <> to sos-owner From: MAILER-DAEMON To: sos-owner Subject: unknown user frde It's a good idea to set up an extra address, sos-owner, like this: the original envelope sender (djb) has no way to fix bad sos-list addresses, and of course bounces must not be sent to sos-list itself. HOW ENVELOPE ADDRESSES ARE STORED
Envelope sender and envelope recipient addresses are transmitted and recorded in several ways. When a user injects mail through qmail-inject, he can supply a Return-Path line or a -f option for the envelope sender; by default the envelope sender is his login name. The envelope recipient addresses can be taken from the command line or from various header fields, depending on the options to qmail-inject. Similar comments apply to sendmail. When a message is transferred from one machine to another through SMTP, the envelope sender is given in a MAIL FROM command, the envelope recipients are given in RCPT TO commands, and the message is supplied separately by a DATA command. When a message is delivered by qmail to a single local recipient, qmail-local records the recipient in Delivered-To and the envelope sender in Return-Path. It uses Delivered-To to detect mail forwarding loops. sendmail normally records the envelope sender in Return-Path. It does not record envelope recipient addresses, on the theory that they are redundant: you received the mail, so you must have been one of the envelope recipients. Note that, if the header doesn't have any recipient addresses, sendmail will move envelope recipient addresses back into the header. This situation occurs if all addresses were originally listed as Bcc, since Bcc is automatically removed. When sendmail sees this, it creates a new Apparently-To header field with the envelope recipient addresses. This has the strange effect that each blind-carbon-copy recipient will see a list of all recipients on the same machine. When a message is stored in mbox format, the envelope sender is recorded at the top of the message as a UUCP-style From (no colon) line. Note that this line is less reliable than the Return-Path line added by qmail-local or sendmail. SEE ALSO
qmail-header(5), qmail-local(8), qmail-inject(8) envelopes(5)