LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-29-2003, 10:20 PM   #1
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 47
need Postfix help before i lose it


i have been configuring and googling and searching and reading for 2 days, and i can't get postfix to work correctly. i am clueless about something obviously, but i can't figure out what i'm doing wrong.

right now, users can send and receive mail to each other on each host, but not to users on other hosts in the local domain (it just "disappears" -- has me suspicious, but at least it's not bouncing anymore ). users can also send mail to the web, but not to my mail account from my ISP (that bounces, saying user@mydomain.net doesn't exist). wtf? i am totally confused.

here's what i can remember of my configuration (i just can't face that main.cf file again right now ) - it's the same on each PC (except for the hostname obviously):

myhostname = thehost.thedomain.net
mydomain = thedomain.net
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, $mydomain
mynetworks = 192.168.0.0/24, 192.168.xxx.xxx, 192.168.xxx.xxx, 192.168.xxx.xxx, [i.e., the actual IPs], 127.0.0.0/8

and the rest i think is pretty much default. i didn't set a relay host b/c i'm not sure what to do there. i just don't get why users on one machine can't send to users on the other, or how i can keep my local network hostnames and domain and still send/receive mail through the ISP. does the ISP need to be a relay host or be added to the networks line? am i missing something to do with the router? do i need to set up aliases or something? help appreciated.
 
Old 12-01-2003, 11:35 AM   #2
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
anyone??? help?
 
Old 12-01-2003, 04:04 PM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Hmmm...

Post up the result of:
postconf -n (been a while, my appology if that is incorrect)
This should show you the settings for your main.cf that we are interested in. You relay for the domains you host. Mail "vanishing" is always a hard one to pin down. Rejection notices and errors are always much better. Here's one way to give you some ideas on where to start:
Open up an xterm, and tail your log:
tail -f /var/log/messages (or whever your logs are being sent, this depends on your distro usually)
Then, fire up your mail client, and send an email, seperated by ~10 minutes to each location that you are having problems with. Then, send an email to the location that you are not having problems with, and compare the logs from each occurance.

Cool
 
Old 12-01-2003, 06:24 PM   #4
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
okay, here's postconf -n for host "moe" (user on moe is jeff, user on host "homer" is sero):

moe root # postconf -n
alias_database = hash:/etc/mail/aliases
alias_maps = hash:/etc/mail/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 10
home_mailbox = .maildir/
inet_interfaces = all
local_destination_concurrency_limit = 2
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, $mydomain
mydomain = thedomain.net
myhostname = moe.thedomain.net
mynetworks = 192.168.xxx.xxx, 192.168.xxx.xx1, 192.168.xxx.xx2, 192.168.xxx.xx4, 192.168.0.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.0.11
relay_domains = $mydestination
relayhost = thedomain.net
sample_directory = /etc/postfix/sample
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 550


with the relay set, the mail disappears. when the relay is not set, the mail disappears when addressed to "sero@thedomain.net," but i get this message when i send to "sero@homer.thedomain.net." i'll just leave it at that for this post, and post the tail of the log in a minute. thx

Return-Path: <>
X-Original-To: jeff@thedomain.net
Delivered-To: jeff@thedomain.net
Received: by moe.thedomain.net (Postfix)
id 8A5967403; Mon, 1 Dec 2003 18:09:14 -0500 (EST)
Date: Mon, 1 Dec 2003 18:09:14 -0500 (EST)
From: Mail Delivery System <MAILER-DAEMON@thedomain.net>
Subject: Undelivered Mail Returned to Sender
To: jeff@thedomain.net
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="3AF207405.1070320154/moe.thedomain.net"
Message-Id: <20031201230914.8A5967403@moe.thedomain.net>

[-- Attachment #1: Notification --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.5K --]

This is the Postfix program at host moe.thedomain.net.

I'm sorry to have to inform you that the message returned
below could not be delivered to one or more destinations.

<sero@homer.thedomain.net>: Name service error for
+name=homer.thedomain.net
type=A: Host not found

[-- Attachment #2: Delivery error report --]
[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]

Reporting-MTA: dns; moe.thedomain.net
Arrival-Date: Mon, 1 Dec 2003 18:09:14 -0500 (EST)

Final-Recipient: rfc822; sero@homer.thedomain.net
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; Name service error for
+name=homer.thedomain.net
- - 1/1: Mail Delivery System Undelivered Mail Returned to Se -- (72%)
type=A: Host not found

[-- Attachment #3: Undelivered Message --]
[-- Type: message/rfc822, Encoding: 7bit, Size: 0.4K --]

Received: by moe.thedomain.net (Postfix, from userid 1000)
id 3AF207405; Mon, 1 Dec 2003 18:09:14 -0500 (EST)
Date: Mon, 1 Dec 2003 18:09:14 -0500
From: jeff@moe.thedomain.net
To: sero@homer.thedomain.net
Subject: testing from jeff, full hostname
Message-ID: <20031201230914.GA17984@moe.thedomain.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.4i

testing
 
Old 12-01-2003, 06:43 PM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Here's something out of the blue while we wait for someone who knows to chime in:
Are the other hosts setup correctly (their private IP's) in /etc/hosts ?

Also, the thing that slightly confuses/bothers me is the fact that you cannot send messages to your email address at your ISP, however you can send them to other email addresses outside your WAN...

Emailing within your network, to different hosts(boxes) is usually DNS'd by your hosts file (IIRC), that's why I'm wondering if that's all peachy.

Cool
 
Old 12-01-2003, 06:50 PM   #6
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
here's my /etc/hosts file on the homer host:

# For loopbacking.
127.0.0.1 localhost
127.0.0.1 homer.thedomain.net homer

192.168.xxx.xx0 bart
192.168.xxx.xx2 homer
192.168.xxx.xx4 moe

bart is my laptop (win98se) and is out of the loop for now. if i can't even get this going on linux, i don't want to mess with windoze. i'll figure that out later.

yeah, the ISP (road runner) thing is weird, and i don't know what to make of it. possibly they are blocking "unknown" addresses for anti-spam reasons? whereas anything sent through them but not to them is passed along?

appreciate.
 
Old 12-01-2003, 07:26 PM   #7
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
How are you addressing the emails to each host?
user@moe
user@homer
OR
user@homer.thedomain.com
user@moe.thedomain.com

Cool
 
Old 12-01-2003, 07:36 PM   #8
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
user@homer (or user@moe): bounces
user@thedomain.net: disappears
user@host.thedomain.net: disappears correction: that bounces



you might be too late -- i think i AM losing it!

----
BTW, how should it be addressed? or shouldn't it matter?

Last edited by synaptical; 12-01-2003 at 08:12 PM.
 
Old 12-01-2003, 10:39 PM   #9
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
okay, fixed the local sending on same host by changing the resolv.conf from nameserver <IP> to search thedomain.net. that's in there along with search my.ISP.com.

still can't send between hosts, though -- and now i can't send to the internet, either. argh, i must be doing something really dumb.
 
Old 12-02-2003, 03:37 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
So are you running your own DNS then as well? Or are you normally just using your ISP's?

And, I'm sure you know, but after making any changes to postfix:
postfix reload (unless this is on Gentoo, and was emerged then of course:
/etc/init.d/postfix restart ). I'm pluggin away at this site, which seems VERY in depth, and about to fall asleep, feel free to paruse yourself, maybe the answer is there. Otherwise, I'll check back tomorrow and continue reading and see if I can help any more.

Good Luck, and I don't know if this was covered, but if it's a postfix problem, I'd wager it somewhere in mydestination and/or relay_domains (or possibly relayhost???) directives.

Cool

Last edited by MasterC; 12-02-2003 at 03:38 AM.
 
Old 12-02-2003, 12:10 PM   #11
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
Quote:
Originally posted by MasterC
So are you running your own DNS then as well? Or are you normally just using your ISP's?
i don't understand your question, so i'm starting to think i have a fundamental misunderstanding of how all this works. my resolv.conf was:

nameserver 192.168.0.1
search my.ISP.com

and that was working fine for internet, samba, print sharing, mail through ISP, etc. i guess the router assigns IPs, is that right? those number assignments always seemed to be the same (based on the physical port, i assumed), so to make things easier with samba, ssh, etc. i just added them to the /etc/hosts file on my 2 linux machines, along with a name for each one. does just doing that that make me a DNS?

anyway, trying to get mail to work, i changed "nameserver 192.168.0.1" in my slack box to "search mydomain.net," and that allowed mailing using just the username (or any variation of just user, hostname, domain, or FQDN). but i still can't mail between computers, or now to the internet. i guess i'll keep plugging away at it. i assume i'm doing something wrong not having to do with postfix specifically, but with some other setting somewhere (edit: actually, i take that back, i don't assume that at all - it might be postfix). i'll just have to figure out where the glitch is -- probably something really basic that i have overlooked b/c of the gaps in my networking knowledge.

the ironic thing is that when i first installed linux a few months ago, and literally knew *nothing* about it, i set up sendmail on red hat and got it to work with the ISP in about half an hour, sending to the internet, etc. i just couldn't figure out how to collect my mail, so i disabled it, being worried about security, also. mostly i just did it as an experiment. now 4 or 5 months later and having set up samba, ssh, and iptables next, i can't get simple postfix to work. argh!

Last edited by synaptical; 12-02-2003 at 12:18 PM.
 
Old 12-02-2003, 01:42 PM   #12
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64


It's possible that I'm wrong here, but do you obtain an IP from your ISP via DHCP? If so, then, here's my understanding:
In comes the IP to the router (what router btw?) it stores the IP, and assigns local/private IP's to the local machines (either via DHCP itself, or you set static IP's which is what you should be doing on servers). However, the DNS information (/etc/resolv.conf) should be populated with your ISP's DNS server information. Something like the following:
Code:
nameserver 4.3.2.1
nameserver 4.2.55.3
search dsl-verizon.net
That's similar to my old setup, and is easy for me to remember Anyway, the nameserver entries should be actual IP's of your ISP's nameservers (these are normally obtained via DHCP, so you may either want to, just once, either call your ISP and ask em what the nameserver IP's are, OR (what I do) directly connect 1 box, set it up for DHCP, obtain the info, write it down, disconnect it directly, hook it back up to the router, and now, on each box, supply the nameserver information in /etc/resolv.conf accordingly) and the search should be, well whatever is provided by your ISP (if anything).

Now, just to re-iterrate, be sure to have the Private IP's be static IP's, outside the range of IP's that are dynamically (DHCP) assigned by your router. For example, I have my router setup to assign IP's via DHCP in the range of 192.168.1.100-192.168.1.254 So I set my static IP's below the .100 mark, well below to easily decipher the difference from the IP's.
Because you are going to have static private IP's at the boxes, you will need to be certain you have the correct DNS info in /etc/resolv.conf because it will not be updated each time they talk to the router (no DHCP), hence the work mentioned above. Once you get it all sussed, you may have yourself a working network, at that point, you will certainly want to look at your port forwarding in your router's setup. Forward port 25 to the main "mail server" box, this should be a static IP (which if it's not apparent yet: You need static IP's with servers so the traffic can consistently go to the same location).



Once you get this all sussed, restart postfix, and ping somebody to see that everything is working properly. Then try to send yourself some email.

Cool
 
Old 12-02-2003, 02:23 PM   #13
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
oh! i thought the nameserver should be the *router* address, and the individual IPs assigned by the router should be whatever number the router assigned to each machine. so for example, if the router (192.168.0.1) assigns machine 1 an IP of 192.168.0.100, then that was the machine's IP, and i could then assign a name to that and everything was hunky dory behind the router.

but if i understand what you are saying, i should re-assign an IP to machine 1 that is *not the same* as what the router provides, and then just make sure my router is set up to handle that since it won't be assigning through DHCP anymore. since i believe my router (d-link 604, btw) is now set up to provide from 192.168.0.100-200, i should assign something like 192.168.0.2-99, or maybe 192.168.100.100-xxx, etc.

and yes, i obtain an IP from my ISP, the number of which i never messed around with b/c i thought once it got to the router, everything was taken over from there through the 192.168.etc scheme. so now i believe you are saying i have to find the server from which that number is coming and put that IP in the resolv.conf along with the "search my.ISP.com" line.

very much appreciate your detailed explanation. let me make some changes -- probably won't get to it until early this evening -- and i'll post an update when i test things out and hopefully get it going. thx!
 
Old 12-02-2003, 02:39 PM   #14
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
You're welcome, let me clarify some of that:
Your assigned IP is not what goes in resolv.conf Instead, that's where your DNS server's IP's go. Your DNS servers IP's are assigned ALSO via DHCP from your ISP. These are automatically obtained and stored during bootup/negotiation with your ISP. Since your router is obtaining the DHCP information from your ISP (that's called your WAN) your local machines don't have the luxury of obtaining that information as well. So instead, you have to manually enter the information in /etc/resolv.conf for your ISP's DNS servers. To get this information, you connect 1 box directly to your DSL/cable modem and obtain the DHCP information (the IP is irrelevant for the time being, we are after the DNS info for now) for the DNS's. In order for this to happen successfully though, on the box you hook up you will need to enable DHCP and disable any static IP assignments. If this is slackware:
in /etc/rc.d/rc.inet1 you will comment every line except "USE DHCP=yes"
If this is Gentoo, you will:
edit /etc/conf.d/net
And comment all lines except:
iface_eth0="dhcp"

Then, once you have the information, write it down, and now go back, comment the DHCP lines, and uncomment the static assignment for IP and gateway. I have gentoo pulled up right now on putty, here's what it might look like when you are ready to assign static IP:
Code:
# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth0="192.168.1.25 broadcast 192.168.1.255 netmask 255.255.255.0"
#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
#iface_eth0="dhcp"
#dhcpcd_eth0="..."

# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly.  Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"


# For setting the default gateway
#
gateway="eth0/192.168.1.1"
Remember, that's just an example, your gateway is actually 192.168.0.1

Ok, moving on...

Assigning static IPs:
You will want to assign IP's lower than your range usually. So, your range is 100-200, so something like: 192.168.0.25 would be appropriate. Then, forwarding to that IP should work much better

Your router doesn't assign the static IP, instead during bootup IP negotiation your box will tell your router it's IP and your router will "remember" that (for port forwarding).

If you have any more questions or aren't sure about something I've said wrt setting up your network, post back

Cool
 
Old 12-06-2003, 01:04 PM   #15
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Original Poster
Rep: Reputation: 47
hey there MasterC - - i didn't jump ship i just got super busy last week and couldn't get back to this. i've got to deal with some snow this weekend, but i'll try your suggestions asap and post back if i have any problems. just wanted to thank you for the help.
 
  


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 send mail problem(In RH9, kernal 2.4.20, postfix 2.1.5) minor Linux - General 4 07-11-2005 10:12 PM
lose partitionmagic noel General 2 08-12-2004 07:58 PM
Anyone else lose sound? BajaNick Slackware 4 06-17-2004 01:41 AM
looks like the Lakers will lose this one jaz General 2 06-14-2004 03:35 PM
I'M ABOUT TO LOSE IT HERE....HELP! noel Linux - Software 7 04-21-2001 12:59 PM


All times are GMT -5. The time now is 04:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration