postfix issue

http://www.virtualmin.com/forums/virtualmin/postfix-issue.html

i think i posted that one in the wrong section

Hmm, what do you mean by "changes incoming emails to name@localhost"?

What is changed specifically, and what are you using to to view that? Are you using Usermin? Outlook?

Do you think you could post the full headers from an email where this occurs?

Thanks,
-Eric

for example ive got an email mbcis@mbcis.org
when it gets into postfix the email address suddenly becomes mbcis@whateverthehostnameis which is set to localhost so of course the email bounces because that email doesnt exist

Original-Recipient: mbcis@mbcis.org
Final-Recipient: rfc822;mbcis@localhost
Action: delayed
Status: 4.4.1
Remote-MTA: localhost
Diagnostic-Code: SMTP; Cannot connect to remote host

–MIME-1458948873-50526903-delim
Content-Type: text/rfc822-headers

Received: from localhost ([67.223.238.172])
by mailhost.webtastix.co.nz
for mbcis@localhost;
Mon, 30 Mar 2009 02:29:21 -0700
Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177])
by localhost (Postfix) with ESMTP id 1CF1313C64E
for <mbcis@mbcis.org>; Mon, 30 Mar 2009 02:29:06 -0700 (PDT)
Received: by wa-out-1112.google.com with SMTP id j37so1197837waf.9
for <mbcis@mbcis.org>; Mon, 30 Mar 2009 02:29:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:received:reply-to:date:message-id
:subject:from:to:content-type;
bh=f1QHyVo1ZYOd63gW6BLtmzR6B3Q1Xikh9D9awYpuCGM=;
b=kQC9FWeY48YcfNwBJOsJP2HDQSTvrOh6BFkxeTz+D5WiMJaPc9/SnSXPYCNJrBLVoY
J+CBmR1ERThsicyR5lDEn7kddZ6FzRZMIYDHt6vPInWnNPRihrt9knRi0RKKQXRRHkxu
7kavhPHUSSy6vA2SFOcTI3JmCxbj0SMKoaf54=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:reply-to:date:message-id:subject:from:to:content-type;
b=siaUV6yBltgpt8+Qazll1ggyr/BwBVw+nwLMWaeTWQ1j/WiKZRM2RnfCfPztb5Xb6L
BQS/C0FfSzC17KTctiBp1pITE05Tf02uGtKkdfDIXzkS9fmrrKd2rNltd/N4zdLY8HO3
c6eEImGyR2rAZ1GpOfF001DiVIdAFDLlojvlI=
MIME-Version: 1.0
Received: by 10.114.66.10 with SMTP id o10mr1968785waa.33.1238405344432; Mon,
30 Mar 2009 02:29:04 -0700 (PDT)
Reply-To: shanelangley@xtra.co.nz
Date: Mon, 30 Mar 2009 22:29:01 +1300
Message-ID: <814c40420903300229l15f279bj46c11e36a879a12d@mail.gmail.com>
Subject: test
From: Shane Langley <webtastix@gmail.com>
To: mbcis@mbcis.org
Content-Type: multipart/alternative; boundary=00163646cbf2a49183046652b6e4

–MIME-1458948873-50526903-delim–

Your hostname is set incorrectly. Fix it. :wink:

thanks for that… what should i be setting it to? as i want it to recieve more than just 1 domain

You should set it to the hostname you want for the system. Receiving mail for multiple domains is irrelevant; that’s handled by the virtual map file (which Virtualmin manages automatically). “localhost” and similar is nonsensical for a public IP. The hostname returned by “hostname -f” needs to be a resolvable fully qualified domain name.

i had this set to fdwow.net before i changed it to localhost and every email that came in addressed to mbcis@mbcis.org would get changed to mbcis@fdwow.net

i just set the hostname for postfix to ns4.webtastix.co.nz which points to that ip and it changes the email to mbcis@ns4.webtastix.co.nz

Howdy,

What happens if you log into your server over SSH, and you type this:

cat /etc/fstab | mail -s "A Fun Test" mbcis@mbcis.org

What I’d like to see is the email logs from that time (/var/log/mail.log or /var/log/maillog), as well as the full email contents (including the headers).
-Eric

i just set the hostname for postfix

What do you mean “for postfix”? I meant set your system hostname correctly! Don’t set anything in Postfix. Postfix is not responsible for your system hostname. I’m betting you’ve set “myorigin”, which is never the right thing to do in a virtual hosting environment. Remove that completely from your postfix configuration. You don’t want it, you don’t need it, and it doesn’t do what you think it does (it does what you’ve seen: causes mail to no be delivered because no one ever configures it correctly).

andrey when i do that i get mail: command not found

Joe: no its setting the hostname option, i took out the myorigin option a few days ago…
the system hostname is already set correctly

Okay, so lets try this:

  1. First, install the mailx package, using either apt or yum, and then try this again: cat /etc/fstab | mail -s "A Fun Test" mbcis@mbcis.org

  2. What is the output of: hostname

  3. What are the contents of your /etc/hosts file

  4. Can you attach your /etc/postfix/main.cf file?

You may have set the hostname, but something still isn’t working right, as the email headers are identifying your Internet facing IP address as “localhost”. Hopefully we’ll discover why that is in the above information :slight_smile:
-Eric

does anyone have any idea? this is so weird

It’s not that weird. :wink:

Unset myhostname, and mydomain, and set mydestination back to something normal.

Mine is:

mydestination = $myhostname, localhost.$mydomain, localhost

After you’ve cleaned that stuff up, confirm that “hostname -f” actually returns a fully qualified and resolvable domain name. Don’t try to force Postfix to think your system is something other than what it actually is. Actually make your system be what you want it to be, and all of this “weird” behavior will go away.

have made those changes, still does the same thing
the following is in the mail.log file not sure if it makes a differnece or not?

Apr 1 19:26:41 59509 postfix/master[9516]: reload configuration /etc/postfix
Apr 1 19:26:44 59509 postfix/postfix-script: warning: /var/spool/postfix/etc/hosts and /etc/hosts differ
Apr 1 19:26:44 59509 postfix/postfix-script: warning: /var/spool/postfix/etc/nsswitch.conf and /etc/nsswitch.conf differ
Apr 1 19:26:54 59509 postfix/smtpd[10092]: connect from mailhost.chh.co.nz[203.9.183.40]
Apr 1 19:26:55 59509 postfix/smtpd[10092]: 54D0B13C667: client=mailhost.chh.co.nz[203.9.183.40]
Apr 1 19:26:55 59509 postfix/cleanup[10097]: 54D0B13C667: message-id=<0D891F211C040548B7A3A397E4A6006452218B@DNZPPPEXC50.chhnet.net>
Apr 1 19:26:55 59509 postfix/qmgr[10012]: 54D0B13C667: from=<Shane.Langley@chh.co.nz>, size=10890, nrcpt=1 (queue active)
Apr 1 19:26:56 59509 postfix/smtpd[10092]: disconnect from mailhost.chh.co.nz[203.9.183.40]
Apr 1 19:27:32 59509 postfix/postfix-script: warning: /var/spool/postfix/etc/hosts and /etc/hosts differ
Apr 1 19:27:33 59509 postfix/postfix-script: warning: /var/spool/postfix/etc/nsswitch.conf and /etc/nsswitch.conf differ

and a little bit more

Apr 1 19:28:05 59509 postfix/pickup[10011]: 1B5383E4005: uid=0 from=<root>
Apr 1 19:28:05 59509 postfix/cleanup[10097]: 1B5383E4005: message-id=<20090402022805.1B5383E4005@ns4.webtastix.co.nz>
Apr 1 19:28:05 59509 postfix/qmgr[10012]: 1B5383E4005: from=<root@ns4.webtastix.co.nz>, size=552, nrcpt=1 (queue active)
Apr 1 19:28:36 59509 postfix/local[10239]: 1B5383E4005: to=<root@ns4.webtastix.co.nz>, orig_to=<root>, relay=local, delay=31, delays=0.03/0.01/0/31, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Apr 1 19:28:36 59509 postfix/qmgr[10012]: 1B5383E4005: removed

Oh, you’re chrooted, as well. Egads. :wink:

What OS are you running? I’m trying to figure out if I should yell at you or not. Some systems chroot by default, though the author of Postfix recommends against it. :wink:

But, anyway, either mail is not being deliver correctly, or you’ve missed the log entries we need to see. This is a successful delivery:

Apr 1 19:28:36 59509 postfix/local[10239]: 1B5383E4005: to=<root@ns4.webtastix.co.nz>, orig_to=<root>, relay=local, delay=31, delays=0.03/0.01/0/31, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)

And I don’t see any other deliveries, successful or otherwise in either of these posts.

Restarting Postfix should repair the mismatched chroot stuff, I think, assuming the chrooted Postfix is part of the OS. And, yes, a mismatched chroot, especially /etc/hosts, is a very bad thing. :wink:

Oh, and when I say, "successful delivery", I mean "as successful as Postfix can do…it is being handed off the procmail, which may or may not put it in the right place, but once we have Postfix handing it off to procmail, Postfix is working and should no longer be messed with."

its running debian,
dont yell :stuck_out_tongue: i turned something off when i first set this up because it wouldnt send anything from the machine out im pretty sure that was chroot but mabye not
and the email is still sitting in the mail queue even though it says it sent there?

And my typo made this sentence nonsensical: “But, anyway, either mail is not being deliver correctly or you’ve missed the log entries we need to see.”

That should be "is NOW being delivered correctly".