LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-07-2011, 02:57 PM   #1
HapticThreek
LQ Newbie
 
Registered: Nov 2011
Location: Cambridge, UK
Distribution: Slackware
Posts: 15

Rep: Reputation: Disabled
Problem sending mail over internal network. Slackware 13.37


Hi folks,
I'm having a problem trying to send internal email from one slackware machine to another.
I have used domainname to set both computer's domain name to 'brambles', then I go to mail, compose a message to root@a.brambles and it returns it saying Host unknown. Same happens when I try it the other way around:

Code:
 N  2 Mail Delivery Subs Wed Dec  7 20:44   67/2209  Returned mail: see transcript for details
? 2
Message  2:
From MAILER-DAEMON@HapticThreek  Wed Dec  7 20:44:12 2011
Return-Path: <MAILER-DAEMON@HapticThreek>
Date: Wed, 7 Dec 2011 20:44:12 GMT
From: Mail Delivery Subsystem <MAILER-DAEMON@HapticThreek>
To: <bism@HapticThreek>
Content-Type: multipart/report; report-type=delivery-status;
        boundary="pB7KiCWp012303.1323290652/HapticThreek"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Status: R

Part 1:

The original message was received at Wed, 7 Dec 2011 20:44:11 GMT
from localhost [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<root@192.168.0.11>
    (reason: 550 Host unknown)

   ----- Transcript of session follows -----
550 5.1.2 <root@192.168.0.11>... Host unknown (Name server: 192.168.0.11: host not found)

Part 2:
Content-Type: message/delivery-status


Part 3:
Content-Type: message/rfc822

From bism@HapticThreek Wed Dec  7 20:44:11 2011
Return-Path: <bism@HapticThreek>
From: bism@HapticThreek
Date: Wed, 07 Dec 2011 20:43:11 +0000
To: root@192.168.0.11
Subject: Test with ip
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
I even tried sending it to root@192.168.0.11 (the internal IP addy) and it still bounced back. Any ideas?
 
Old 12-07-2011, 09:25 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Are you using sendmail? If so, what does your config file look like?
 
Old 12-08-2011, 04:11 AM   #3
HapticThreek
LQ Newbie
 
Registered: Nov 2011
Location: Cambridge, UK
Distribution: Slackware
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
Are you using sendmail? If so, what does your config file look like?
Yeah, I am using sendmail, the config file is huge though, do you want me to paste it all here or just a certain part of it?
 
Old 12-08-2011, 03:43 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Try creating a file /etc/mail/local-host-names containing the details of your machine.
http://www.freebsd.org/doc/handbook/sendmail.html

Last edited by allend; 12-08-2011 at 06:22 PM.
 
Old 12-08-2011, 06:01 PM   #5
HapticThreek
LQ Newbie
 
Registered: Nov 2011
Location: Cambridge, UK
Distribution: Slackware
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
Try creating a file /etc/mail/local_host_names containing the details of your machine.
http://www.freebsd.org/doc/handbook/sendmail.html
Thanks for the suggestion. I added 'test.brambles' to the local-host-names file and restarted the sendmail daemon and went to send an email to it (its the other machine on my network) and it just bounced back once again:
Code:
From MAILER-DAEMON@HapticThreek.brambles  Thu Dec  8 23:59:55 2011
Return-Path: <MAILER-DAEMON@HapticThreek.brambles>
Date: Thu, 8 Dec 2011 23:59:54 GMT
From: Mail Delivery Subsystem <MAILER-DAEMON@HapticThreek.brambles>
To: <bism@HapticThreek.brambles>
Content-Type: multipart/report; report-type=delivery-status;
        boundary="pB8NxsaN003436.1323388794/HapticThreek.brambles"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Status: R

Part 1:

The original message was received at Thu, 8 Dec 2011 23:59:54 GMT
from localhost [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<root@test.brambles>
    (reason: 550 Host unknown)

   ----- Transcript of session follows -----
550 5.1.2 <root@test.brambles>... Host unknown (Name server: test.brambles: host not found)

Part 2:
Content-Type: message/delivery-status


Part 3:
Content-Type: message/rfc822

From bism@HapticThreek.brambles Thu Dec  8 23:59:54 2011
Return-Path: <bism@HapticThreek.brambles>
From: bism@HapticThreek.brambles
Date: Thu, 08 Dec 2011 23:59:54 +0000
To: root@test.brambles
Subject: pleeeeeeease
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii

sdfsd
 
Old 12-08-2011, 06:05 PM   #6
HapticThreek
LQ Newbie
 
Registered: Nov 2011
Location: Cambridge, UK
Distribution: Slackware
Posts: 15

Original Poster
Rep: Reputation: Disabled
Someone told me that if i created a DNS zone on my home network then that would enable nmap to resolve local hostnames, which i'm guessing would help this along the way? no idea how to set up a dns zone though, my /etc/resolv.conf contains the lines
Code:
nameserver 194.168.4.100
nameserver 194.168.8.100
which is taken from my home router.
 
Old 12-08-2011, 06:30 PM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
The local-host-names file needs to contain the name of the server from which you are sending.
Your receiving server will need to be configured to accept mail from external sources.
For a simple setup, it is probably easiest just to add entries to /etc/hosts on both servers, so they can find each other. Include both the local server and the remote server in /etc/hosts.
 
Old 12-08-2011, 07:06 PM   #8
HapticThreek
LQ Newbie
 
Registered: Nov 2011
Location: Cambridge, UK
Distribution: Slackware
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
The local-host-names file needs to contain the name of the server from which you are sending.
Your receiving server will need to be configured to accept mail from external sources.
For a simple setup, it is probably easiest just to add entries to /etc/hosts on both servers, so they can find each other. Include both the local server and the remote server in /etc/hosts.
I did add the names of the machine I'm sending from to the local-host-names file, and I have added both machines to entries on the hosts file. I'm not getting the mail returned instantly now, but nothing is getting through either. :-(
 
Old 12-09-2011, 01:22 AM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by HapticThreek View Post
Yeah, I am using sendmail, the config file is huge though, do you want me to paste it all here or just a certain part of it?
If you modified one of the .mc files found in /usr/share/sendmail/cf/cf to create your sendmail.cf file like you're really supposed to do, the contents of that .mc file should be short enough to post here in its entirety. (The README files in /usr/share/sendmail/cf and /usr/share/sendmail/cf/cf do a pretty fair job of explaining the whole process.)

The last time I messed around with sendmail, I found that easier to do than to deal with the .cf file that looks like modem line noise or an awk script.
 
Old 12-09-2011, 06:27 PM   #10
HapticThreek
LQ Newbie
 
Registered: Nov 2011
Location: Cambridge, UK
Distribution: Slackware
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
If you modified one of the .mc files found in /usr/share/sendmail/cf/cf to create your sendmail.cf file like you're really supposed to do, the contents of that .mc file should be short enough to post here in its entirety. (The README files in /usr/share/sendmail/cf and /usr/share/sendmail/cf/cf do a pretty fair job of explaining the whole process.)

The last time I messed around with sendmail, I found that easier to do than to deal with the .cf file that looks like modem line noise or an awk script.
I haven't edited any of those mc files, wouldn't even know where to begin! Any pointers?
 
Old 12-09-2011, 08:01 PM   #11
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
You have to consider one of the machines as the server, the others as clients

For the clients, there is a special mc file:
/usr/share/sendmail/cf/cf/clientproto.mc

You have to edit it like, say your server will be mail.brambles.com
Code:
cd /usr/share/sendmail/cf/cf/
cp clientproto.mc config.mc
Open "config.mc" with text editor (vi...)
Edit it like:
Code:
OSTYPE(`linux')dnl
DOMAIN(`generic')dnl
FEATURE(`nullclient',`mail.brambles.com')dnl
Then:
Code:
sh Build config.mc
cp config.cf /etc/mail/sendmail.cf
/etc/rc.d/rc.sendmail restart

Last edited by Cedrik; 12-09-2011 at 08:08 PM.
 
Old 12-10-2011, 05:16 AM   #12
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Oops I forget that config above for client works in one way (messages from clients to server)

For setting sendmail for lan and make each machine send and receive, it is even simpler than that

On all machines, do :
Code:
cd /usr/share/sendmail/cf/cf/
cp sendmail-slackware.mc config.mc
sh Build config.mc
cp config.cf /etc/mail/sendmail.cf
/etc/rc.d/rc.sendmail restart
Now on each machine, open xterm (rxvt etc...)
and do
Code:
tail -f /var/log/maillog
then open other xterm and test mail
Code:
mail -s 'subject of message: test' 'youruser@hostname'
Test of message
.
 
1 members found this post helpful.
Old 12-10-2011, 03:46 PM   #13
HapticThreek
LQ Newbie
 
Registered: Nov 2011
Location: Cambridge, UK
Distribution: Slackware
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Cedrik View Post
Oops I forget that config above for client works in one way (messages from clients to server)

For setting sendmail for lan and make each machine send and receive, it is even simpler than that

On all machines, do :
Code:
cd /usr/share/sendmail/cf/cf/
cp sendmail-slackware.mc config.mc
sh Build config.mc
cp config.cf /etc/mail/sendmail.cf
/etc/rc.d/rc.sendmail restart
Now on each machine, open xterm (rxvt etc...)
and do
Code:
tail -f /var/log/maillog
then open other xterm and test mail
Code:
mail -s 'subject of message: test' 'youruser@hostname'
Test of message
.
Thanks for this suggestion, it looked very promising. I followed your instructions but unfortunately mail is still getting bounced back to me. This is what the log says:
Code:
Dec 10 21:44:17 HapticThreek sendmail[10459]: pBALiHe1010459: from=bism, size=219, class=0, nrcpts=1, msgid=<201112102144.pBALiHe1010459@HapticThreek.brambles>, relay=bism@localhost
Dec 10 21:44:17 HapticThreek sm-mta[10460]: pBALiH9e010460: from=<bism@HapticThreek.brambles>, size=470, class=0, nrcpts=1, msgid=<201112102144.pBALiHe1010459@HapticThreek.brambles>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Dec 10 21:44:17 HapticThreek sendmail[10459]: pBALiHe1010459: to=root@test, ctladdr=bism (1000/100), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30219, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (pBALiH9e010460 Message accepted for delivery)
Dec 10 21:44:18 HapticThreek sm-mta[10462]: pBALiH9e010460: to=<root@test.brambles>, ctladdr=<bism@HapticThreek.brambles> (1000/100), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120470, relay=test.brambles, dsn=5.1.2, stat=Host unknown (Name server: test.brambles: host not found)
Dec 10 21:44:18 HapticThreek sm-mta[10462]: pBALiH9e010460: pBALiI9e010462: DSN: Host unknown (Name server: test.brambles: host not found)
Dec 10 21:44:18 HapticThreek sm-mta[10462]: pBALiI9e010462: to=<bism@HapticThreek.brambles>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31689, dsn=2.0.0, stat=Sent
 
Old 12-10-2011, 04:20 PM   #14
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Ok, first thing is create FQDN domain, I think

Say brambles.net ?

I see 'test.brambles' in your log, you used 'test' as hostname ?

For my lan I use a hardware router as DNS server, I think sendmail wants DNS to work correctly

Choose one PC to use as simple dns server, then installpkg dnsmasq in it,
(if it is not installed, check: ls /var/log/packages/dnsmasq*)

let's say you choose the 'test' named PC for the name server and its ip is 192.168.0.11

in 'test', make sure /etc/hosts looks like:
Code:
# For loopbacking.
127.0.0.1               localhost
192.168.0.11            test.brambles.net test
192.168.0.12            HapticThreek.brambles.net HapticThreek

# End of hosts.
start dnsmasq
Code:
chmod +x /etc/rc.d/rc.dnsmasq
/etc/rc.d/rc.dnsmasq start
In the other PC, say its name is 'HapticThreek' and its ip is 192.168.0.12

make sure /etc/hosts looks like:
Code:
# For loopbacking.
127.0.0.1               localhost
192.168.0.12            HapticThreek.brambles.net HapticThreek

# End of hosts.
and /etc/resolv.conf:
Code:
search brambles.net
nameserver 192.168.0.11
(you can add more nameserver lines if you want)

Last edited by Cedrik; 12-10-2011 at 04:23 PM.
 
  


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
Sending internal mail is intermittent danielgk Linux - Networking 1 03-23-2011 05:48 PM
Internal Network Mail System SBN Linux - General 4 01-27-2008 09:32 PM
Accessing mail server from internal network yantor Linux - Networking 2 09-22-2006 05:17 AM
sending mail directly to another machine on the local network? lmcilwain Fedora 3 06-27-2006 01:48 PM
Probs whille sending mail to any other commercial network ssilayaraja Linux - Networking 4 04-19-2006 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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