1

Topic: Multiple domain and hostname

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.5.1
- Deployed with the downloadable installer.
- Linux/BSD distribution name and version: Debian 11
- Store mail accounts in which backend MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro?  No.
====

I use multi-domain setup for separate owners of domain., everything works fine. How can i set up separate domain, hostname on the header? For example,
Main domain/hostname is mail.domain1.com but if i send email from domain2.com so i have mail.domain1.com on the header but not mail.domain2.com.
My changed:
on 50-user to @local_domains_maps = ['.$mydomain', 'mail.domain2.com'];
on 20-debian_defaults to $X_HEADER_LINE = "";
on sdd_transport.pcre :
/@domain1\.com$/   domain1.com-smtp:
/@domain2\.com$/   domain2.com-smtp:

on master.cf  :
domain1.com-smtp     unix -       -       n       -       -       smtp
    -o smtp_bind_address=ipv4
    -o smtp_bind_address6=ipv6
    -o syslog_name=postfix-mail.domain1.com
    -o smtp_helo_name=mail.mdomain1.com

domain2.com-smtp     unix -       -       n       -       -       smtp
    -o smtp_bind_address=ipv4
    -o smtp_bind_address6=ipv6
    -o syslog_name=postfix-mail.domain2.com
    -o smtp_helo_name=mail.domain2.com

But i still have 5 lines with Recieved from mail.domain1.com on the header.

My English is also not so good, I hope you understand my reasons. Thanks for your help.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Stable release is out.

2

Re: Multiple domain and hostname

WhoAmI wrote:

How can i set up separate domain, hostname on the header?

What's the purpose of doing this change?

3

Re: Multiple domain and hostname

ZhangHuangbin wrote:
WhoAmI wrote:

How can i set up separate domain, hostname on the header?

What's the purpose of doing this change?

Hi,
I want to have separate headers for each domain. For example, if I will send email from domain2.com, must only be domain2.com in the header.
It looks like now below:

Received: from mx.domain2.com (mx.domain2.com. [IP])
        by mx.google.com with ESMTPS id s18ssds5eji.IP
        for <xxxx@xxx>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);

Received: from Received: from mx.domain1.com (localhost [127.0.0.1]) by mx.domain1.com (Postfix) with ESMTP id 4Jdsdss for
<xxxx@xxx; Mon, 31 Jan 2022 08:20:31 +0100 (CET) (localhost [127.0.0.1]) by mx.domain1.com (Postfix) with ESMTP id 4sdsds for <xxx@xxx>;

Received: from mx.domain1.com ([127.0.0.1]) by mx.domain1.com (mx.domain1.com [127.0.0.1]) (amavisd-new, port 10026)
with ESMTP id tffd for <xxx@xxx>;


Thanks for your help!

4

Re: Multiple domain and hostname

the mail header includes the hostname, you need a own mailserver for each domain then, and i really dont get why you even consider this, i dun see any purpose

5

Re: Multiple domain and hostname

WhoAmI wrote:
ZhangHuangbin wrote:
WhoAmI wrote:

How can i set up separate domain, hostname on the header?

What's the purpose of doing this change?

Hi,
I want to have separate headers for each domain. For example, if I will send email from domain2.com, must only be domain2.com in the header.
It looks like now below:

Received: from mx.domain2.com (mx.domain2.com. [IP])
        by mx.google.com with ESMTPS id s18ssds5eji.IP
        for <xxxx@xxx>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);

Received: from Received: from mx.domain1.com (localhost [127.0.0.1]) by mx.domain1.com (Postfix) with ESMTP id 4Jdsdss for
<xxxx@xxx; Mon, 31 Jan 2022 08:20:31 +0100 (CET) (localhost [127.0.0.1]) by mx.domain1.com (Postfix) with ESMTP id 4sdsds for <xxx@xxx>;

Received: from mx.domain1.com ([127.0.0.1]) by mx.domain1.com (mx.domain1.com [127.0.0.1]) (amavisd-new, port 10026)
with ESMTP id tffd for <xxx@xxx>;


Thanks for your help!

I'm not really sure why you would need this?

FWIW: I am running 2 separate mail domains, and I just setup the DKIM keys and DMARC records on DNS, and used a cert with the 2 domains, everything works fine. 

If you need, here is a writeup on hosting multiple email domains and the steps to make it all work:
https://www.linuxbabe.com/mail-server/s … ains-nginx

Best of luck!

6

Re: Multiple domain and hostname

derek1776 wrote:
WhoAmI wrote:
ZhangHuangbin wrote:

What's the purpose of doing this change?

Hi,
I want to have separate headers for each domain. For example, if I will send email from domain2.com, must only be domain2.com in the header.
It looks like now below:

Received: from mx.domain2.com (mx.domain2.com. [IP])
        by mx.google.com with ESMTPS id s18ssds5eji.IP
        for <xxxx@xxx>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);

Received: from Received: from mx.domain1.com (localhost [127.0.0.1]) by mx.domain1.com (Postfix) with ESMTP id 4Jdsdss for
<xxxx@xxx; Mon, 31 Jan 2022 08:20:31 +0100 (CET) (localhost [127.0.0.1]) by mx.domain1.com (Postfix) with ESMTP id 4sdsds for <xxx@xxx>;

Received: from mx.domain1.com ([127.0.0.1]) by mx.domain1.com (mx.domain1.com [127.0.0.1]) (amavisd-new, port 10026)
with ESMTP id tffd for <xxx@xxx>;


Thanks for your help!

I'm not really sure why you would need this?

FWIW: I am running 2 separate mail domains, and I just setup the DKIM keys and DMARC records on DNS, and used a cert with the 2 domains, everything works fine. 

If you need, here is a writeup on hosting multiple email domains and the steps to make it all work:
https://www.linuxbabe.com/mail-server/s … ains-nginx

Best of luck!

It is by security reason or brand reason. It is two dependent a companies. I checked this link. Domain, DKIM working fine.

Some lines come from amavis/../50-user config. I think, it is $myhostname = 'mx.domain1.com'; $mydomain = $myhostname; $localhost_name = $myhostname;.

7

Re: Multiple domain and hostname

There's no "security" concern with such header info IMO. And about "brand", if you really want it look like a standalone mail server for this domain, then set it up on a standalone mail server to make it real, don't fake the fact. smile

8

Re: Multiple domain and hostname

I have the same issue. I'm getting dinged by spam tests for domain2 not matching domain1, although domain2 is authorized for use on that server.

What is best practice here? I don't have the resources to spin up additional servers, and so is it not possible to host multiple domains on one server, with each individual domain showing the sender to be its actual domain?

Any resources or additional guidance you could provide here would be great. I'm just started to get fairly comfortable with each of the components involved in building a mail server, and I've been hosting my own for over 2 years now with just one domain. It is just recently I decided to add a couple additional domains for my other business and one for one of my hobbies.

Cheers! Thanks in advance!

9

Re: Multiple domain and hostname

it is important that the mailserver helo matches the PTR of the ip, so i guess that is your problem

10

Re: Multiple domain and hostname

benjamma wrote:

I have the same issue. I'm getting dinged by spam tests for domain2 not matching domain1, although domain2 is authorized for use on that server.

What's the original error message in Postfix log file?

11 (edited by gpapaiko 2022-09-23 13:31:56)

Re: Multiple domain and hostname

benjamma wrote:

I have the same issue. I'm getting dinged by spam tests for domain2 not matching domain1, although domain2 is authorized for use on that server.

What is best practice here? I don't have the resources to spin up additional servers, and so is it not possible to host multiple domains on one server, with each individual domain showing the sender to be its actual domain?

Any resources or additional guidance you could provide here would be great. I'm just started to get fairly comfortable with each of the components involved in building a mail server, and I've been hosting my own for over 2 years now with just one domain. It is just recently I decided to add a couple additional domains for my other business and one for one of my hobbies.

Cheers! Thanks in advance!

Hi Benjamma,

As others have mention here as long as you  have the DKIM, SPF, and DMARC configured correctly on the DNS for each of the domains then they will pass the security issue and will not be spammed.

e.g.
SPF:            PASS with IP xx.xx.xx.xx Learn more
DKIM:    'PASS' with domain xx.com Learn more
DMARC:    'PASS' Learn more

I have 5 different domains running on the one server and they all pass the security measures, and have no issues with them, the client are sending email to federal government agencies and they are passing the SPAM filters.

Just one thing to be aware off, if you are a adding a disclaimer to email you MUST make sure that is it less then 980 characters or the DKIM will FAIL, and get caught by the spam filter.

Yes you can have different disclaimers for each of the domains.

if you have a gmail account, you can send your self an email from the domain and  check to see if it passes the security test.