Sponsored Content
Top Forums Shell Programming and Scripting Changing the sender Email address to Alias Post 302451614 by sithara on Tuesday 7th of September 2010 11:33:05 AM
Old 09-07-2010
I am using the below nawk, to Send notifications.

Currently ,if Ind='Y' Then a member will be notified with a message which uses a template1 and FROM display would be :noreplyecommerceqa@test.com I want to change this to TEST1

and if Ind!='Y' Then a member should be notified with a message which uses a template2 and FROM display should be :TEST2 instead of noreplyecommerceqa@test.com

Code:
 
{ 
   sEmail = substr($0, 21, 50);
   sRefNo = substr($0, 1, 20);
   sAppID = substr($0, 71,6);
   InD = substr($0, 81,1);
   mail = "/usr/bin/mailx -b sithara@yahoo.com -r noreplyecommerce@test.com -s \"subject\" to_addr";   
   gsub("to_addr", sEmail, mail);
   
   if ( sAppID == "MOS   " )
 {
   if ( InD == "Y" )
     {
   gsub("subject","TEST 1 Notification ", mail);
      system("sed \'s/<<ref_no>>/" sRefNo "/g\' template1 | " mail);
     }
   else
     {
   gsub("subject","TEST 2 Notification ", mail);
      system("sed \'s/<<ref_no>>/" sRefNo "/g\' template2| " mail);
     }
 }
   
}

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mailx sender address customisation

Hi All, I'm on UNIX -Solaris... I'm trying to send mail usin Mailx..... The script is working fine and attachments are also being sent.... BUT, when I receive the mail,, the sender address shown is the unix login id name.... Any way by which I could manipulate this in my script command or any... (1 Reply)
Discussion started by: vasan_srini
1 Replies

2. 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

3. Post Here to Contact Site Administrators and Moderators

changing my email address

Hello, Is there a link somewhere to my profile where I can change my email address to my new work email address? I have a new job and would like to receive a notification of responses to my new work address - how can I get that address to you without posting it online for everyone to see? ... (1 Reply)
Discussion started by: tekster757
1 Replies

4. UNIX for Dummies Questions & Answers

Different Sender Address

Hello Following command send link to division managers. echo http://severname:8081/account-reports/2008Jun19-2008Jun25.2/index.html | mail -s "Weekly Division Sales Report" johndoe@companmail.com QUESTION. Above command send a body which is link of division report in email with... (1 Reply)
Discussion started by: paulds
1 Replies

5. 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

6. UNIX for Advanced & Expert Users

postfix sender address rewriting

Hi, I have a postfix server that relays to an exchange server. All of my unix/linux systems send to this server, the problem is the form the mail is sent with, the sender address is username@hostname.domain.local I need to rewrite every sender address to unix@maildomain.com for... (0 Replies)
Discussion started by: funksen
0 Replies

7. Red Hat

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... (0 Replies)
Discussion started by: rockf1bull
0 Replies

8. Forum Support Area for Unregistered Users & Account Problems

Problem after changing email address

Hi, I updated my email address and since then I am not able to post in any other area than here, see the adds and am not able to edit my profile in the User CP. After saving the password change the page was redirected rather fast, so not sure if I need to do anything or if I have to wait for... (3 Replies)
Discussion started by: cero
3 Replies

9. Shell Programming and Scripting

Adding 'from' email address alias in Linux.

Hi Experts, We want to add the 'from' email address to mailx command in all our linux script. After searching this site I am able to find the command '-- -f' to add the from the email address. Bu the problem is our from email address is :- "Proper Support Name <support@company.com>" Now when I... (6 Replies)
Discussion started by: Amey Joshi
6 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Problem changing the email address associated with my UNIX.com account

Hello I have had an account for many years. I have attempted to change the email address associated with my account. After logging-in to unix.com and revising my email address, I received a 're-verification' email at that new address. The first link in that email took me to a page with the... (1 Reply)
Discussion started by: irb
1 Replies
MAILQ(1)						      General Commands Manual							  MAILQ(1)

NAME
mailq - print the mail queue SYNOPSIS
mailq [-Ac] [-q...] [-v] DESCRIPTION
Mailq prints a summary of the mail messages queued for future delivery. The first line printed for each message shows the internal identifier used on this host for the message with a possible status character, the size of the message in bytes, the date and time the message was accepted into the queue, and the envelope sender of the message. The second line shows the error message that caused this message to be retained in the queue; it will not be present if the message is being processed for the first time. The status characters are either * to indicate the job is being processed; X to indicate that the load is too high to process the job; and - to indicate that the job is too young to process. The following lines show message recipients, one per line. Mailq is identical to ``sendmail -bp''. The relevant options are as follows: -Ac Show the mail submission queue specified in /etc/mail/submit.cf instead of the MTA queue specified in /etc/mail/sendmail.cf. -qL Show the "lost" items in the mail queue instead of the normal queue items. -qQ Show the quarantined items in the mail queue instead of the normal queue items. -q[!]I substr Limit processed jobs to those containing substr as a substring of the queue id or not when ! is specified. -q[!]Q substr Limit processed jobs to quarantined jobs containing substr as a substring of the quarantine reason or not when ! is specified. -q[!]R substr Limit processed jobs to those containing substr as a substring of one of the recipients or not when ! is specified. -q[!]S substr Limit processed jobs to those containing substr as a substring of the sender or not when ! is specified. -v Print verbose information. This adds the priority of the message and a single character indicator (``+'' or blank) indicating whether a warning message has been sent on the first line of the message. Additionally, extra lines may be intermixed with the recipients indicating the ``controlling user'' information; this shows who will own any programs that are executed on behalf of this message and the name of the alias this command expanded from, if any. Moreover, status messages for each recipient are printed if available. Several sendmail.cf options influence the behavior of the mailq utility: The number of items printed per queue group is restricted by MaxQueueRunSize if that value is set. The status character * is not printed for some values of QueueSortOrder, e.g., filename, random, modification, and none, unless a -q option is used to limit the processed jobs. The mailq utility exits 0 on success, and >0 if an error occurs. SEE ALSO
sendmail(8) HISTORY
The mailq command appeared in 4.0BSD. $Date: 2013-11-22 20:51:55 $ MAILQ(1)
All times are GMT -4. The time now is 05:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy