LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-01-2010, 06:39 PM   #1
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Rep: Reputation: 0
Exclamation Sendmail adds MX record to addresses


Hello people, iīm working with virtuals machines to configure Sendmail on Linux.

I work with two domains (ar and org), the configuration is similar in both, so i will write just one.

In orgīs mail server:

/etc/hosts

127.0.0.1 localhost.localdomain localhost
10.3.0.2 mail.org mail

/etc/resolv.conf

nameserver 127.0.0.1
(in the machine where sendmail is working, dns server also runs)

/etc/HOSTNAME

mail.org

/etc/mail/local-host-names
org
mail.org

/etc/mail/access
localhost RELAY
localhost.localdomain RELAY
127.0.0.1 RELAY

org RELAY
mail.org RELAY
10.3.0.2 RELAY

/etc/mail/sendmail.mc
include(`/usr/share/sendmail/cf/m4/cf.m4')
VERSIONID(`Configuracion de Lab Redes 2010')dnl
OSTYPE(`linux')dnl
define(`confLOG_LEVEL', `15')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
TRUST_AUTH_MECH(`EXTERNAL LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL LOGIN PLAIN')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
Dmmail.org
define(`confDOMAIN_NAME', `mail.org')dnl
define(`confTO_IDENT', `0')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
MASQUERADE_AS(`org')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`masquerade_entire_domain')dnl
FEATURE(`relay_based_on_MX')dnl
EXPOSED_USER(`root')dnl
MAILER(`smtp')dnl
MAILER(`procmail')dnl
Cworg

The emails stopped coming and the server adds to the e-mail addresses the MX record. For example, if i send an email to u1@org in log appears u1@org.mail.org.

Any suggestion?
 
Old 11-02-2010, 08:17 AM   #2
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
Quote:
MASQUERADE_AS(`org')dnl
What do you trying to do with this option? I don't know if this is a proper domain definiton.
At sendmail.org I can see an example definition like this:
http://www.sendmail.org/m4/features...._entire_domain
Quote:
MASQUERADE_AS(`mail.org')dnl
Did you tried to put there your full domain name.
Quote:
u1@org
This email address seems a litle strange. Is this only an example or you want to use email addresses like this?

You also noted that "emails stopped coming". This means -that it worked and after some changes you made it stopped?
 
Old 11-02-2010, 11:29 AM   #3
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
First, thanks for reply.

Itīs just one example, so i do it in virtual machines.

The configuration that I used before was this:

include(`/usr/share/sendmail/cf/m4/cf.m4')
VERSIONID(`Configuracion de Lab Redes 2010')dnl
OSTYPE(`linux')dnl
define(`confLOG_LEVEL', `15')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
TRUST_AUTH_MECH(`EXTERNAL LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL LOGIN PLAIN')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
Dmmail.org
define(`confDOMAIN_NAME', `mail.org')dnl
dnl define(`SMART_HOST',`mailserver.example.com')
define(`confTO_IDENT', `0')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`relay_based_on_MX')dnl
EXPOSED_USER(`root')dnl
MAILER(`smtp')dnl
MAILER(`procmail')dnl
MASQUERADE_AS(`org')dnl

This configuration was working for users of the same domain, but wasnīt working for externals domains. When i back to this configuration, the error still persist.

Change MASQUERADE_AS ('org') dnl to MASQUERADE_AS (mail.org `') dnl doesnīt work
 
Old 11-03-2010, 12:18 PM   #4
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
I will compare my configuration against yours. (I show only the differences)
Quote:
nameserver 127.0.0.1
(in the machine where sendmail is working, dns server also runs)
I don't use local DNS on my server. So my configuration looks like this (resolv.conf):
Quote:
search mydomain.org
nameserver 208.67.222.222
nameserver 208.67.220.220
Those nameservers are public DNS servers from opendns.
Quote:
/etc/HOSTNAME
mail.org
I use full hostname. Where the server is the name of my PC within the mydomain.org domain.
Quote:
server.mydomain.org
Quote:
/etc/mail/local-host-names
org
mail.org
I use only two definitions. My configuration is:
Quote:
mydomain.org
server.mydomain.org
The /etc/mail/access is empty for me. I think this is because my server does email RELAY only from authenticated clients. It may be different for you, but you ca try it.

There are some lines in your sendmail.mc what I cannot understand ... this is why I am asking the version of OS. I never saw this in my mc files but it may be different in other distributions.
Quote:
Dmmail.org
Cwrog
For the sendmail.mc - some basic information can be useful.
1. What version of sendmail do you use?
2. What OS are you running on?
3. Are you using any configuration utility for sendmail? (Webmin etc.. or only m4)
4. Finally - how do you test your server? (telnet+commands, with some MUA ...)

Quote:
First, thanks for reply.
You arr welcome, I hope it will help you.

Last edited by hua; 11-03-2010 at 12:21 PM.
 
1 members found this post helpful.
Old 11-03-2010, 01:19 PM   #5
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
I use Dmmail.org because in log appears an error "Who i am?" and in the help file of Sendmail gives this solution. In many forums said that Cw is to recognize the primary domain.

The Sendmail version is 8.14.3 and the SO is Slackware 12.2. I Only use m4 to generate the sendmail.cf file and telnet to test the server.

"mail" is the hostname of the server in the domain (as "server" in your domain)

I modify the resolv.conf file like yours (i change the loopback address to public address and aggregate search org) and the sendmail.mc file as follow:
include(`/usr/share/sendmail/cf/m4/cf.m4')
VERSIONID(`Configuracion de Lab Redes 2010')dnl
OSTYPE(`linux')dnl
define(`confLOG_LEVEL', `15')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
TRUST_AUTH_MECH(`EXTERNAL LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL LOGIN PLAIN')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
Dmmail.org
define(`confDOMAIN_NAME', `mail.org')dnl
dnl define(`SMART_HOST',`mailserver.example.com')
define(`confTO_IDENT', `0')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
FEATURE(`masquerade_envelope')dnl
dnl· FEATURE(`relay_based_on_MX')dnl
EXPOSED_USER(`root')dnl
LOCAL_DOMAIN(`mail.org')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
MASQUERADE_AS(`org')dnl

Now the emails from users of the same domain are transmitted, but not between domains...

thanks for your time and patience
 
Old 11-03-2010, 01:30 PM   #6
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
This is the problem...
Attached Thumbnails
Click image for larger version

Name:	sendmail.png
Views:	24
Size:	35.7 KB
ID:	5067  
 
Old 11-03-2010, 02:32 PM   #7
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
It seems that you still asking for DNS names your own server. (I suppose that the local address on the picture is your server address)
I tried that domain, and it resolves.

In resolv.conf you set up which nameserver should be asked for names. On the picture I can see that it is your own server, so the DNS query for the domain fails.

I found out that you need to restart sendmail after the changes in resolv.conf. I changed for example my own to another DNS and until I didn't restart sendmail it was still asking the old nameserver.

-----
One more thing - although you set up mail server there are some things which has to be configured for the domain on the DNS server which act as authoritative server for that domain. (MX, PTR ...) This DNS server can be your own server (That requires DNS server configuration) or some external server. I use for example external provider for this. Did you take care about your domain correctly?

Last edited by hua; 11-03-2010 at 03:00 PM.
 
Old 11-03-2010, 02:49 PM   #8
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
The problem is when Sendmail search for the ar domain's mail server. The org domain is added to the query.

It is a Sendmail problem because if i use a tool like host, dig or nslookup the query works perfectly.
 
Old 11-03-2010, 03:22 PM   #9
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
Quote:
I work with two domains (ar and org), the configuration is similar in both, so i will write just one.
Sorry... I think I did not really understand what domain you want to use. I don't think that ar or org are valid end user domains.
From wikipedia:
Quote:
The first-level set of domain names are the top-level domains (TLDs), including the generic top-level domains (gTLDs), such as the prominent domains com, net and org, and the country code top-level domains (ccTLDs). Below these top-level domains in the DNS hierarchy are the second-level and third-level domain names that are typically open for reservation by end-users that wish to connect local area networks to the Internet, run web sites, or create other publicly accessible Internet resources.
I thought that when you write "I use domains ar and org" you mean that after these names you use some top level domain. ar.com or ar.net for example. But I am not sure if domain like that (ar, org) are valid for use.
You cannot use domain without the Top Level Domain names. the name server looks for names based upon of this name (org,net,com,de) for each of this TLDs there are root servers which holds the valid second-level domain names.
I am not really an expert in unusual ways of domain name use, so If you want to use domain names some other strange ways I cannot help to you.

Last edited by hua; 11-03-2010 at 03:39 PM.
 
Old 11-03-2010, 03:41 PM   #10
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
I know that ar and org are TLDs, is just one example. That's why I use virtual machines (User Mode Linux).

In fact the example started explaining how DNS works, even i have configured a zone in-addr.arpa for reverse resolutions, and now i want to add a mail server in the example.
 
Old 11-04-2010, 03:55 AM   #11
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
Quote:
It is a Sendmail problem because if i use a tool like host, dig or nslookup the query works perfectly.
Can you post the output of this? For example:
Quote:
nslookup ntp.org
Server: 195.146.128.62
Address: 195.146.128.62#53

Non-authoritative answer:
Name: ntp.org
Address: 128.4.35.16
Name: ntp.org
Address: 149.20.68.16
On the attached picture I can see a standard DNS query of domain ar.org.
Quote:
Standard query MX ar.org
Standard query response, No such name

The problem is when Sendmail search for the ar domain's mail server. The org domain is added to the query.
What do you suppose, what it should look like?

Last edited by hua; 11-04-2010 at 04:13 AM.
 
Old 11-04-2010, 07:28 AM   #12
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
This resolution is made with nslookup. The resolution of the domain and mail server are correct. That is why I guess that the error is when Sendmail query for the mail server of ar domain, because he adds her domain to the query.
Attached Thumbnails
Click image for larger version

Name:	nslookup.png
Views:	22
Size:	15.8 KB
ID:	5081  
 
Old 11-04-2010, 10:50 AM   #13
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
I would consider to play with (remove) these options in sendmail.mc. I didn't made much study about this directives but it seems to me that it can help.
Quote:
define(`confDOMAIN_NAME', `mail.org')dnl
FEATURE(`always_add_domain')dnl
Please let me know how it goes.
I can see the environment where you run these servers now. It looks interesting.
It seems to me that you run inside your own network with more local networks. Do you going to use these servers in the public net or you just test those servers inside an isolated network?

Last edited by hua; 11-05-2010 at 02:31 AM.
 
Old 11-04-2010, 11:13 AM   #14
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
The purpose is for study, otherwise see how DNS works require several machines on a local network (with arpa zone including).

The topology is created virtually on a single host and thus able to work in larger scenarios.

Tonight I make those changes and tell you the result,
Greetings dear friend
 
Old 11-05-2010, 07:34 AM   #15
HernanM
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
These changes donīt work... =(

I found that if I put a point to the address (eg from user@org. to user@ar.), the relay is working properly (in the registry appears relay=mail.ar), but the mail is returned because the sender's domain does not exist (data format error)
 
  


Reply



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
Sendmail MX record problem hiteshdarji Linux - Newbie 5 03-05-2010 07:38 AM
Sendmail not sending to internet email addresses wstclair Linux - Newbie 1 03-21-2008 09:39 AM
sendmail - send email on different IP addresses dalemcd Linux - Newbie 1 01-17-2008 02:00 PM
sendmail smtp addresses dskny Linux - Software 2 01-13-2004 08:32 PM
Problem using Sendmail to email certain addresses sethen Linux - Networking 1 11-19-2003 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:50 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