Operating System - Linux
1752379 Members
6153 Online
108788 Solutions
New Discussion юеВ

Senmail problem for mutiple domains

 
SOLVED
Go to solution
Steven E. Protter
Exalted Contributor

Senmail problem for mutiple domains

I am hosting multiple domains on a single Linux server.

call them domain1.com
domain2.com
domain3.com

Added the following to /etc/aliases
duser1: @domain1.com
duser2: @domain2.com
duser: @domain3.com

Made the following changes to /etc/mail/access
@domain1.com RELAY
@domain2.com RELAY
@domain3.com RELAY

changes to /etc/mail/mailertable
domain1.com smtp:mail.domain1.com
domain2.com smtp:mail.domain2.com
domain3.com smtp:mail.domain3.com

following changes made to
/etc/mail/virtusertable
@domain1.com duser1
@domain2.com duser2
@domain3.com duser3

Ran the following commands
makedmap -v hast /etc/mail/virtusers.db < /etc/mail/virtusers
makedmap -v hast /etc/mail/mailertable.db < /etc/mail/mailertable

Got no errors. DNS is fully configured and working and the firewall is not blocking access to port 53.

Can not get sendmail name lookups to be valid for inquiry@doman1.com

/etc/sendmail.cf Directive 90 section is uncommented, sendmail was restarted.

What have I missed.


Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
12 REPLIES 12
Steven E. Protter
Exalted Contributor

Re: Senmail problem for mutiple domains

Title should read sendmail, not senmail
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Donny Jekels
Respected Contributor

Re: Senmail problem for mutiple domains

I am not sure if you have your problem fixed yet. Your configs looks good.

One thing to be sure of on the firewall. and again I don't know your firewall. DNS is UDP traffic, make sure the firewall allow this traffic bi-directional.

I have yet to find a firewall that can remember to map back UDP traffic.
"Vision, is the art of seeing the invisible"
Steven E. Protter
Exalted Contributor

Re: Senmail problem for mutiple domains

Thank you sir. The firewall is properly handling udp and tcp traffic on port 53, accepting it, allowing the websites to function.

It is also passing outside mail on port 25, so since its handling MY domain, I started getting outside mail again via an exchange server on the local network.

Because of the sendmail setup, the Linux server itself can't resolve alias mail. I'm scratching my head on this one, because I think I did everything right. Obviously I didn't.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kasper Haitsma
Trusted Contributor
Solution

Re: Senmail problem for mutiple domains

Hello,

Could you share the error's with us please. In what stage of receiving/sending does it fail, with which error code.

A configuration part I have not seen, is 'Fw/etc/mail/local-host-names' see below

Another thing that you can check: You say DNS is fully configured. Can you share the result of: 'nslookup -q=mx domain3.com' it should return lowest MX value for this particular server e.g.

domain3.com pref = 10, mailexchanger = host.domain1.com
domain3.com pref = 50, mailexchanger = mail.your_isp.com
...
and records for nameservers authorative for these domains, as well as reverse lookup resulting in IP for the mentioned hosts



--------- Class w explaination -----
w holds the values, that this_host_accepts_mail_for

if mail for your domains should also be accepted by this host, then they needs to be included into 'w'. I suggest to add the following to /etc/mail/local-host-names
host
host.domain1.com # assuming host is part of domain1
domain1.com
domain2.com
domain3.com

local-host-names is referenced from sendmail.cf by the line:
Fw/etc/mail/local-host-names

local-host-names == sendmail.cw on hp-ux

You can test if sendmail sees the correct values by starting sendmail in test mode:
sendmail -bt
> $=w #should return all the values sendmail holds for 'w'
localhost
host
host.domain1.com
domain1.com
domain2.com
domain3.com
[127.0.0.1]
[IP for host.domain1.com]
> D #to exit test harnas

The next bit is from sendmail.cf on hp-ux explaining the Class 'w':

Aliases for Local Host (class w): This configuration will automatically recognize that mail to users at the local host or any of its host name aliases or CNAMEs should be delivered locally. Other host names that you wish to recognize as local can be added to class w as either a simple class definition (Cw) or a file class (Fw). Any names added to class w must be canonical names. For example, by default, only the server of an nfs cluster runs the sendmail daemon, and mail from the clients is sent out with headers indicating that it originated on the server. However, you might want the server also to accept mail addressed to users at the clients. You could have nameserver MX records directing mail for the clients to the server, and make the server recognize the clients' host names as local. By default class W is defined in 2 stages. Using Cw to add the name "localhost" to class w and then adding the names listed in the file "/etc/mail/sendmail.cw" to class w using Fw. To add other hostnames to class w just add the names as new lines in the file sendmail.cw.


Hth

Kasper Haitsma
hp ned.b.v.
Messaging & OVO-UX Engineer
It depends
Steven E. Protter
Exalted Contributor

Re: Senmail problem for mutiple domains

The Error returned is user not found when trying to use inquiry@domain1.com as an email address in a perl script using sendmail.

Here are the results from command line sendmail
sendmail -v -d9 -d38 inquiry@domain1.com
getauthinfo: invest@localhost
host_map_lookup(domain1.com) => FOUND domain1.com
inquiry@domain1.com... User unknown
Steve was here
.
invest... aliased to @domain1.com
host_map_lookup(domain1.com) => CACHE domain1.com
/home/invest/dead.letter... Saved message in /home/invest/dead.letter

nslookup -q mx
domain1.com mail exchanger = 10 domain1.com.

These results match the DNS record

Here are the results from the sendmail -bt command.
I'm going to give actual results, I'm tired of changing them.

@isnamerica.com
isnamerica.com
ftp.investmenttool.com
@investmenttool.com
shell.investmenttool.com
dns1.investmenttool.com
localhost.localdomain
localhost
investmenttool.com
[66.92.143.194]
www.investmenttool.com
[127.0.0.1]
jerusalem.investmenttool.com
news.investmenttool.com
jerusalem

The server serves hostname is jerusalem
Its primary domain is investmenttool.com
Linux, Red Hat 7.3 on a Dell Poweredge 500SC 1.2 G Ram 2 40 G drives, RAID 1/0 mirror

and records for nameservers authorative for these domains, as well as reverse lookup resulting in IP for the mentioned hosts
Reverse lookups are working right now.

Go ahead and try it, the DNS server is working well.

Here is local-host-names
[root@jerusalem mail]# cat local-host-names
# local-host-names - include all aliases for your machine here.
www.investmenttool.com
investmenttool.com
jerusalem.investmenttool.com
isnamerica.com
@investmenttool.com
@isnamerica.com
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Senmail problem for mutiple domains

Error Code 550 User not found
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Senmail problem for mutiple domains

Changed this

/etc/mail/virtusertable
@domain1.com duser1
@domain2.com duser2
@domain3.com duser3

to this

/etc/mail/virtusertable
@domain1.com %1
@domain2.com %1
@domain3.com %1

Still get the 550 error. I feel like I'm really close.

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Senmail problem for mutiple domains

wondering if I need to make changes to /etc/sendmail.mc and generate a new sendmail.cf

Is that necessary?
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kasper Haitsma
Trusted Contributor

Re: Senmail problem for mutiple domains

Sorry I have not responded earlier, I only get a notification once a day, and it is only a sub task of me..

Anyway you seem to be very close. I think it has to do with the virtuser table, as you are working on as well. Do duser1 .. duser3 really exist on this machine? These need to be real e-mail addresses or aliases. It depends on your current sendmail.cf, if you have to rebuild it. Is there a line like:
Kvirtuser hash -o /etc/mail/virtusertable

and other references to the variable virtuser in the rules (do not mess with them please)
did you build

HTH

Kasper Haitsma
hp ned bv
It depends