Koozali.org: home of the SME Server

Created with domainA, using another domainB: can I set domainB as the "default"?

Offline Michail Pappas

  • *
  • 351
  • +1/-0
I created a SME server some years ago having a hostname of host.domainA. This is a system in server-only mode, with the sole purpose of acting as a mail server (plus webmail). No proxying, ldap, samba. Just local accounts on it.

This was not a problem, but with the advent of DMARC, my system sends reports for DMARC activity as admin@domainA. Can I set it to send DMARC reports (and all other SME-related mails for that purpose) as admin@domainB?

This is a production system and of course I'll take a VM snapshot before doing so, but still I have to know what might be the downfalls here.

Thanks in advance for any info provided.

Offline Michail Pappas

  • *
  • 351
  • +1/-0
(bump)

Someone perhaps fellas? Is my request perhaps too naive or is more info needed on my part?

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
I'd think you could do
Code: [Select]
db domains delprop domainA SystemPrimaryDomain
db domains setprop domainB SystemPrimaryDomain yes
signal-event post-upgrade; signal-event reboot
......

Offline Michail Pappas

  • *
  • 351
  • +1/-0
Thanks Dan. Do you foresee any issues in doing so? It would be nice if one of the resident experts could green light this. Like I said, I have backups of the entire VM, but even so I could lose mails perhaps, before taking notice that something went wrong.

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
I don't foresee any issues, but I've never tried it.  I can't recall that I've seen the question before.
......

Offline janet

  • *****
  • 4,812
  • +0/-0
Michail Pappas

You can safely change the domain name of your sme server (&  many other configuration too) & data (including emails) does not get lost.

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Michail Pappas

  • *
  • 351
  • +1/-0
Apologies for delaying to get back to you.

In the "problem" description I failed to include a critical piece of information: the hostname is currently hostname.domainA and it has to remain like that, for a number of reasons:
* I have SSL certificates in place for this hostname.domainA
* My MX records for domainB indicate that the mail server is hostname.domainA! (yes, I know it is strange, there were and still are a number of reasons for doing so).
* Hosts connecting securely over S/POP, S/IMAP and secure SMTP should still continue to use hostname.domainA for e-mail purposes (no grunt regarding different certificates etc).

With these in mind, is it still ok to go ahead and do the commands proposed by Dan?
« Last Edit: May 18, 2017, 10:57:46 AM by Michail Pappas »

Offline Michail Pappas

  • *
  • 351
  • +1/-0
Went ahead and tried to see what would happen. Effectively, doing the afore-mentioned commands deleted domainB entirely. That is, db domains show, depicted only domainA alone (even though I had set domainB as SystemPrimaryDomain).

For some reason though, this change did not affect DKIM for domainB. That is, even though it was not listed with db domains show, sent mail was succesfully signed with the DKIM key. Which is somewhat logical, since both domains share the same DKIM key...

At this point I am not sure whether I should open a bug: the reason is that I am not sure, in turn, if the following should have done what I intended in the first place:
Code: [Select]
db domains delprop domainA SystemPrimaryDomain
db domains setprop domainB SystemPrimaryDomain yes
signal-event post-upgrade; signal-event reboot
Any advice will be appreciated.

Offline Michail Pappas

  • *
  • 351
  • +1/-0
<offtopic>As to the why I am trying to do this, the reason is the following: the newly generated DMARC reports are sent with a sender address of admin@domainA instead of admin@domainB, resulting errors from the recipient domains. Which is logical since domainA has no MX records, whereas domainB does... So, I would be content if I could simply change the sender of DMARC reports from admin@domainA to admin@domainB.

<Some minutes later>
It was quite easy, creating a template. Will post things later, for whoever needs this.
</offtopic>
« Last Edit: May 18, 2017, 12:44:21 PM by Michail Pappas »

Offline Michail Pappas

  • *
  • 351
  • +1/-0
<Some minutes later>
It was quite easy, creating a template. Will post things later, for whoever needs this.
</offtopic>
Code: [Select]
config setprop qpsmtpd DMARCReportEmail admin@domainB DMARCContactInfo 'http://site.domainB/'
mkdir -p /etc/e-smith/templates-custom/etc/mail-dmarc.ini
cp /etc/e-smith/templates/etc/mail-dmarc.ini/100organization /etc/e-smith/templates-custom/etc/mail-dmarc.ini
sed -i 's/^domain.*= .*/domain = domainB/' 100organization
signal-event email-update

Not pretty, but did the job for me.