Author Topic: [solved] non-authoritive Domain (to configure gmail-addresses?)  (Read 2456 times)

luckyfreddy

  • Zen Apprentice
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
Hello together,

to connect my (and families) Smartphones and Computers i would install an Zentyal 6.1 Development for private. Is there any possibility to set an hostname like gmail.com to your mailaddress, without to block any other gmail.com-addresses which where not configured at zentyal? At Microsoft Exchange there is an option to set an domain "non-authorized", so that Exchange first try send an mail at the internal user-account (if available) and then (when no matching account with that mail-address would be found) sent it out to the smarthost (smtp.gmail.com).

Would there be an possibility to set something similar?

Sorry for my worse english; i'm not a native speaker.

Greetings,
Fred
« Last Edit: June 05, 2020, 04:05:57 pm by luckyfreddy »

luckyfreddy

  • Zen Apprentice
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
Workaround for this problem
« Reply #1 on: May 29, 2020, 04:38:14 pm »
I've found an workaround for that problem:

In the /etc/postfix/main.cf - File I comment out the virtual_mailbox_domains, virtual_alias_maps and virtual_mailbox_maps and reload the postfix-service with "service postfix reload".

That's it. From now on all communication will be send through the smarthost/relayhost and it's done. Unfortunately this changes are not safe from any changes at the GUI and propably not at updates. So I think, that it is rather an workaround than an solution, but it worked for me.

Credits: Found the soultion here: https://support.plesk.com/hc/en-us/articles/213931945-Mail-to-external-mail-service-is-delivered-locally


edit:
Unfortunatelly after restart or any changes at the "mail"-section the outcomments would be removed and the unwated behavior is back.

Perhaps anybody has an idea to fix that without cronjobs to write the changes all time in the file and reload the postfix-service?
« Last Edit: May 31, 2020, 10:06:23 am by luckyfreddy »

luckyfreddy

  • Zen Apprentice
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
I found out the reason why it would be uncommented after reboot. The file /etc/postfix/main.cf would generated by an zentyal-init-script while booting the system.

I could find the draft-file, which shoud be /usr/share/zentyal/stubs/mail/main.cf.mas.

I think using an script (e.g. via cronjob?)... something like that:
Code: [Select]
sed -i s/^virtual_mailbox_domains/#virtual_mailbox_domains/g /usr/share/zentyal/stubs/mail/main.cf.mas
sed -i s/^virtual_alias_maps/#virtual_alias_maps/g /usr/share/zentyal/stubs/mail/main.cf.mas
sed -i s/^virtual_mailbox_maps/#virtual_mailbox_maps/g /usr/share/zentyal/stubs/mail/main.cf.mas
...should make it safe for upgrades. What do you think?

doncamilo

  • Zen Samurai
  • ****
  • Posts: 478
  • Karma: +165/-1
    • View Profile
 :)

Read the official documentation: https://doc.zentyal.org/en/appendix-c.html#stubs

Regarding the templates, Zentyal has a good architecture. Zentyal looks for the templates. first, in the '/etc/zentyal/stubs/...' folders (that you have to create) If the needed template doesn't exists in this location, it searches the template in the default '/usr/share/zentyal/stubs/...' folders.

Cheers!
- Do my pigeons bother you passing over your land?
- They block the sun!

G. Guareschi., Don Camillo.,

luckyfreddy

  • Zen Apprentice
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
Re: [resolved] non-authoritive Domain (to configure gmail-addresses?)
« Reply #4 on: June 05, 2020, 04:05:38 pm »
That is great.
My problem first was, that i don't know where to configure my wish from the topic. That's why i could not found the right place in the documentation.

As I found my "workaround" I forgot to check the documentation. So thank you for the link; I think it helps. This seemed to me a solution for me.

Thank you and greetings from germany.