1

Topic: Problem on undestranding correct /etc/hosts configuration.

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySql
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: Linux Mint 17.1 Rebecca
- Related log if you're reporting an issue:

giuliana@subaru.it
#550 5.1.1 RESOLVER.ADR.RecipNotFound; not found ##rfc822;giuliana@subaru.it

Intestazioni originali del messaggio:

Received: from rk-mailserver.posta (92.223.198.163) by mail.subaru.it
(10.10.50.15) with Microsoft SMTP Server id 14.3.195.1; Tue, 16 Jun 2015
18:19:21 +0200
Received: from localhost (localhost [127.0.0.1])    by rk-mailserver.posta
(Postfix) with ESMTP id 17C0820800AF    for <giuliana@subaru.it>; Tue, 16 Jun
2015 18:20:03 +0200 (CEST)
Authentication-Results: rk-mailserver.local (amavisd-new);
    dkim=pass (1024-bit key) reason="pass (just generated, assumed good)"
    header.d=rkdistribuzione.it
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=
    rkdistribuzione.it; h=user-agent:message-id:references
    :in-reply-to:organization:subject:subject:to:from:from:date:date
    :content-type:content-type:mime-version; s=dkim; t=1434471602;
     x=1435335603; bh=uCf3Seg4Gdw7vldfFNzOtVB8COnVv1qITll+KH54D98=; b=
    ePkTmXCp7Y9rMncQbzAXNppLc5Q4Pjh+BvB93wcUby61et8t6n83Yr5lzY9IwtEG
    rCJ7XcNq+W9UnB91Od7FOFve+MI8e3BIF4ffuECJOxQvGv/SDWy3UIDbiBRGTzNj
    0ZtlSQclkWnYHP46sxLr9XJr3TBq9ySwiiAuAR9glGM=
X-Virus-Scanned: Debian amavisd-new at rkdistribuzione
Received: from rk-mailserver.posta ([127.0.0.1])    by localhost
(rk-mailserver.local [127.0.0.1]) (amavisd-new, port 10024)    with ESMTP id
aIEr1jMOw-Ck for <giuliana@subaru.it>;    Tue, 16 Jun 2015 18:20:02 +0200 (CEST)
Received: from rkdistribuzione.it (localhost [127.0.0.1])    by
rk-mailserver.posta (Postfix) with ESMTPSA id 5CDBD20800A9    for
<giuliana@subaru.it>; Tue, 16 Jun 2015 18:20:01 +0200 (CEST)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=_059906d79a8cce7106b806611cd681ff"
Date: Tue, 16 Jun 2015 18:20:01 +0200
From: Stella Bettini <s.bettini@rkdistribuzione.it>
To: <giuliana@subaru.it>
Subject: Fwd: EC FATTURE SCADUTE
Organization: Rk distribuzione Srl
In-Reply-To: <915192af0c026c4db073a2491512b5d0@rkdistribuzione.it>
References: <874a659330cce247c63cff4335635886@rkdistribuzione.it>
<eb4a8e489661164752227120b5ed1a20@rkdistribuzione.it>
<915192af0c026c4db073a2491512b5d0@rkdistribuzione.it>
Return-Receipt-To: Stella Bettini <s.bettini@rkdistribuzione.it>
Disposition-Notification-To: Stella Bettini <s.bettini@rkdistribuzione.it>
Message-ID: <c438b90b6416dc59d010895ce9fad20a@rkdistribuzione.it>
X-Sender: s.bettini@rkdistribuzione.it
User-Agent: Roundcube Webmail
Return-Path: s.bettini@rkdistribuzione.it
Received-SPF: Fail (SRVEXC10.subaru.lan: domain of
s.bettini@rkdistribuzione.it does not designate 92.223.198.163 as permitted
sender) receiver=SRVEXC10.subaru.lan; client-ip=92.223.198.163;
helo=rk-mailserver.posta;

Reporting-MTA: dns;subaru.lan
Received-From-MTA: dns;rk-mailserver.posta
Arrival-Date: Tue, 16 Jun 2015 16:19:21 +0000

Original-Recipient: rfc822;giuliana@subaru.it
Final-Recipient: rfc822;giuliana@subaru.it
Action: failed
Status: 5.1.1
Diagnostic-Code: smtp;550 5.1.1 RESOLVER.ADR.RecipNotFound; not found

====

What is not clear to me is: during first setup, system asked me to create my first virtual mail domain. And it specified that it must not ben the same of the hostname of the server.
Now, my server has public ip configurated as eth0 but I set hostname to a fantasy name so it is mailserver.posta and my /etc/hosts file is this:
root@rkditribuzione:~# cat /etc/hosts
127.0.0.1    localhost
92.223.198.163    mailserver.it mailserver  <- local hostname
92.223.198.163    rkdistribuzione.it rkdistribuzione <- REAL domain I meand the internet pubblic registred domain and the vhost of iredmail config
92.223.198.163    rk-mailserver.posta rk-mailserver <- this must be added or mailsystem does not work!!!

Now my question is: why, considering that the ip of the server is the public one, I can not set the local hostname equal to the virtual domain (the one asked to me during the first setup) ?

I suppose that if possibile problems like this:
Received-SPF: Fail (SRVEXC10.subaru.lan: domain of
s.bettini@rkdistribuzione.it does not designate 92.223.198.163 as permitted
sender) receiver=SRVEXC10.subaru.lan; client-ip=92.223.198.163;
helo=rk-mailserver.posta;

should be solved consequently (or not?).

I apoligize for my poor english and hope I've been sufficiently clear.

Best regards.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Problem on undestranding correct /etc/hosts configuration.

JoeVr wrote:

Now my question is: why, considering that the ip of the server is the public one, I can not set the local hostname equal to the virtual domain (the one asked to me during the first setup) ?

Many programs (especially cron jobs) will generate emails sent to system accounts (e.g. root user), local MTA must know where it should deliver these emails to. so we must use server hostname in Postfix as local host name ($myhostname), when email sent to 'username@[server_hostname]' arrived, Postfix knows it's sent to system user.

If you need to add virtual mail users for this server hostname, i suggest you change current server hostname to another one, then add current server hostname as a mail domain name and add virtual mail users under this domain. It's simple.

3

Re: Problem on undestranding correct /etc/hosts configuration.

ZhangHuangbin wrote:
JoeVr wrote:

Now my question is: why, considering that the ip of the server is the public one, I can not set the local hostname equal to the virtual domain (the one asked to me during the first setup) ?

Many programs (especially cron jobs) will generate emails sent to system accounts (e.g. root user), local MTA must know where it should deliver these emails to. so we must use server hostname in Postfix as local host name ($myhostname), when email sent to 'username@[server_hostname]' arrived, Postfix knows it's sent to system user.

If you need to add virtual mail users for this server hostname, i suggest you change current server hostname to another one, then add current server hostname as a mail domain name and add virtual mail users under this domain. It's simple.

ok, so it has no importance if the local hostname is not resolvable by external DNS I suppose.
I post this question couse in some records of any email recevied from my mail server i see the localdomain rk-mailserver.posta, and I thought that a non DNS readable domain can generate errors like the SPF i reported in the original post.

Thanks for the explanations in any case.

4

Re: Problem on undestranding correct /etc/hosts configuration.

It's ok that if your server hostname is not resolvable in DNS, but it's highly recommended.

5 (edited by SteveLuxe 2015-06-19 22:11:35)

Re: Problem on undestranding correct /etc/hosts configuration.

If you're setting up your mail server, and you want to name your server "mail" as a host name, you can call it mail.something.com, but still have your first virtual domain name be "something.com". Just make sure that the full machine name (mail.something.com) is the first one, and then use "something.com" as your next one. It'll work perfectly fine. Mine was set up that way.

Your mail server should have a resolvable DNS name, though. You really need that for your pointer record in DNS, so that when other servers look up your server's information, it matches the host and domain name. If your reverse-DNS record doesn't match your fully qualified host+domain name, most mail servers will reject your emails.