LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 11-20-2012, 09:54 AM   #1
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Rep: Reputation: 15
Basic postfix configuration


Hello good genlemen,
Im trying to setup a very basic postfix mailserver with a minimal configuration. I have 2 RHEL6 hosts have been set up in virtualbox whos hostnames are "box1.mydomain.rock" and "box2.mydomain.rock". Postfix server is installed on box1.X, selinux/firewalls disabled. In box2.X again postfix is installed with no configuration changes. Mails are getting bounced when I try to send a mail to a user in box1(mail server itself) from box1. following are the details.

NOTE: I dont have a local dns server configured therefore I manipulate the /etc/hosts file.

---this is the server main.cf
Code:
myhostname = box1.mydomain.rock
mydomain = mydomain.rock
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks = 192.168.1.0/24, 127.0.0.0/8

/etc/hosts file of box1(mail server)

Code:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.68 box1 box1.mydomain.rock      #mail server
192.168.1.70 box2 box2.mydomain.rock      #the client box that im sending the mail from

----/etc/hosts file of box2(the machine the mail is being sent)

Code:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.68 box1 box1.mydomain.rock
192.168.1.70 box2 box2.mydomain.rock

---mail log of box2( the client that is trying to send the mail to vimuth@box1.mydomain.rock
Code:
Nov 20 08:14:34 box2 postfix/pickup[2551]: 17D8F9D86: uid=0 from=<root>
Nov 20 08:14:34 box2 postfix/cleanup[2562]: 17D8F9D86: message-id=<20121120024434.GA2556@box2.mydomain.rock>
Nov 20 08:14:34 box2 postfix/qmgr[2552]: 17D8F9D86: from=<root@box2.mydomain.rock>, size=426, nrcpt=1 (queue active)
Nov 20 08:14:34 box2 postfix/smtp[2564]: 17D8F9D86: to=<vimuth@box1.mydomain.rock>, relay=none, delay=0.11, delays=0.03/0.01/0.07/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=box1.mydomain.rock type=AAAA: Host not found)
Nov 20 08:14:34 box2 postfix/cleanup[2562]: 31C779FCD: message-id=<20121120024434.31C779FCD@box2.mydomain.rock>
Nov 20 08:14:34 box2 postfix/qmgr[2552]: 31C779FCD: from=<>, size=2358, nrcpt=1 (queue active)
Nov 20 08:14:34 box2 postfix/bounce[2565]: 17D8F9D86: sender non-delivery notification: 31C779FCD
Nov 20 08:14:34 box2 postfix/qmgr[2552]: 17D8F9D86: removed
Nov 20 08:14:34 box2 postfix/local[2566]: 31C779FCD: to=<root@box2.mydomain.rock>, relay=local, delay=0.02, delays=0/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Please good people I need to figure this out before this Friday before I sit for the RHCE exam.

/V
 
Old 11-20-2012, 01:37 PM   #2
lrtward
Member
 
Registered: Feb 2011
Distribution: CentOS, Ubuntu
Posts: 97

Rep: Reputation: 9
Host or domain name not found. Name service error for name=box1.mydomain.rock

When you are logged into box2, and you do
Code:
dig -t mx box1.mydomain.rock
What is the result?
 
Old 11-23-2012, 04:38 AM   #3
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
Postfix, by default, will not work nicely with /etc/hosts defined hosts. You need to force it to stop trying DNS lookups, see disable_dns_lookups directive.
 
1 members found this post helpful.
Old 12-31-2012, 10:42 PM   #4
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Original Poster
Rep: Reputation: 15
thank you all and I managed to get this done. As per Mr r0's comments I set up a local dns server and put in a mx record and that solved my my problem. Thanks a lot.
 
  


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
CentOS postfix basic email configuration swanny99 Linux - Server 6 07-20-2012 02:11 PM
Basic postfix configuration problem Vimuth Linux - Server 1 12-01-2009 12:26 AM
Basic Postfix Configuration? JoeBleaux Linux - Server 5 05-28-2009 05:21 AM
Postfix Configuration Question: Postfix server as a catch-all on office LAN enso491 Linux - Server 5 04-14-2008 04:35 PM
Postfix basic configuration Swift&Smart Linux - Software 21 09-05-2004 05:38 PM

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

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