Solved

Sendmail 8.9.1a setup and DNS/MX

Posted on 1998-12-21
18
342 Views
Last Modified: 2013-12-16
On an Intel machine running Solaris 2.6 (SunOS 5.6), I've built sendmail 8.9.1a with no problems (so it seems) and built the sendmail.cf file from hand-editted mc and m4 files. (Perhaps my problem lies in these files?) After renaming and copying the new .cf file to /etc as the new
sendmail.cf file, as root, I then started sendmail with:

sendmail -bd -q1h

I can get sendmail to send out to any address outside my domain, but trying to send something locally to myself with the following input (as user root):

# sendmail -v dvongrad@equity.rampagemedia.com
Subject: 981221 1400

Test
.

produces the following error:

dvongrad@equity.rampagemedia.com... Connecting to
equity.rampagemedia.com. via esmtp...
220 equity.freerealtime.com ESMTP Sendmail 8.9.1a/8.9.1; Mon, 21 Dec
1998 15:58:19 -0500 (EST)
>>> EHLO equity.freerealtime.com
250-equity.freerealtime.com Hello equity [209.67.31.44], pleased to meet
you
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250-ETRN
250-XUSR
250 HELP
equity.rampagemedia.com. config error: mail loops back to me (MX
problem?)
>>> QUIT
221 equity.freerealtime.com closing connection
dvongrad@equity.rampagemedia.com... Local configuration error
/export/home/dvongrad/dead.letter... cannot open
/export/home/dvongrad/dead.letter: Permission denied
postmaster... aliased to root
dvongrad,root... Connecting to equity.rampagemedia.com. via relay...
dvongrad,root... Closing connection to equity.rampagemedia.com.
220 equity.freerealtime.com ESMTP Sendmail 8.9.1a/8.9.1; Mon, 21 Dec
1998 15:58:19 -0500 (EST)
>>> EHLO equity.freerealtime.com
250-equity.freerealtime.com Hello equity [209.67.31.44], pleased to meet
you
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250-ETRN
250-XUSR
250 HELP
equity.rampagemedia.com. config error: mail loops back to me (MX
problem?)
>>> QUIT
221 equity.freerealtime.com closing connection
dvongrad,root... Local configuration error
MAILER-DAEMON... aliased to postmaster
postmaster... aliased to root
postmaster... aliased to root
root... Local configuration error
MAILER-DAEMON... aliased to postmaster
postmaster... aliased to root
MAILER-DAEMON... Saved message in /usr/tmp/dead.letter
Closing connection to equity.rampagemedia.com.

In addition, if I try the same thing as user dvongrad, I get:

> sendmail -v dvongrad@equity.rampagemedia.com
queuename: Cannot create "qfQAA22854" in "/var/spool/mqueue" (euid=105):
Permission denied

In essence, I can't get the mail server to accept anything, no matter who I am. This is probably because equity.freerealtime.com and the mail server I'm trying to set up (equity.rampagemedia.com) are the same
machine. The MX record for rampagemedia.com points to
equity.rampagemedia.com. The DNS is maintained at Exodus.net, so I can't change any MX or A records directly, but if these need to be changed, what should I be telling Exodus to change and how??

I'm still somewhat of a newbie at all this, so I apologize if this has been covered elsewhere in another question. Thanks in advance for any help you can provide. If you need any further info to help solve my dilemma, please don't hesitate to post a comment.
0
Comment
Question by:davev
  • 8
  • 6
  • 2
  • +2
18 Comments
 
LVL 7

Expert Comment

by:HalldorG
Comment Utility
This may due to a missing Cwrecord

Cwequity.rampagemedia.com

should be there somewhere on top


0
 

Author Comment

by:davev
Comment Utility
I've tried the following Cw lines and restarted the sendmail daemon as root, all to no avail:

Cwlocalhost
Cwlocalhost equity equity.rampagemedia.com
Cwlocalhost equity equity.freerealtime.com
Cwlocalhost equity equity.rampagemedia.com equity.freerealtime.com
Cwlocalhost equity equity.rampagemedia.com. equity.freerealtime.com.
Cwlocalhost equity.rampagemedia.com
Cwlocalhost equity.freerealtime.com
Cwlocalhost equity.rampagemedia.com equity.freerealtime.com
Cwlocalhost equity.rampagemedia.com. equity.freerealtime.com.
Cwequity.rampagemedia.com equity.freerealtime.com
Cwequity.rampagemedia.com. equity.freerealtime.com.
Cwequity.rampagemedia.com
Cwequity.rampagemedia.com.
Cwequity.freerealtime.com
Cwequity.freerealtime.com.

Any other thoughts? Thanks in advance for taking the time to respond.
0
 
LVL 22

Expert Comment

by:blu
Comment Utility
Try running the following command and post the result:

sendmail -bt -d0.1 < /dev/null
0
 

Author Comment

by:davev
Comment Utility
The result of that is as follows. Be aware that the MX record for rampagemedia is equity.rampagemedia.com. equity.rampagemedia.com is the same machine as equity.freerealtime.com, but freerealtime.com's MX record is different. Might this be the reason for the conflict?

> sendmail -bt -d0.1 < /dev/null
Version 8.9.1a
 Compiled with: MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND
                NDBM NETINET NETUNIX NIS NISPLUS QUEUE SCANF SMTP XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = equity
  (canonical domain name) $j = equity.freerealtime.com
         (subdomain name) $m = freerealtime.com
              (node name) $k = equity
========================================================

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

Expert Comment

by:blu
Comment Utility
There are couple of things that you can do, depending on the source of your sendmail. Unfortunately, the version I have
access to is slightly modified, so what I say may not exactly match yours.

The problem is that your server does not recognize that it
is the server for rampagemedia.com.  You need to tell it.
This ultimately done by setting a class "w" to the list of
host names that the server is known by. The trick is how to do this.  

I think all you have to do is create a file called /etc/mail/sendmail.cw.  This file should contain the list.
If this does not work, grep for confCW_FILE in all the mc and m4
file in the configuration directories. This macro defines the
actual file name and may be different. If that does not work
tell me what happens.

0
 

Author Comment

by:davev
Comment Utility
While all the responses posted here have been feasible and I really appreciate all the help from all of you, I'm still at a loss. I'm beginning to think that maybe there is a mistake is the way I've compiled the program or in the m4 and mc files used to generate sendmail.cf. So I'll post the contents of those files here in the hopes someone may see what might be wrong, if anything at all. Maybe I need LOCAL_HUB defined too or something else? Thanks.

---- (29) 98/12/23 13:07:24 root@equity:/usr/local/src/sendmail-8.9.1/cf ----
# cat ostype/sunos5.6.m4

[empty file, as the options are split in the two files below as per online docs]

---- (30) 98/12/23 13:08:01 root@equity:/usr/local/src/sendmail-8.9.1/cf ----
# cat cf/sunos5.6.mc
divert(-1)
#
# Copyright 1998 Free Real Time.com Inc.
# Written by David C. Vongrad
# All rights reserved.
#
divert(0)
OSTYPE(sunos5.6)dnl
DOMAIN(equity.rampagemedia.com)
MAILER(local)
MAILER(smtp)

---- (31) 98/12/23 13:08:10 root@equity:/usr/local/src/sendmail-8.9.1/cf ----
# cat domain/equity.rampagemedia.com.m4
divert(-1)
#
# Copyright 1998 Free Real Time.com Inc.
# Written by David C. Vongrad
# All rights reserved.
#
divert(0)
FEATURE(use_cw_file)
FEATURE(redirect)
MASQUERADE_AS(rampagemedia.com)
define(`MAIL_HUB', `equity.rampagemedia.com')

---- (32) 98/12/23 13:08:27 root@equity:/usr/local/src/sendmail-8.9.1/cf ----
# cat /etc/sendmail.cw
equity.rampagemedia.com

---- (33) 98/12/23 13:08:41 root@equity:/usr/local/src/sendmail-8.9.1/cf ----
# sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> $=w
equity
[209.67.31.44]
localhost
[127.0.0.1]
equity.rampagemedia.com
equity.freerealtime.com
> ^D

[Relevant portion from generated sendmail.cf file]

##################
#   local info   #
##################

Cwlocalhost
# file containing names of hosts for which we receive email
Fw/etc/sendmail.cw


0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> equity.rampagemedia.com. config error: mail loops back to me (MX problem?)

Just read the output from your test command and you see that the problem resides on the connected host, not yours. Fix DNS's MX record there first, or try another host.
0
 

Author Comment

by:davev
Comment Utility
The MX record is OK. I'm no longer getting the MX problem from above, but I still can't receive mail at rampagemedia.com, unless I send it to myself from the machine running sendmai as rootl. I get no errors when trying to send mail to rampagemedia from other domains, but nothing ever gets received. I can still send out from rampagemedia.com to other domains though. Does it make a difference that equity.freerealtime.com and equity.rampagemedia.com are the same machine and should this be reflected in the sendmail.cw file? That file now contains the following, all to no avail. :( I have a feeling it still all lies in the m4 support files I'm using that aren't properly set up. These are listed in previous comments for this question.

> cat /etc/sendmail.cw
equity
equity.freerealtime.com
equity.freerealtime.com.
equity.rampagemedia.com
equity.rampagemedia.com.
rampagemedia.com
rampagemedia.com.
209.67.31.44
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> equity.freerealtime.com and equity.rampagemedia.com are the same machine

should be fixed by using (as you still have tested):
Cwlocalhost equity equity.rampagemedia.com equity.freerealtime.com

check what sendmails says for following:
  sendmail -v dvongrad@equity.freerealtime.com
  sendmail -v dvongrad@equity.rampagemedia.com

can you ping *and* telnet (or ftp) both names
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:n0thing
Comment Utility
Try changing /etc/hosts from:
1.2.3.4 myhostname  to
1.2.3.4 myhosname.mydomain.com myhostname

then restart sendmail ...

0
 

Author Comment

by:davev
Comment Utility
ahoffman:

Sending mail as root to the addresses you specified both produce the following:

# sendmail -v dvongrad@equity.rampagemedia.com
dvongrad@equity.rampagemedia.com... forward: /export/home/dvongrad/.forward.equity: Group writable directory
dvongrad@equity.rampagemedia.com... forward: /export/home/dvongrad/.forward: Group writable directory
Subject: 990106 0927

Test

dvongrad@equity.rampagemedia.com... Connecting to local...
dvongrad@equity.rampagemedia.com... Sent

[Now I check if it was indeed sent, and kill it.]

# mail
From dvongrad Wed Jan  6 11:27 EST 1999
Date: Wed, 6 Jan 1999 11:27:13 -0500 (EST)
From: Dave Vongrad <dvongrad@equity.freerealtime.com>
Message-Id: <199901061627.LAA24850@equity.freerealtime.com>
Subject: 990106 0927
Content-Length: 5

Test

? d

I can ping and ftp both names with no problems.

n0thing:

I tried as you suggested, with no luck. From dvongrad@freerealtime.com, I tried sending to dvongrad@rampagemedia.com, dvongrad@equity.rampagemedia.com, and dvongrad@equity.freerealtime.com. The first attempt was received at dvongrad@freerealtime.com (I'm assuming this is because both names point to the same machine), while the last 2 bounced the mail with the subject line:

Returned mail: unknown mailer error 5

If this is the same 5 that appears in errno.h, it's an I/O  error, possibly no permission to write the file? If get permission denied to writing the message to var/mail if I attempt to send mail as any user other than root. (see above comments)

I can post the transcript of my most recent efforts if anyone thinks it would help, too.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
aha, so the erro posted in your question didn't appear anymore.

> The first attempt was received at dvongrad@freerealtime.com
>  (I'm assuming this is because both names point to the same machine), while the last 2 bounced

Of cause, they are the same machine, and using the same mail folders.
To use the FQDN or just the domain itself to address your mail to, depends on your
sendmail configuration *and* DNS's MX record. Check which one will be accepted.

If you have write permission problems on the mail folders/files, try
  chmod u+s /usr/lib/sendmail
0
 

Author Comment

by:davev
Comment Utility
I found the answer to my problem by finding a site that would allow me to generate a sendmail.cf file from simple input into a form and clicking a button. Running sendmail with this generated file got me sending and receiving mail, as I wanted all along, but don't ask me why it works. So the points are still up for grabs to the first person who can tell me the exact URL of the site where I filled in the form to generate a sendmail.cf file; bonus points for why it works and what I was missing all this time. If it goes unanswered for a week, I'll delete the question, but I still very much appreciate all the help and comments provided here. They all provided me with more insight on the functionality of sendmail than I had a month ago.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
one side is http://www.harker.com/gen.sendmail.cf/index.html

Well the reason could be in sendmail.cf:

CRequity.rampagemedia.com
CRequity.freerealtime.com

which must be in the domain/equity.rampagemedia.com.m4

RELAY_DOMAIN(equity.freerealtime.com)
RELAY_DOMAIN(equity.rampagemedia.com)
0
 

Author Comment

by:davev
Comment Utility
ahoffman,

Well, you nailed the site -- I only wish I knew about it a month ago. As for lines starting with "C" in sendmail.cf, these are as follows, but I'll keep what you said in your comment for future reference. I'm not sure now how to give you the points -- maybe you have to post an "answer" so I can? (Don't anyone else even bother trying cuz you won't get them!) Thanks again for your help. I'll be sure to look you up if I have any more sendmail issues, if you don't mind that is. :)

Cwlocalhost
CP.
CO @ % !
C..
C[[
CE root
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 total points
Comment Utility
I'm currently struggling with sendmail 8.9.x too ;-)

So I thought I gave you the hint that you must create the .cf file from scratch (the .m4 files) and cannot use older ones.
(statet in the docs or README somewhere). Sorry for that.

> Cwlocalhost
this was mentiond several times in the comments, I assume that you have something like:    Fw/etc/sendmail.cw   too.

> CEroot
is not the reason for your problem

and the others are explained in the .cf file generated by m4


Anyway, you have a working sendmail.
Feel free to post a new question :-)

Good luck.
0
 

Author Comment

by:davev
Comment Utility
Yes, I have Fw/etc/sendmail.cw too. That was one of the first things I tried. Perhaps you can comment on it for me. Do I need everything that's in it to still have things working? bullsession.com will be another site served by my newly configured sendmail.

equity
equity.freerealtime.com
equity.freerealtime.com.
equity.rampagemedia.com
equity.rampagemedia.com.
rampagemedia.com
rampagemedia.com.
mail.bullsession.com
mail.bullsession.com.
www.bullsession.com
www.bullsession.com.
www.freerealtime.com
www.freerealtime.com.
209.67.31.38
209.67.31.44
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
I think you can remove the duplicate lines ;-)

A hint for debugging; start sendmail as follows:

    sendmail -d -bd
   tail -f /var/log/syslog   # or whatever your syslog file is

then in another window:

   telnet localhost 25    # where localhost is the same as you have started sendmail
    helo your_domain.name  
    mail from: user@your_domain.name

check what telnet and sendmail reports. If there are still some problems you get
somthing like:  map..(....) = NULL

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now