LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2014, 04:50 PM   #1
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
How to set DJ and DS in sendmail.mc rather than sendmail.cf manually


The only way I know how to configure these two settings for sendmail is to directly edit the sendmail.cf, so I wanted to finally learn how to do it the proper way by editing the .mc then making the cf. My only problem is, i'm not finding a document or chart to match up what i have to change in the mc to get the desired result in the cf.


# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM
Dj MyDomainGoesHere.com

# "Smart" relay host (may be null)
DSrelay.goes.here
 
Old 08-26-2014, 09:02 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,844

Rep: Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009
Quote:
Originally Posted by rjo98 View Post
The only way I know how to configure these two settings for sendmail is to directly edit the sendmail.cf, so I wanted to finally learn how to do it the proper way by editing the .mc then making the cf. My only problem is, i'm not finding a document or chart to match up what i have to change in the mc to get the desired result in the cf.

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM
Dj MyDomainGoesHere.com

# "Smart" relay host (may be null)
DSrelay.goes.here
For smart host (DS):
Code:
define(`SMART_HOST',`some.host.name')
For domain (DJ):
Code:
DOMAIN('yourdomain.com')dnl
http://www.sendmail.com/sm/open_sour.../m4/README.txt
 
1 members found this post helpful.
Old 09-02-2014, 08:28 AM   #3
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
I got my smart host in there ok, but not having luck with the DOMAIN part. I changed yourdomain.com to what I wanted, and got the following error

m4:sendmail.mc:26: cannot open `/usr/share/sendmail-cf/domain/Domain.I.Tried.To.Set.It.As.com.m4': No such file or directory

Basically what I'm trying to do is when this server sends an email, rather than it saying it's coming from whoever@localhost.localdomain, I want it to say whoever@SomethingThatMakesSense.something, where I'd be happy with whoever@servername.com or something like that just so we can tell what server it came from.
 
Old 09-02-2014, 10:26 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,844

Rep: Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009
Quote:
Originally Posted by rjo98 View Post
I got my smart host in there ok, but not having luck with the DOMAIN part. I changed yourdomain.com to what I wanted, and got the following error

m4:sendmail.mc:26: cannot open `/usr/share/sendmail-cf/domain/Domain.I.Tried.To.Set.It.As.com.m4': No such file or directory

Basically what I'm trying to do is when this server sends an email, rather than it saying it's coming from whoever@localhost.localdomain, I want it to say whoever@SomethingThatMakesSense.something, where I'd be happy with whoever@servername.com or something like that just so we can tell what server it came from.
Right...and from the sendmail documentation link provided in the first response:
Quote:
Originally Posted by Sendmail Documentation about Domains
# To create your own configuration file,
# create an appropriate domain file in ../domain, change the
# `DOMAIN' macro below to reference that file, and copy the result
# to a name of your own choosing.

...and....
*******************************************************************
*** BE SURE YOU CUSTOMIZE THESE FILES! They have some ***
*** Berkeley-specific assumptions built in, such as the name ***
*** of their UUCP-relay. You'll want to create your own ***
*** domain description, and use that in place of ***
*** domain/Berkeley.EDU.m4. ***
*******************************************************************
So, the domain file doesn't exist, because you haven't created it yet, following the instructions and sample files provided with Sendmail.
 
1 members found this post helpful.
Old 09-02-2014, 10:59 AM   #5
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Sorry, guess I didn't write my question right/out fully. I see the sample domain files, but do I just vi them, or is there some make type utility I need to use for here too?

Also, can I just take the generic.m4, rename it and add
DOMAIN(mydomain.whatever)dnl
and that should work? I think it would but obviously I'm not sure on this.
 
Old 09-02-2014, 11:59 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,844

Rep: Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009Reputation: 8009
Quote:
Originally Posted by rjo98 View Post
Sorry, guess I didn't write my question right/out fully. I see the sample domain files, but do I just vi them, or is there some make type utility I need to use for here too?
Nope, just edit them, and when you do the m4 build on your main file, it'll churn through things, if I remember correctly.
Quote:
Also, can I just take the generic.m4, rename it and add DOMAIN(mydomain.whatever)dnl and that should work? I think it would but obviously I'm not sure on this.
Yes, that should be all you need.
 
Old 09-02-2014, 01:58 PM   #7
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
OK, think I did that ok, make no longer complains. Send a test email, but the domain part still came through as localhost.localdomain. So I look in my sendmail.cf and I don't have the DJ. In my .mc I have
DOMAIN(`NameIWant')dnl
where NameIWant matches the name of the .m4 I just did.

Is there maybe another way to set domain via the mc?
 
Old 09-02-2014, 02:09 PM   #8
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
actually, think I may have gotten it, although i'm not sure why. I added a
define(`confDOMAIN_NAME', `MyServer.com')dnl
and now the domain part comes through as MyServer.com
 
  


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
Keeping sendmail from stripping manually inserted header edderkop Linux - Server 4 04-20-2011 05:44 PM
adding access.db manually on sendmail.cf dody1313 Solaris / OpenSolaris 4 10-02-2008 02:01 PM
how to set up a sendmail human Debian 1 10-09-2004 10:05 PM
how to set up sendmail? feetyouwell Linux - Software 6 02-16-2004 10:15 AM
Manually Spool into sendmail edbravo Linux - Newbie 6 02-15-2002 12:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:52 AM.

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
Open Source Consulting | Domain Registration