Programmierus / ldap-mailcow

LDAP account synchronization and authentication for mailcow-dockerized
97 stars 38 forks source link

AD Domain differs from public domain #10

Closed MrHappy closed 4 years ago

MrHappy commented 4 years ago

Tried your addon for Mailcow today and it works like it's suppose to (I think ;) ). However, my internal domain is mydomain.lan and my external domain is mydomain.com. I would like to be able to send mail with mydomain.com as a default. I know this can be done manually, but changing this for every mail doesn't excite me... ;) Is this possible (without too much hassle)? Or can I change this behaviour in Mailcow (I've searched for it, but couldn't find it).

MrHappy commented 4 years ago

Apparently it can be changed (from the gui), but only for one user at a time (by the user). The settings are saved in select * from sogo_user_profile where c_uid='<ldapuser-account'; It can be found in the part [{"isDefault": 1, "email": "<emailaddress>" I guess it would be more benificial to put this request at mailcow-github...

Programmierus commented 4 years ago

Well, theoretically you can amend the syncer.py script that it adds users to mailcow via API with mydomain.com Than changes can be applied to /templates/sogo/plist_ldap and /templates/dovecot/ldap/passdb.conf. You can use the user omitting the domain or add required domain (mydomain.lan) manually.

MrHappy commented 4 years ago

Weirdest thing, I removed the mailboxes and ran the script again and now the accounts are created with internal-domain as logon and external-domain as emailaddress....

thehiddenbit commented 2 years ago

This topic is a bit older, but I would still like to reopen it. I have an internal and an external AD domain and would like to use the sAMAccountName for login, but send and receive emails with the external domain.

I have managed to give the syncer a custom AD field to use as a mailbox, in which I have stored the full external email address. However, I do not manage to log in to Sogo (plist_ldap), neither with the internal nor with the external domain.

Can someone please explain again how I have to do this. @MrHappy