mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-27 09:55:58 +03:00
[GH-ISSUE #493] branding by URL #477
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#477
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @patrickbenkoetter on GitHub (Dec 5, 2013).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/493
Modoboa's Webinterface should support branding by URL. If someone would call modoboa via http://mail.example.com it should use mail.example.com branding and limit the view to the domain example.com and its alias domains.
@tonioo commented on GitHub (Dec 6, 2013):
I'm not sure to understand this feature. It seems we could achieve it using only apache or nginx configuration...
@kunago commented on GitHub (Dec 10, 2013):
I agree with tonioo - this feature is very well achievable via apache/nginx/any other web server config files.
@patrickbenkoetter commented on GitHub (Dec 10, 2013):
I want modoboa to show different branding depending on the virtual hostname I access. I don't see how modo would do that today.
@tonioo commented on GitHub (Dec 10, 2013):
If I remember well, kunago has already implemented such a feature using only nginx configuation.
@kunago could you please explain how you did ?
@kunago commented on GitHub (Dec 12, 2013):
Of course. It is quite simple. This is what I am using to change a modoboa default logo based on a hostname:
You need to add this to the "server" directive and name your logos like this: logo-domain.com.png, logo-domain2.com.png, etc. In case the logo for a domain is missing, the default logo is used instead.
This can be adapted in any way to suit your needs.
@fernandoscheffel commented on GitHub (Sep 16, 2021):
I have two subdomins with the respective conf files in the sites-available and sites-enabled (symlink) folder.
I tryied to add the kunago solution in the server blocks but doesnt work. The logo.png works but stay the same logo in my two subdomains.
@bossey1 commented on GitHub (Jul 11, 2022):
Presumably this is set in /etc/nginx/sites-enabled/ ?
So is it set in autoconfig.domain.com or per each domain seperately such as mail.1stdomain.com mail.2nddomain.com etc?
@jaysenjohnson commented on GitHub (Feb 19, 2024):
Hello,
I know this issue is a little old but I am trying to implement this and it is also not working for me. I added the above lines to my nginx server block as described. I had to create the directory structure "/var/www/modoboa_mail/modoboa_mail/media/" as it did not exist on my server.
I uploaded my logo to the newly created directory and named it logo-mail.domain.com.png replacing domain.com with my actual domain. I restarted nginx to re-read the config but still the default logo shows. I cleared cache and even tried incognito mode with no success.
My question is regarding the location line in the above code. I am assuming "/media" means /srv/modoboa/instance/media/ ? I looked in that directory and there is no logo.png inside there.
What about file permissions? I uploaded my logo to /var/www/modoboa_mail/modoboa_mail/media/ directory. Do the permissions on the logo file need to be set to the modoboa user or the nginx webserver user?
Just need a little extra clarification on how to implement this.
Thank You
@fernandoscheffel commented on GitHub (Feb 20, 2024):
Hi jaysenjohnson,
You need just create the folder. You can specify any folder name or file name that you want, but make sure is the same as the nginx config.
alias /var/www/modoboa_mail/modoboa_mail/media/logo-$host.png;
if doesnt exist the folder modoboa_mail/modoboa_mail, you have two choises, create the folder or specify a different folder name that exists and put the logo file there.
About permission you can give total permission to all users using the command chmod -R 777 (folder path)
you follow this step? enable and changing the variable CUSTOM_LOGO in the settings.py
MODOBOA_CUSTOM_LOGO = os.path.join(MEDIA_URL, "mylogo.png")
you need to restart uwsgi too after changing settings.py
@jaysenjohnson commented on GitHub (Feb 20, 2024):
Hello,
I have created the folder as described and kept the same names. Logo is uploaded and named correctly also as described. I also put the lines of code in my nginx config and restarted nginx but it still doesn't seem to work.
As far as permissions, 777 isn't something I recommend or use. The world should not need full permissions to make this work. My question asked if the folders and logo files needed to be owned by modoboa user or webserver user?
For the custom logo setting in settings.py. Yes, I was changing the logo that way and that works. But that only changes the logo globally for all domains and uses a single logo. The goal is to use different logos per domain to match each client that we host for. That is what is not working. It was my understanding that this could be accomplished using the method user "kunago" explained above. It seems pretty straight-forward to implement but I am clearly missing something.
Thank You