LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-01-2009, 07:05 AM   #1
sci3ntist
Member
 
Registered: Dec 2006
Distribution: Debian,Slackware,FreeBSD,CentOS,Red Hat,Windows Server 2008
Posts: 133

Rep: Reputation: 16
Sendmail


Hello,
I have a VPS that hosts a website, in this website there is a link to tell a friend about the website, that it sends an email. the problem is that when trying to send an email to an account under the domain of the same of website, lets say:
my website: domain1.com
if the link is sent to someemail@domain1.com it fails.
if the link is sent to someemail@whateverelsedomain.com it succeeds.
the server has sendmail configured, I checked /etc/mail/local-host-names and I removed the domain name from there but the problem still exists I tried to make email routing via /etc/mail/mailertable, also didnt work I tried to add another domain in /etc/mail/mailertable for a testing purpose and It worked but for my domain its not working.
If I try to send an email to a user under the system it works, the problem is that It appears to sendmail that it hosts the domain, even when there is no entry in /etc/mail/local-host-names.

Thanks in advance.
 
Old 10-01-2009, 07:16 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,157
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
I guess you don't have a MX record for your domain pointing to your sendmail server.
What is the output of:
Code:
sendmail -bv someemail@domain1.com
 
Old 10-01-2009, 07:30 AM   #3
sci3ntist
Member
 
Registered: Dec 2006
Distribution: Debian,Slackware,FreeBSD,CentOS,Red Hat,Windows Server 2008
Posts: 133

Original Poster
Rep: Reputation: 16
this is the output User unknown, I watched this before in /var/spool/mail/root, My domain has a valid MX record and it works well, I straced it, with strace and it queries about the MX, But I dont know why It keeps lookin at that it hosts the email and not a relay service.
 
Old 10-01-2009, 08:14 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,157
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
If I understand well your problem, your mailserver is on a different host, but the host running the webserver thinks it's local?
You could use /etc/mail/virtusertable to do something like that:
Code:
someemail@domain1.com someemail@[x.x.x.x]
where x.x.x.x is the ip of the MX server for your domain. Or use its hostname without the square brackets.
Don't forget to run
Code:
makemap hash /etc/mail/virtusertable </etc/mail/virtusertable
for the changes to take effect.
 
Old 10-01-2009, 08:36 AM   #5
Liquidity
LQ Newbie
 
Registered: Sep 2009
Distribution: Debian 6 x86
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
If I understand well your problem, your mailserver is on a different host, but the host running the webserver thinks it's local?
You could use /etc/mail/virtusertable to do something like that:
Code:
someemail@domain1.com someemail@[x.x.x.x]
where x.x.x.x is the ip of the MX server for your domain. Or use its hostname without the square brackets.
Don't forget to run
Code:
makemap hash /etc/mail/virtusertable </etc/mail/virtusertable
for the changes to take effect.
I have a similar problem... and that should work, but my domain uses Google Accounts Mail, so the MX is aspmx.l.google.com, I don't see how that would resolve to the full address (me@example.com).

i.e. trying to send mail to me@aspmx.l.google.com doesn't work, it bounces back.
 
Old 10-01-2009, 09:24 AM   #6
sci3ntist
Member
 
Registered: Dec 2006
Distribution: Debian,Slackware,FreeBSD,CentOS,Red Hat,Windows Server 2008
Posts: 133

Original Poster
Rep: Reputation: 16
Thank you its working now. I couldnt figure out that we can put a variable(%1). so I tried mailertable and didnt wor.but now its working,
thanks again.
 
Old 10-01-2009, 09:31 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,157
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
For mailertable you should use
Code:
domain1.com esmtp:mx.domain1.com
Anyway glad to see it worked.

Cheers
 
  


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
Sendmail config questions + Sendmail not reflecting changes to access db wbuik Linux - Networking 2 03-26-2009 05:02 AM
Sendmail ignores aliases with sendmail daemon stopped phavn Solaris / OpenSolaris 1 12-01-2008 02:50 PM
m4 sendmail.mc > sendmail.cf generate unwanted result on OpenSolaris johncsl82 Solaris / OpenSolaris 1 09-08-2008 11:25 PM
sendmail is not working & on $prompt the cmd sendmail hangs Pavan mahoorker Linux - Software 1 04-04-2006 03:57 PM
Sendmail - RunAsUser=sendmail:mail/What files to i have to change ForumKid Linux - Security 45 01-18-2002 11:47 AM

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

All times are GMT -5. The time now is 09:55 PM.

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