LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2005, 03:41 PM   #1
smurfix
Newbie
 
Registered: Aug 2002
Distribution: Debian, RH, ubuntu
Posts: 22

Rep: Reputation: 15
postfix relay problem


Hi,

I've installed debian woody running as my web server and I've just installed Postfix to act as the mail server. I'm having problems sending and receiving mail from within my mail client Thunderbird. I am using an external SMTP server at the minute to send mail and get:

<<< 554 <me@mydomain.org>: Relay access denied
554 5.0.0 <me@mydomain.org>... Service unavailable

My main.cf looks like this:
# see /usr/share/postfix/main.cf.dist for a commented, fuller
# version of this file.

# Do not change these directory settings - they are critical to Postfix
# operation.
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
setgid_group = postdrop
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no
myhostname = lobo
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, $mydomain, mail.$mydomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
mail_owner = postfix

Has anyone got any ideas please.

Thanks

Steve
 
Old 02-09-2005, 05:28 PM   #2
Linux_in_NH
Member
 
Registered: Jan 2004
Location: NH
Distribution: Mandrake, Geentoo, Ubuntu
Posts: 105

Rep: Reputation: 15
is $mydomain properly defined?

try adding the ip range of you system to
mynetworks = 127.0.0.0/8
otherwise you are limited to connections to localhost
 
Old 02-17-2005, 12:19 PM   #3
smurfix
Newbie
 
Registered: Aug 2002
Distribution: Debian, RH, ubuntu
Posts: 22

Original Poster
Rep: Reputation: 15
that's sorted it ... thanks very much.

I'm still having a few problems with DNS though. I can send and receive mail to and from me@mydomain.com but that is because I have the pop and smtp servers set to my internal IP address. Has anyone got any pointers to getting the DNS piece sorted. Links to detailed HowTos or FAQs or a detailed explanation here for a struggling newbie will be much appreciated !!

Cheers
 
Old 02-17-2005, 01:23 PM   #4
Linux_in_NH
Member
 
Registered: Jan 2004
Location: NH
Distribution: Mandrake, Geentoo, Ubuntu
Posts: 105

Rep: Reputation: 15
like this?

http://www.tldp.org/HOWTO/DNS-HOWTO.html
 
Old 02-17-2005, 02:33 PM   #5
smurfix
Newbie
 
Registered: Aug 2002
Distribution: Debian, RH, ubuntu
Posts: 22

Original Poster
Rep: Reputation: 15
I'm not sure if I'm asking the right question here ....

My broadband router is allowing NAT which is also my DNS server, so I don't really need to set my mail server up as a DNS server. My domain is pointing to my IP address fine. I am able to e-mail from a totally different e-mail account, which is outside of my network, and I receive that mail when the pop server is set to 192.168.4.10.

I suspect there are some simple config files settings that will allow me to use my router as it's primary DNS server.

I'm really having trouble understanding how this setup will resolve DNS.

Any other ideas ?

Thanks
 
Old 02-17-2005, 02:33 PM   #6
newtommy
Member
 
Registered: Feb 2005
Location: Baltimore, Maryland
Distribution: SuSE 9.2 Professional
Posts: 38

Rep: Reputation: 15
Hi there,

the howto above is definitely a great reference, and thorough too. I put together my own (small) DNS about a month ago and documented it as simply as I could, (I'm trying to do this for everything I set up)

it just walks through the very minimum of steps i took to get my own DNS up and running from a fresh SuSE installation. If you want to take a look (I can't promise its perfect) its written from a newbie (my) point of view. You can read it here:

http://www.bostonst.com/cgi-bin/Linu...num=1107228844

If you look, let me know if you find mistakes! thanks. Good luck getting everything up and running

Best Regards,
Tommy
 
Old 02-17-2005, 02:39 PM   #7
newtommy
Member
 
Registered: Feb 2005
Location: Baltimore, Maryland
Distribution: SuSE 9.2 Professional
Posts: 38

Rep: Reputation: 15
Just reading your most recent post

If i understand you correctly - you are not receiving email from the outside world on your new email server is that correct? Not sure I understand correctly what you're asking? If that's the case I think its likely you need to run named and set up an MX 10 record to indicate the location of your mailserver to the outside world? Do I mis-understand?

Thanks,
Tommy
 
Old 02-17-2005, 02:45 PM   #8
smurfix
Newbie
 
Registered: Aug 2002
Distribution: Debian, RH, ubuntu
Posts: 22

Original Poster
Rep: Reputation: 15
Tommy,

not quite ... I do receive mail if sent to my e-mail address me@mydomain.org. But at the moment the pop server within my e-mail client, Thunderbird, is set to 192.168.4.10. So mail is getting all the way through from outside of my domain. But, if I set the pop server name to mail.mydomain.org instead of 192.168.4.10, I get nada, nothing.

Like the HowTo ! It's making sense .. I don't have a named running anywhere or a named.conf or /var/lib/named directory. I feel as though I am missing something. I'm running Debian Woody with apt-get available if that is any help.

Thanks

Steve
 
Old 02-17-2005, 02:51 PM   #9
newtommy
Member
 
Registered: Feb 2005
Location: Baltimore, Maryland
Distribution: SuSE 9.2 Professional
Posts: 38

Rep: Reputation: 15
Oh, ok I see

So one more question -- is your mail client running on the same machine as your server?


If so the answer is easy

edit /etc/hosts
add the line

192.168.x.x mail.mydomain.com (where x.x is you local ip)

that should fix it
if it doesn't check

/etc/nsswitch.conf and make sure the line for hosts reads:

hosts: files dns



Tommy
 
Old 02-17-2005, 03:02 PM   #10
smurfix
Newbie
 
Registered: Aug 2002
Distribution: Debian, RH, ubuntu
Posts: 22

Original Poster
Rep: Reputation: 15
I am running 3 machines .. the webserver/e-mail server/192.168.4.10 is separate from my other 2 PCs. It is running Debian and my other 2 PCs are running XP [ssshhh].

I've tried what you have suggested but I get this error when I start postfix

warning: /var/spool/postfix/etc/hosts and /etc/hosts differ

I've amended them both but still get the error, so I think there might be something wrong here.

I've checked /etc/nsswitch.conf and it does have the line :

hosts: files dns

Any more clues ?

Thanks
Steve
 
Old 02-17-2005, 03:14 PM   #11
newtommy
Member
 
Registered: Feb 2005
Location: Baltimore, Maryland
Distribution: SuSE 9.2 Professional
Posts: 38

Rep: Reputation: 15
Ok,

Keeping in mind I'm new to this also (anyone feel free to jump in here). What I was doing with the /etc/hosts file was essentially telling your linux box that it is named "mail.domain.com". Since you're using other machines on your network I don't think the quick and dirty hosts file modification is going to do the trick. You can keep 192.168.4.10 as your mailserver if you want to -- (and it works right?)

but if you want your internal network to be able to resolve 192.168.4.10 as mail.domain.net I think you're going to have to set up a small dns. The reason why you can't find "named" or any of the directories i mentioned earlier i think is likely because you don't have BIND installed on your host machine. the BIND package comes with the DNS server (named) which you'll have to run and configure to do this (per my earlier post).

Since I'm not really knowledgable on Debian (I use RPM's on SuSE) I can't give you good instructions on how to install BIND.... but I think you can find them here:

http://www.debian.org/doc/manuals/ne...r/ch-bind.html

So simply put - get BIND installed, configure named, and start the named server. That's the 3 things you need to do (i think). Anyone else feel free to contradict me!

Thanks,
Tommy
 
Old 02-17-2005, 03:20 PM   #12
smurfix
Newbie
 
Registered: Aug 2002
Distribution: Debian, RH, ubuntu
Posts: 22

Original Poster
Rep: Reputation: 15
Tommy,

I've found this link:

http://www.falkotimme.com/howtos/deb...root/index.php

which I think will help me install BIND and configure named.conf

Thanks for your help ! I'll let you know how I get on.

Steve
 
Old 02-17-2005, 03:24 PM   #13
newtommy
Member
 
Registered: Feb 2005
Location: Baltimore, Maryland
Distribution: SuSE 9.2 Professional
Posts: 38

Rep: Reputation: 15
Yeah,

looking at that page - it should get BIND installed and started --- remember you still have to configure named with your information (ie. add a forward and reverse lookup database)

Good luck with it! Let me know how it goes.

Tommy
 
Old 02-17-2005, 04:06 PM   #14
smurfix
Newbie
 
Registered: Aug 2002
Distribution: Debian, RH, ubuntu
Posts: 22

Original Poster
Rep: Reputation: 15
OK .. done all of that ... as per this HowTo: http://www.falkotimme.com/howtos/de...hroot/index.php

everything seemed to restart OK ... I am getting the mail into my server and it is sitting in /var/mail/steve ... but it still seems to be the same as before ..

If I set my pop server to 192.168.4.10 it comes through ... but when it is set to mail.mydomain.org it just sits there until I go back to 192.168.4.10.

I can feel it's just a short step away ! ;-)

Anymore help will be gratefully received - just a shame I can't offer a beer as thanks !

Steve
 
Old 02-17-2005, 07:10 PM   #15
newtommy
Member
 
Registered: Feb 2005
Location: Baltimore, Maryland
Distribution: SuSE 9.2 Professional
Posts: 38

Rep: Reputation: 15
Lol - yeah and I could use one too!

So sounds like you have BIND installed which is good. You're getting there quickly. There are some more steps for you to complete to get everything working properly.

First - check to make sure that your installation is working and your booted up running the DNS server 'named'
to do so type the following in your shell:

ps -C named

Its should spit out what process named is running -- this is good and means it is running. if it comes back blank or without mentioning named then you don't have your named server running. If this is the case (named is not running) stop here and try to start it. In SuSE 9.2 the command is 'rcnamed start' which spits out some-on screen text confirming that named did begin. Reading through the article you installed from - you may have to type: '/etc/init.d/bind9 start' which should do the same thing. then do another 'ps -C named' and see if its running

Assuming you've got it going now you need to configure to your network entries. Right now, you see, your DNS is only running a 'cache' server which doesn't help you alot (it mirrors whats already out there on the internet). So you have to ADD your own records to make named work for you. So what do you do:

create a forward lookup database
create a rev lookup database
edit named.conf to refer to these databases (create your zones) which hold the name -- ip address information for your network

to do this follow step #2 at this site here. if the directory /var/lib/named doesn't exist go ahead and create it.

http://www.bostonst.com/cgi-bin/Linu...num=1107228844

if you things don't quite make sense just write back and I'll do my best to explain better.

Tommy.
 
  


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
[postfix] allow relay from 1 ip narmida Linux - Software 3 12-01-2005 12:20 PM
Postfix as a mail relay (getting relay access denied) hypexr Linux - Software 3 09-13-2005 07:15 PM
Postfix Relay Problem kubicon Linux - Networking 3 06-11-2004 06:41 PM
postfix relay problem sopiaz57 Linux - General 0 03-03-2004 10:25 AM
Postfix relay problem txtoolman Linux - Software 0 12-16-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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