From owner-freebsd-questions@FreeBSD.ORG Sat Apr 14 01:48:26 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 458341065675 for ; Sat, 14 Apr 2012 01:48:26 +0000 (UTC) (envelope-from rg.lists@rzweb.com) Received: from flabnapple.net (flabnapple.net [216.129.104.99]) by mx1.freebsd.org (Postfix) with ESMTP id 304678FC16 for ; Sat, 14 Apr 2012 01:48:26 +0000 (UTC) Received: from mail.flabnapple.net (localhost [127.0.0.1]) by flabnapple.net (Postfix) with ESMTP id 060D91CC06D; Fri, 13 Apr 2012 18:48:20 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 13 Apr 2012 18:48:19 -0700 From: Ron To: Robert Bonomi In-Reply-To: <201204122054.q3CKskOY027605@mail.r-bonomi.com> References: <201204122054.q3CKskOY027605@mail.r-bonomi.com> Message-ID: <3a1ed3098e19fe0e93c8f3e47dc4f01b@flabnapple2.net> X-Sender: rg.lists@rzweb.com User-Agent: RoundCube Webmail/0.7 Cc: freebsd-questions@freebsd.org Subject: Re: Postfix + Courier IMAP local email problems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 01:48:26 -0000 On 12.04.2012 13:54, Robert Bonomi wrote: >> From owner-freebsd-questions@freebsd.org Thu Apr 12 15:09:43 2012 >> Date: Thu, 12 Apr 2012 13:01:10 -0700 >> From: Ron >> To: >> Subject: Postfix + Courier IMAP local email problems >> >> I'm having a couple of issues with postfix and courier-imap on my >> new >> machine and I'm trying to figure out what is different from my old >> machine. I've checked every config file I think of and they both >> seem >> to be set up the same. >> >> Here are the two issues: >> >> If I send email from a local user (while SSH'd in using the command >> line mail) to another local user (mail todd@mysite.com) on the same >> machine, but using the full email address, I get the following error >> and >> the email bounced back: >> >> 553 5.3.5 mail.mysite.com. config error: mail loops back to me (MX >> problem?) >> 554 5.3.5 Local configuration error > > this is a 'well known' problem. >> >> The only thing I can think of is that mysite.com and mail.mysite.com >> (the mx record) do not point to the same server (which they did on >> my >> old machine). > > it's not that sample. > >> I have also tried everything I can think of in how >> users >> are listed in postfix's virtual file and in /etc/aliases and server >> entries in main.cf. > > The problem is that the 'local' machine DOES NOT KNOW that it is > supposed > to accept mail for the domain specified in the email addressz. > > The server looks at the address, determines that it is *NOT* local, > by whatever means 'postfix' uses to make that determination (it's the > 'w' class in Sendmail), and goes off to query DNS for the MX for the > 'remote' machine to send mail to. DNS returns "this" (the one asking > for > the 'remote' machine name) machine as the destination to deliver to. > the local server =knows= that is incorrect, because it is not the > delivery > point for that domain. hence the error message, and 'return to > sender' > as undeliverable. > > This _is_ a configuration error in (probably) the local mailserver, > or in > the way the local hostname/domainname are set up.. > >> The second issue is if (again, SSH'd in an using mail) I send email >> to >> a local user without the @mysite.com (mail todd) then the email >> isn't >> available via IMAP externally. I can read it using the command line >> mail, but not externally via IMAP. These two mailboxs are >> completely >> separate and have two different lists of waiting email. > > This is an 'inconsistency' in the way 'locally' generated mail is > being > handled, and the way externally generated mail is being handled. > > *PROBABLY* because -one- mail server program is being started at boot > time, and a _different_ program is being invoked when somebody sends > locally from the command-line. > > Chasing this down can be a b*tch. "Everything and it's cousins" has > the > executable name 'sendmail' hard-coded into it for sending outgoing > mail. > Sometimes the original 'sendmail' is replaced by a different > executable > 'of the same name', that is really 'postfix', 'exim', 'qmail', or the > dreaded 'something else'. Sometimes 'sendmail' is a "switching" > program > that determings -- by some arbitrary means (typically a configurtion > file, > stored 'somewhere')-- _which_ of many alternatives to call. > > Now _if_ the mailer started at boot time is *explicitly* named as > something > _other_ than "sendmail", and is -not- what you get when you invoke > the name > 'sendmail', you have "obvious" potential for dissimilar behavior. > this > is _probably_ what is going on in your case. "Local" command-line > mail > is being delivered to an 'mbox' type mailbox, while 'remote' mail is > being delivered to 'something different' -- I think recent versios of > IMAP use a database-type struture rather than a simple 'mbox'. >> >> Everything works fine if I send email from a remote client >> (Thunderbird, Mail.app) and read the email with a remote client via >> IMAP. It's just the local email sending that seems to be broken. >> I'd >> like to get one of these two problems fixed so root can email me >> daily >> log files, which it can't do right now or I can't read via IMAP >> because >> they are't going to the right mailbox. >> >> Is there some simple I'm just messing up? > > "Yes." > > The difficulty comes in identifying _which_ "simple thing" it is that > is > messed up. OK, I found the problem. It was the hostname not being set correctly. What threw me was that it was correct in the rc.conf file, but I did not know you needed to reboot the machine to have it take effect. It just never occurred to me to run 'hostname' and see since I was seeing it correctly in the rc.conf. Thanks for the help. Ron