Unix/Linux Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

How to force Sendmail to Rewrite Sender Address?

Solaris


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 06-23-2011
KhawHL KhawHL is offline
Registered User
 
Join Date: May 2003
Last Activity: 17 November 2015, 10:53 PM EST
Posts: 67
Thanks: 2
Thanked 0 Times in 0 Posts
How to force Sendmail to Rewrite Sender Address?

Need to change sender email id from applmgr@<hostname>.<domain-name> to applmgr@domain-name.

Understand we can change in the sendmail.cf where $j is the hostname.domain-name.. can anyone show the exact value to change?

Thank you.
Sponsored Links
    #2  
Old Unix and Linux 06-23-2011
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks: 8
Thanked 587 Times in 560 Posts
You need a rewrite rule. They and their placement in different ruleset numbers vary by sendmail version. Each rewrite rule runs until it does nothing, recursively, so be careful. They are a bit like sed s, but I forget already, and have to google. SMTP sendmail.cf
Addresses are already reformatted by the time most rewrite rules see them, adding to the fun. "echo 'some_addr'|sendmail -bt" returns some indication of what rules are up to. (mnemonic - Become Tester -bt)

So, find out which sendmail version you have, and google around for sendmail rewrite rule ruleset.

Not linked to the web, but I stole this a few decades back, for an old sendmail version: http://davidgpickett.home.comcast.ne...l_tutorial.txt

This looks just right for you: http://www.sendmail.org/~ca/email/en...#SM-MASQUERADE
Sponsored Links
    #3  
Old Unix and Linux 06-24-2011
KhawHL KhawHL is offline
Registered User
 
Join Date: May 2003
Last Activity: 17 November 2015, 10:53 PM EST
Posts: 67
Thanks: 2
Thanked 0 Times in 0 Posts
Hi,
Thanks for your reply. It's really a lot need to absorb Linux.. will try to pick up. It will be good if someone has already done can show me the steps..Linux

Anyway, thanks for sharing.
    #4  
Old Unix and Linux 06-24-2011
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks: 8
Thanked 587 Times in 560 Posts
The last link is just your case, if you have the same version of sendmail.

Sendmail has a history of punishing the rash and reading impaired, and has a very thick, maybe 2 volume, Riley book for the so inclined. I just tinker and google, very carefully. For some rewrites, you cannot get here from there in one line, you have to make something else in the middle of two or more rules to avoid pitfalls like infinite looping.
Sponsored Links
    #5  
Old Unix and Linux 06-24-2011
KhawHL KhawHL is offline
Registered User
 
Join Date: May 2003
Last Activity: 17 November 2015, 10:53 PM EST
Posts: 67
Thanks: 2
Thanked 0 Times in 0 Posts
The version we have is: Sendmail 8.13.8+Sun/8.13.8/Submit

I'm following the steps from Hints about sendmail/e-mail and it seems not work in my environment yet. Not sure the 'smart_host' is the variable or the parameter that we have to follow..
Need to thorough test & trace.. can anyone help me in this?
Sponsored Links
    #6  
Old Unix and Linux 06-27-2011
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks: 8
Thanked 587 Times in 560 Posts
Removing a top domain is the same as removing a host. Test it like this, for ruleset 10 and below:
Code:
$ sendmail -bt -C config_file
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 10 someguy@shomehos.somedomain.com
rewrite: ruleset  10   input: someguy @ shomehos . somedomain . com
rewrite: ruleset  50   input: someguy @ shomehos . somedomain . com
rewrite: ruleset  50 returns: someguy @ shomehos . somedomain . com
rewrite: ruleset  94   input: someguy @ shomehos . somedomain . com
rewrite: ruleset  93   input: someguy @ shomehos . somedomain . com
rewrite: ruleset  93 returns: someguy @ shomehos . somedomain . com
rewrite: ruleset  94 returns: someguy @ shomehos . somedomain . com
rewrite: ruleset  10 returns: someguy @ shomehos . somedomain . com
>

Sponsored Links
    #7  
Old Unix and Linux 07-04-2011
KhawHL KhawHL is offline
Registered User
 
Join Date: May 2003
Last Activity: 17 November 2015, 10:53 PM EST
Posts: 67
Thanks: 2
Thanked 0 Times in 0 Posts
There are so many ruleset and I really don't know which one to change. Linux


Code:
root@devdb # sendmail -bt -d0.1 < /dev/null
Version 8.13.8+Sun
 Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8
                MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS
                NISPLUS PIPELINING SCANF USERDB USE_LDAP_INIT XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = DEVDB
  (canonical domain name) $j = DEVDB.<domain name>
         (subdomain name) $m = <domain name>
              (node name) $k = DEVDB
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>


Last edited by pludi; 07-05-2011 at 04:16 AM..
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
postfix sender address rewriting funksen UNIX for Advanced & Expert Users 0 09-07-2009 09:51 AM
Sender email address has to changes balajiora Shell Programming and Scripting 1 06-12-2009 09:55 AM
Different Sender Address paulds UNIX for Dummies Questions & Answers 1 07-01-2008 02:29 PM
Change sender e-mail address cchiang12 AIX 3 11-18-2006 02:18 PM
mailx sender address customisation vasan_srini UNIX for Dummies Questions & Answers 1 09-10-2001 08:40 AM



All times are GMT -4. The time now is 06:12 AM.