Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Sendmail - sending to different server with same hostname

john white_4
Occasional Visitor

Sendmail - sending to different server with same hostname

Hi,

I'm hosting a website, x.com on my machine, but mail for that domain is being hosted on another machine (i.e. the MX record is differnet then the A record for x.com). The problem is when I try to send mail to x.com from the website (via php) it never makes it off the website machine. It thinks it should deliver it locally instead of the real mail server which is a differnet machine. How can I configure sendmail to send *@x.com mail to the other server instead of itself?

Thanks in advance.

-John
3 REPLIES
Mel Burslan
Honored Contributor

Re: Sendmail - sending to different server with same hostname

on your web server, which is the originator of your outgoing email message, check the sendmail.cf file (under /etc/mail) and see if you can find a line which starts with letters

DS

Since you said, it is trying to send it locally, most probably you do not have the line with DS, which is the smart relay server directive.

________________________________
UNIX because I majored in cryptology...
john white_4
Occasional Visitor

Re: Sendmail - sending to different server with same hostname

Thanks Mel. I did not have DS set, so I set it to another domain, say y.com (I host several domains on this machine). However, mail to x.com is still not making it off the box.

Just so you know, mail to any other domain(i.e., besides x.com and y.com) works.
Steven E. Protter
Exalted Contributor

Re: Sendmail - sending to different server with same hostname

You need to take a look at the file /var/adm/maillog

It should show some problems.

sendmail -v -q

Will give you verbose output on the mailq(thats a command to) of the server.

Try an interactive send:

sendmail -v -d8.99 -d38.99 goodguy@x.com
type some text

.



To forward a single domain in sendmail

/etc/mail/virtusertable
@x.com mailserver

/etc/mail/genericstable
mailserver @x.com

You'll need this script to build the sendmail macros on HP-UX to make this happen.

http://www.hpux.ws/buildmail.hpux.text

Some tweaking will be required, but this can work. The target server needs to have the sending server in /etc/mail/access like this:

ip_address_sending_server RELAY

Example

192.168.0.40 RELAY

If its also hpux, you'll need to build sendmail macros to build this functionality into sendmail.cf

SEP
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