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 :p). 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. :scratch: here's what i can remember of my configuration (i just can't face that main.cf file again right now :p ) - 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? :confused: help appreciated. |
anyone??? help?
|
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 |
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 |
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 |
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. :p 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. :) |
How are you addressing the emails to each host?
user@moe user@homer OR user@homer.thedomain.com user@moe.thedomain.com Cool |
user@homer (or user@moe): bounces
user@thedomain.net: disappears user@host.thedomain.net: disappears correction: that bounces :p you might be too late -- i think i AM losing it! :p ---- BTW, how should it be addressed? or shouldn't it matter? |
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. :p |
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 |
Quote:
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? :confused: 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, :D 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. :p 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! :p |
:D
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 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 |
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. :D
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. :D 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! :) |
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 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 |
hey there MasterC - - i didn't jump ship :D i just got super busy last week and couldn't get back to this. i've got to deal with some snow this weekend, :eek: but i'll try your suggestions asap and post back if i have any problems. just wanted to thank you for the help. :)
|
All times are GMT -5. The time now is 03:36 PM. |