931: Resolve webmail in admin r=mergify[bot] a=ionutfilip

## What type of PR?
bug-fix

## What does this PR do?
Implement mailustart to resolve webmail in admin

### Related issue(s)
Fix #716 

## Prerequistes
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: place entry in the [changelog](CHANGELOG.md), under the latest un-released version.


Co-authored-by: Ionut Filip <ionut.philip@gmail.com>
master
bors[bot] 6 years ago
commit f1f5aef7d3

@ -15,6 +15,7 @@ v1.6.1 - unreleased
- Enhancement: Missing wildcard option in alias flask command ([#869](https://github.com/Mailu/Mailu/issues/869))
- Bug: Fix creating new fetched accounts
- Bug: Fix poor performance if ANTIVIRUS is configured to none.
- Bug: Implement mailustart to resolve webmail in admin ([#716](https://github.com/Mailu/Mailu/issues/716))
- Bug: Rename cli commands and their options (replace "\_" with "-") ([#877](https://github.com/Mailu/Mailu/issues/877))
- Bug: Fix typo in migration script ([#905](https://github.com/Mailu/Mailu/issues/905))

@ -46,6 +46,7 @@ DEFAULT_CONFIG = {
'WEBSITE': 'https://mailu.io',
'WEB_ADMIN': '/admin',
'WEB_WEBMAIL': '/webmail',
'WEBMAIL': 'none',
'RECAPTCHA_PUBLIC_KEY': '',
'RECAPTCHA_PRIVATE_KEY': '',
# Advanced settings
@ -79,6 +80,8 @@ class ConfigManager(dict):
self.config['HOST_POP3'] = resolve(self.config['HOST_POP3'])
self.config['HOST_AUTHSMTP'] = resolve(self.config['HOST_AUTHSMTP'])
self.config['HOST_SMTP'] = resolve(self.config['HOST_SMTP'])
if self.config['WEBMAIL'] != 'none':
self.config['HOST_WEBMAIL'] = resolve(self.config['HOST_WEBMAIL'])
def __coerce_value(self, value):
if isinstance(value, str) and value.lower() in ('true','yes'):

@ -1,6 +1,7 @@
from flask_limiter import RateLimitExceeded
from mailu import utils
from flask import current_app as app
import socket
import flask
@ -23,7 +24,7 @@ def rate_limit_handler(e):
def whitelist_webmail():
try:
return flask.request.headers["Client-Ip"] ==\
socket.gethostbyname("webmail")
app.config["HOST_WEBMAIL"]
except:
return False

Loading…
Cancel
Save