LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-26-2011, 10:08 AM   #1
Meowser
LQ Newbie
 
Registered: Jul 2011
Posts: 10

Rep: Reputation: Disabled
Editing sendmail.mc to show internet addressable "from".


I have an application that uses sendmail to send out status notifications of its processes . However, the messages are not getting through to most of the folks who need to see them because the “from” address is not internet addressable (for example, root@thisapplication.domain.local). I would rather have it look more like thisapplication@domain.com though if necessary, root@thisapplication.domain.com would be acceptable.

I have tried to edit /etc/mail/sendmail.mc file as follows:

MASQUERADE_AS(domainxyz.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(domainxyz.com)dnl

Then I ran the following:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
/etc/init.d/sendmail restart

However, it still shows as coming from root@thisapplication.domain.local.
Any suggestions?
 
Old 09-26-2011, 01:36 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,517

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi and welcome to LQ,

Quote:
However, it still shows as coming from root@thisapplication.domain.local.
I guess this is happening only for the root user. This is because by default it's good not to masquerade it. If you're sure you want to masquerade root, check sendmail.mc for
Quote:
EXPOSED_USER(`root’)dnl
and comment it out by adding a "dnl" at the beginning of the line.
Or you can comment out directly the relevant line in sendmail.cf, like:
Code:
#C{E}root
Regards
 
Old 09-26-2011, 02:10 PM   #3
Meowser
LQ Newbie
 
Registered: Jul 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks for the welcome bathory

The only thing running on this machine is that application and it has to run under root.

If it is not recommended to masquerade root, I have no problem having the application send as root. I just need to masquerade the domain.local extension to show as domain.com.
 
Old 09-26-2011, 02:36 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,517

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
You didn't understand what EXPOSED_USER is supposed to do. Quoting from sendmail documentation:
Quote:
There are always users that need to be "exposed" -- that is, their internal site name should be displayed instead of the masquerade name. Root is an example (which has been "exposed" by default prior to 8.10). You can add users to this list using
EXPOSED_USER(`usernames')
So using EXPOSED_USER, means that mail from root will have the domain part not masqueraded (e.g. root@thisapplication.domain.local instead of root@domain.com).
If you don't want that, do what I've mentioned in my previous post

Regards
 
Old 09-28-2011, 09:19 AM   #5
Meowser
LQ Newbie
 
Registered: Jul 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
In truth there was quite a bit that I did not understand. I am rather new to the Linux world and trying to Administrate systems with Google on one screen, the server on another and a book held between them.

The problem lies in the .local part of the domain which is internal to our domain and not internet addressable (and thereby a bit more secure as I am told). That .local being appended to the notifications prevents it from getting sent through our hosted exchange so that is what I need to masquerade or "spoof" some how.
 
Old 09-28-2011, 05:47 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,517

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Does masquerading works for the other users of this box?
You can try this:
Code:
LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(`domainxyz.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MASQUERADE_DOMAIN(thisapplication.domain.local)dnl
If you want to masquerade also mail from root then comment out the line
Code:
#C{E}root
in sendmail.cf and restart sendmail

You can test masquerading, using:
Code:
sendmail -bt
> /tryflags ES
> /try esmtp root@localhost
> /try esmtp root@thisapplication.domain.local
and watch the last line of the last 2 commands

Regards
 
Old 09-28-2011, 06:45 PM   #7
Meowser
LQ Newbie
 
Registered: Jul 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled
There are no other users for this box, it's only purpose is to be an application server.
 
Old 09-29-2011, 01:10 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,517

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Quote:
Originally Posted by Meowser View Post
There are no other users for this box, it's only purpose is to be an application server.
Well that does not mean it can't have other users. Besides it's always good to run servers as an unprivileged user.
Anyway, did you try the above? Did it worked?
 
Old 09-29-2011, 07:03 AM   #9
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
I you want to view a internet addressable form of address you will have to make changes in your named configuration file.



just open up your forward and reverse lookup zone file and mention the domain name which you want to be visible with the users name

for eg root@domain.com

you need to make changes in the MX and the NS entry of the above mentioned config file
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Minicom -s" works, but it always show "Offline", then cannot communicate with others reflecter_chen Linux - Hardware 8 05-14-2016 03:05 PM
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 02:03 AM
Program to "assemble" still-frame pictures into "animated" show Pantherman Linux - General 3 12-25-2009 12:14 AM
X: video drivers "ati" and "fglrx" show same fonts differently simopal6 Linux - Software 7 07-30-2008 03:36 AM
Make "ls" command show colors without "--color=always" switch SharpyWarpy Linux - General 4 07-17-2007 12:00 AM


All times are GMT -5. The time now is 04:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration