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
relaytest(1)						      General Commands Manual						      relaytest(1)

NAME
relaytest - attempt to use SMTP to relay to a DSBL-compliant host SYNOPSIS
relaytest [-v] <ip address[:port]> DESCRIPTION
relaytest attempts to connect to the specified <ip address> on the specified port (default is port 25) and uses a variety of tests to attempt to relay through the host. In the tests below, source.com is sender_domain from dsbl.conf(5) and sender is sender_user. Non-domain-specific tests: MAIL FROM:<sender@source.com> RCPT TO:<listme@dsbl.org> MAIL FROM:<sender@source.com> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<sender@source.com> RCPT TO:listme@dsbl.org MAIL FROM:<sender@source.com> RCPT TO:<dsbl.org!listme> MAIL FROM:<nobody> RCPT TO:<listme@dsbl.org> MAIL FROM:<nobody> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<nobody> RCPT TO:listme@dsbl.org MAIL FROM:<nobody> RCPT TO:<dsbl.org!listme> MAIL FROM:<source.com!sender> RCPT TO:<listme@dsbl.org> MAIL FROM:<source.com!sender> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<source.com!sender> RCPT TO:listme@dsbl.org MAIL FROM:<source.com!sender> RCPT TO:<dsbl.org!listme> MAIL FROM:<> RCPT TO:<listme@dsbl.org> MAIL FROM:<> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<> RCPT TO:listme@dsbl.org MAIL FROM:<> RCPT TO:<dsbl.org!listme> relaytest then builds a list of possible domains, including "[127.0.0.1]", "localhost", [<ip address>], and any other domains that can be derived from reverse DNS of the IP or the SMTP greeting. Domain specific tests: MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<nobody@DOMAIN> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<nobody@DOMAIN> RCPT TO:listme@dsbl.org MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme%dsbl.org@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme%dsbl.org> MAIL FROM:<nobody@DOMAIN> RCPT TO:<"listme%dsbl.org"> MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme@dsbl.org@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<"listme@dsbl.org"@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<@DOMAIN:listme@dsbl.org> MAIL FROM:<nobody@DOMAIN> RCPT TO:<dsbl.org!listme> MAIL FROM:<nobody@DOMAIN> RCPT TO:<dsbl.org!listme@DOMAIN> MAIL FROM:<DOMAIN!nobody> RCPT TO:<dsbl.org!listme> MAIL FROM:<DOMAIN!nobody> RCPT TO:<dsbl.org!listme@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<postmaster@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<administrator@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<sales@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<info@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<webmaster@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<listserv@DOMAIN> RCPT TO:<listme@dsbl.org> relaytest then tries a variety of SMTP AUTH methods to try to relay a message through the target server. The envelopes used for these tests are always: MAIL FROM:<sender@source.com> RCPT TO:<listme@dsbl.org> The SMTP AUTH methods tried are as follows: AUTH LOGIN, user=/webmaster, password=(null) AUTH LOGIN, user=admin, password=admin AUTH LOGIN, user=administrator, password=(null) AUTH LOGIN, user=test, password=test AUTH NTLM (anonymous) OPTIONS
-v Verbose mode. Details of the SMTP transaction are written to standard output. AUTHOR
Ian Gulliver <ian@penguinhosting.net> SEE ALSO
dsbl.conf(5), spamtrap(1) 2002-04-03 relaytest(1)
All times are GMT -4. The time now is 12:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy