LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 09-06-2004, 11:35 PM   #1
TheRealDeal
Member
 
Registered: Jun 2003
Location: Central Coast, NSW, Australia
Distribution: Gentoo
Posts: 438

Rep: Reputation: 30
Sending mail through mail server.


Hello.

I have a bunch of linux servers on our network.

I want to be able to send emails from the servers to my email address.

I have installed sendmail and sendmail-cf and in the sendmail.mc file changed only this...

dnl define(`SMART_HOST',`smtp.your.provider') <--- this is default

to

define(`SMART_HOST',`10.1.2.135') <---- which is my mail server.


I then ran make -C /etc/mail and it said it did the changes.

But when I try to send a mail I get a MAIL-DAEMON in my root mail saying that it failed.

If I look in /var/log/maillog this is what I get.

Sep 7 14:50:09 TR-Images sendmail[17725]: i874o925017725: from=root, size=53, class=0, nrcpts=1, msgid=<200409070450.i874o925017725@localhost.localdomain>, relay=root@localhost
Sep 7 14:50:09 TR-Images sendmail[17727]: i874o9Sf017727: from=<root@localhost.localdomain>, size=349, class=0, nrcpts=1, msgid=<200409070450.i874o925017725@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=TR-Images [127.0.0.1]
Sep 7 14:50:09 TR-Images sendmail[17725]: i874o925017725: to=user@runme.com.au, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30044, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (i874o9Sf017727 Message accepted for delivery)
Sep 7 14:50:09 TR-Images sendmail[17729]: i874o9Sf017727: to=<user@runme.com.au>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30340, relay=10.1.2.135, dsn=5.1.2, stat=Host unknown (Name server: 10.1.2.135: host not found)
Sep 7 14:50:09 TR-Images sendmail[17729]: i874o9Sf017727: i874o9Sf017729: DSN: Host unknown (Name server: 10.1.2.135: host not found)
Sep 7 14:50:09 TR-Images sendmail[17729]: i874o9Sf017729: to=<root@localhost.localdomain>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31373, dsn=2.0.0, stat=Sent


I think I have just missed out something. I can ping the 10.1.2.135 IP no problems.

Can anyone see what may be causing the problem I have?

Thanks alot to anyone that can help

Regards
Craig
 
Old 09-07-2004, 12:26 AM   #2
Archite
Member
 
Registered: Jul 2004
Distribution: OpenBSD 3.5
Posts: 89

Rep: Reputation: 15
Check out your from address which appears to be root@localhost.localdomain You may want to look into domain masquarading if you're sending a lot of mail from the console on your box.
 
Old 09-07-2004, 07:08 AM   #3
symen
Member
 
Registered: Sep 2004
Location: Dublin
Distribution: Debian 3
Posts: 61

Rep: Reputation: 15
I don't use sendmail myself, but this line looks like your client box doesnt know this host.
is it in the hosts list?
(Name server: 10.1.2.135: host not found)
 
Old 09-07-2004, 07:21 AM   #4
Archite
Member
 
Registered: Jul 2004
Distribution: OpenBSD 3.5
Posts: 89

Rep: Reputation: 15
yes, it looks like two problems: the sender address and the smart relay host. Does your relay require you to login before sending mail through it? Is it even up? Try pinging it and post what it says.
 
Old 09-07-2004, 05:39 PM   #5
TheRealDeal
Member
 
Registered: Jun 2003
Location: Central Coast, NSW, Australia
Distribution: Gentoo
Posts: 438

Original Poster
Rep: Reputation: 30
Hi guys,

Thanks for the feedback I really appreciate it.

Ok my ping results are...

PING 10.1.2.135 (10.1.2.135) 56(84) bytes of data.
64 bytes from 10.1.2.135: icmp_seq=1 ttl=64 time=0.837 ms
64 bytes from 10.1.2.135: icmp_seq=2 ttl=64 time=0.432 ms
64 bytes from 10.1.2.135: icmp_seq=3 ttl=64 time=0.457 ms

--- 10.1.2.135 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.432/0.575/0.837/0.186 ms


I don't understand though why it would need to be in my hosts file if I am pointing it directly to the IP of the server.

Also, I don't need to log on to forward mails through this server.

Thanks alot.

Regards,
Craig
 
Old 09-07-2004, 05:45 PM   #6
Archite
Member
 
Registered: Jul 2004
Distribution: OpenBSD 3.5
Posts: 89

Rep: Reputation: 15
Okay, now if possible can you send the content of the returned mail?
 
Old 09-07-2004, 05:57 PM   #7
TheRealDeal
Member
 
Registered: Jun 2003
Location: Central Coast, NSW, Australia
Distribution: Gentoo
Posts: 438

Original Poster
Rep: Reputation: 30
Yeah no worries.

This is the returned mail that I get (which is sent to root account).

*************************************************************
From MAILER-DAEMON@localhost.localdomain Wed Sep 8 09:15:08 2004
Date: Wed, 8 Sep 2004 09:15:08 +1000
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
To: <root@localhost.localdomain>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="i87NF8Sf019580.1094598908/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--i87NF8Sf019580.1094598908/localhost.localdomain

The original message was received at Wed, 8 Sep 2004 09:15:08 +1000
from TR-Images [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<user@runme.com.au>
(reason: 550 Host unknown)

----- Transcript of session follows -----
550 5.1.2 <user@runme.com.au>... Host unknown (Name server: 10.1.2.135: host no
t found)

--i87NF8Sf019580.1094598908/localhost.localdomain
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; TR-Images
Arrival-Date: Wed, 8 Sep 2004 09:15:08 +1000

Final-Recipient: RFC822; user@runme.com.au
Action: failed
Status: 5.1.2
Remote-MTA: DNS; 10.1.2.135
Diagnostic-Code: SMTP; 550 Host unknown
Last-Attempt-Date: Wed, 8 Sep 2004 09:15:08 +1000

--i87NF8Sf019580.1094598908/localhost.localdomain
Content-Type: message/rfc822

Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (TR-Images [127.0.0.1])
by localhost.localdomain (8.12.8/8.12.8) with ESMTP id i87NF8Sf019578
for <user@runme.com.au>; Wed, 8 Sep 2004 09:15:08 +1000
Received: (from root@localhost)
by localhost.localdomain (8.12.8/8.12.8/Submit) id i87NF8AI019576
for user@runme.com.au; Wed, 8 Sep 2004 09:15:08 +1000
Date: Wed, 8 Sep 2004 09:15:08 +1000
From: root <root@localhost.localdomain>
Message-Id: <200409072315.i87NF8AI019576@localhost.localdomain>
To: user@runme.com.au
Subject: tr-images

2nd test

--i87NF8Sf019580.1094598908/localhost.localdomain--


Thanks
Craig

Last edited by TheRealDeal; 09-07-2004 at 05:59 PM.
 
Old 09-07-2004, 06:05 PM   #8
Archite
Member
 
Registered: Jul 2004
Distribution: OpenBSD 3.5
Posts: 89

Rep: Reputation: 15
Have you tried pinging runme.com.au? It comes up as not found, maybe you should try emailing someone different?
 
Old 09-07-2004, 06:07 PM   #9
TheRealDeal
Member
 
Registered: Jun 2003
Location: Central Coast, NSW, Australia
Distribution: Gentoo
Posts: 438

Original Poster
Rep: Reputation: 30
Hi.

Yeah here's the results...

[root@TR-Images root]# ping runme.com.au
PING runme.com.au (10.113.10.191) 56(84) bytes of data.
64 bytes from runsydd02.runme.com.au (10.113.10.191): icmp_seq=1 ttl=128 time=0.354 ms
64 bytes from runsydd02.runme.com.au (10.113.10.191): icmp_seq=2 ttl=128 time=0.208 ms
64 bytes from runsydd02.runme.com.au (10.113.10.191): icmp_seq=3 ttl=128 time=0.239 ms

--- runme.com.au ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.208/0.267/0.354/0.062 ms




Craig
 
Old 09-07-2004, 07:02 PM   #10
Archite
Member
 
Registered: Jul 2004
Distribution: OpenBSD 3.5
Posts: 89

Rep: Reputation: 15
Well, I didn't even notice why I couldn't ping that address, it's a pravate ip address range. But what seams to be is that your computer is using an internal dns server but the mail server may not be. If that's the case, it will not find that address as I have not. Just an idea.
 
Old 09-07-2004, 07:02 PM   #11
netopia
LQ Newbie
 
Registered: Sep 2004
Location: Boston, MA
Distribution: fedora core 2
Posts: 28

Rep: Reputation: 15
Slow down... the name server is saying it can't find a host which is an IP address, i.e. it is trying to do a reverse DNS lookup on that host. This is probably one of its anti-spam filters, or it is trying to resolve that IP to see if it is in the list of hosts it's allowed to relay mail thru.

I HATE sendmail and all its config-file friends, so I just use webmin to try to configure it. It usually works out pretty well that way, I suggest you try it

www.webmin.com
 
Old 09-07-2004, 07:06 PM   #12
Archite
Member
 
Registered: Jul 2004
Distribution: OpenBSD 3.5
Posts: 89

Rep: Reputation: 15
I've never really had problems with sendmail but usually I don't have more than one mail server on my network and that server relays through the isp's smtp server. So, Netopia, are you saying that in this case one should use the FQDN in the Smart Hosts entry? I've never tried using an IP myself, so I don't know what would happen...
 
Old 09-07-2004, 07:25 PM   #13
netopia
LQ Newbie
 
Registered: Sep 2004
Location: Boston, MA
Distribution: fedora core 2
Posts: 28

Rep: Reputation: 15
Owing to my sendmail hatred i don't really know for sure
but I think using the FQDN would at least provide some other, more interesting error. Of course if a reverse-DNS lookup is failing on that IP maybe it doesn't HAVE an FQDN. These days sendmail isn't very friendly about using IP addresses with no domain names attached.
 
Old 09-07-2004, 08:44 PM   #14
Archite
Member
 
Registered: Jul 2004
Distribution: OpenBSD 3.5
Posts: 89

Rep: Reputation: 15
Peronally I only use Sendmail on OpenBSD...
 
Old 09-07-2004, 10:54 PM   #15
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
You should be able to fix the hostname problem easily by adding a name to /etc/hosts with the ip and use that instead.

It seems to be trying to resolve the ip as if it is a hostname.

/etc/hosts entry


mailhost 10.1.2.135


then relay through mailhost

You may also need to Masquerade the address as mentioned or your return email is not valid.

Last edited by DavidPhillips; 09-07-2004 at 10:56 PM.
 
  


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
Postfix mail transfer agent not sending mail locally or to other servers sketelsen Linux - Software 3 02-09-2006 11:16 AM
Cron mail sending using outside SMTP mail server Utah Linux - Software 6 08-24-2005 07:44 PM
Sending mail through mail server. TheRealDeal Linux - Networking 0 09-06-2004 11:43 PM
Mail Server not sending mail baye Linux - Software 1 05-28-2004 08:41 AM
sending mail between two mail server !! hitesh_linux Linux - General 3 12-14-2003 12:53 PM


All times are GMT -5. The time now is 05:50 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration