E-mails got send from wrong maildomain

Hi Everyone,

I’m running in NS 6.7 fully updated were I have three maildomains configured. What happends is when sending mails NS choose wrong maildomain as sending adress?

Example scenario:
User@Example.com
User@Example2.com
User@Example3.com

I send mail from Exmple3.com from any mail client the server always sends the mail from Example.com domain? By default the user that is created on NS will have a user@ setting which means the user will be created on all three domains.

Any suggestions what might gone wrong before i start digging deeper into the cause?

Hi Kristian,

When you have different domains and must create different users for each domain, use the following procedure:

  1. Management -> Users -> CREATE NEW:
    a. Fill “User name”, “First name”, "Last name"
    b. Go to “Services” tab: uncheck "Create default email addresses"
    c. “SUBMIT
  2. Management -> Email addresses -> CREATE NEW:
    a. select from dropdown list after “@” the proper domain.
    b. select from “Account” the user for which you want to create the email address.
    c. “SUBMIT

BR,
Gabriel

Hi,

Not sure if you misunderstood my scenario or if I was unclear? I don’t want to use different users? One user with same user account on three different maildomains. Usually the correct source mail is chosen when sending mails but in my case it seems if the server doesn’t understand what replayadress to use because it always piks the same.

BR,

You can not.
I’m driving.
I will tell you later why and how to do. I have the same situation for 50 different domains.

@malvank please share the mail logs. Because now i have no opportunity to reproduce.

Also pls share
$myorigin from main.cf

You’re replying with one hand? And a eye on the street? :open_mouth:
Be careful!

1 Like

Don’t worry!
I’m writing only at the red light!:wink:

The send domain is chosen from the mail client.
You need to configure multiple identities inside your mail client and choose the right one when sending.

Hello Kristian,

Sorry for the late answer but I’m not in very good shape of health. Something between flu and bronchitis. The weather is changing very fast …

Please keep in mind that the NethServer is not designed to be an email server for complete separate domains.
NethServer is designed, till now, to act like an PDC with the possibility to have also an email server (and of course and other facilities but based on this task) to serve the primary domain and if exist, additionally virtual domains, as aliases domains for the primary domain.

(cc: @alefattorini, @giacomo, @davidep, @filippo_carletti: I hope is correct what I said till now)

In this forum there are a lot of Q&A regarding this task. Some of them:

NethServer for dummies: Email server
Multi-Domain/Multi-Tenat Groupware
Some question about E-mail and SOGO
Multiple, separate domains email server
Incomplete email address
One NethServer installation for N organizations?
Multi Domain support for mail
SOGO Email - Change the default from email sender

The same problem is for Zentyal.

Like I said, I use NethServer as email server for different domains but using an workaround. In a project, I have 50 email domains and each domain have at least one identical email address: “contact”.
How I solved this problem so as each email address, contact@domain.com, contact@domain1.com, … contact@domain50.com, to work properly?
Like I told you in my first answer, with the following remark: You cannot create two users with the same user name. For this, you must get another workaround. I have used this “technique”: for each domain, I have created “same user” like this:
User name: contact.domain (contact.domain1; contact.domain2; …; contact.domain50).
First name: Contact
Last name: DOMAIN (DOMAIN1; DOMAIN2; …; DOMAIN50)

NOTE:

  1. Account name = User name = contact.domain; contact.domain1; contact.domain2; …; contact.domain50
  2. I think that I seen somewhere, I’m not sure if in this forum, another way to create the same user for more than one time.

For me, how I solved this problem was the easy way and it works for about two years on Zentyal and on NethServer.

I hope that all of that from above will help you.

BR,
Gabriel

It is normal for postfix to send from one head domain, we should set up $myorigin and all domains which you have.

Hi Nas,

Where?
I never did that, with Zentyal or with NethServer.

There is no $myorigion in the main.cf as far as i can see it’s an postfix conig variable? Can you please be more clear what you mean?

Thanks,

I tried to find about “$myorigion” on “google”.
Nothing like in main.cf on NS.

http://serverfault.com/questions/28445/how-do-i-send-email-from-multiple-domains-from-a-single-mailserver
http://www.postfix.org/STANDARD_CONFIGURATION_README.html
http://serverfault.com/questions/144986/postfix-uses-hostname-instead-of-myhostname

The list may continue …

Hi Gabriel,

Thank you for such a thorough answer. I explain in more detail what I have done and what fails for me.

Like I already told you earlier i have create three different mail domains on the server. After that i create a user let’s call him/her USER in this explanation. Under services i have ticket the service for mail and per default the user gets created on all three domains . This can be changed by removing the pseudonym user@ and replace it with the specific domain i use but i want in this scenario be able to receive mails on all three mail domains.

I have not added the mail account user@example3.com to may mail program and phone. What happens is when I send a mail as user@example3.com it will be delivered as user@example.com to the destination recipient. So it seems that postfix can’t distinguish the correct mail domain.

Does this make sense to you?

I understand.

Maybe must be created a custom template in e-smith which will include

/etc/postfix/main.cf:
# Optional: send mail as user@domainname instead of user@hostname.
#myorigin = $mydomain

as is described here:

http://www.postfix.org/STANDARD_CONFIGURATION_README.html

but I realy don’t know.
I’m sure @nas can help but I think it’s very busy.

You are referring to this? Basic Postfix Configuration

What domain name to use in outbound mail

The myorigin parameter specifies the domain that appears in
mail that is posted on this machine. The default is to use the
local machine name, $myhostname, which defaults to the name of the
machine. Unless you are running a really small site, you probably
want to change that into $mydomain, which defaults to the parent
domain of the machine name.

For the sake of consistency between sender and recipient addresses,
myorigin also specifies the domain name that is appended
to an unqualified recipient address.

Examples (specify only one of the following):

/etc/postfix/main.cf:
myorigin = $myhostname (default: send mail as “user@$myhostname”)
myorigin = $mydomain (probably desirable: “user@$mydomain”)

Yes, you can try to specify all your 3 domains in myorigin in main.cf and try.
If it works for you we can make custom template or even pass it to the production.

I think is better but I’m not a specialist …

AFAIK the client is responsible for the sender value. The server does not alter it by any means.

Hi Nas,

but there is no “myorigin” in /etc/postfix/main.cf