Commit graph

986 commits

Author SHA1 Message Date
Joshua Tauberer
34017548d5 Don't crash if a custom DNS entry is not under a zone managed by the box, fixes #1961 2021-10-22 18:39:53 -04:00
David Duque
7caa4f5c4e
Disable dark mode CSS for now
It doesn't play nice with the current admin panel. I'll design a better dark mode in the future.
2021-10-19 17:26:05 +01:00
David
a6c8bbed20
Fix incorrect info about passwords 2021-10-19 14:42:36 +01:00
David
f6d7d5689c
Merge v55 from upstream 2021-10-19 14:42:07 +01:00
David
b757e4c339
(Admin Panel) Fix an issue where all TXT records from a given qname would be deleted 2021-10-19 13:07:34 +01:00
David Duque
8a0805dae8
Backups: When rsync option is selected, allow modifying the target port (#30) 2021-10-19 11:20:41 +01:00
Richard Willis
1c3bca53bb
Fix broken link in external-dns.html (#2045) 2021-10-18 07:36:48 -04:00
ukfhVp0zms
b643cb3478
Update calendar/contacts android app info (#2044)
DAVdroid has been renamed to DAVx⁵ and price increased from $3.69 to $5.99.
CardDAV-Sync free is no longer in beta.
CalDAV-Sync price increased from $2.89 to $2.99.
2021-10-13 19:09:05 -04:00
Joshua Tauberer
113b7bd827 Disable SMTPUTF8 in Postfix because Dovecot LMTP doesn't support it and bounces messages that require SMTPUTF8
By not advertising SMTPUTF8 support at the start, senders may opt to transmit recipient internationalized domain names in IDNA form instead, which will be deliverable.

Incoming mail with internationalized domains was probably working prior to our move to Ubuntu 18.04 when postfix's SMTPUTF8 support became enabled by default.

The previous commit is retained because Mail-in-a-Box users might prefer to keep SMTPUTF8 on for outbound mail, if they are not using internationalized domains for email, in which case the previous commit fixes the 'relay access denied' error even if the emails aren't deliverable.
2021-09-24 08:11:36 -04:00
Joshua Tauberer
3e19f85fad Add domain maps from Unicode forms of internationalized domains to their ASCII forms
When an email is received by Postfix using SMTPUTF8 and the recipient domain is a Unicode internationalized domain, it was failing to be delivered (bouncing with 'relay access denied') because our users and aliases tables only store ASCII (IDNA) forms of internationalized domains. In this commit, domain maps are added to the auto_aliases table from the Unicode form of each mail domain to its IDNA form, if those forms are different. The Postfix domains query is updated to look at the auto_aliases table now as well, since it is the only table with Unicode forms of the mail domains.

However, mail delivery is still not working since the Dovecot LMTP server does not support SMTPUTF8, and mail still bounces but with an error that SMTPUTF8 is not supported.
2021-09-24 08:11:36 -04:00
Joshua Tauberer
11e84d0d40 Move automatically generated aliases to a separate database table
They really should never have been conflated with the user-provided aliases.

Update the postfix alias map to query the automatically generated aliases with lowest priority.
2021-09-24 08:11:36 -04:00
Joshua Tauberer
79966e36e3 Set a cookie for /admin/munin pages to grant access to Munin reports
The /admin/munin routes used the same Authorization: header logic as the other API routes, but they are browsed directly in the browser because they are handled as static pages or as a proxy to a CGI script.

This required users to enter their email username/password for HTTP basic authentication in the standard browser auth prompt, which wasn't ideal (and may leak the password in browser storage). It also stopped working when MFA was enabled for user accounts.

A token is now set in a cookie when visiting /admin/munin which is then checked in the routes that proxy the Munin pages. The cookie's lifetime is kept limited to limit the opportunity for any unknown CSRF attacks via the Munin CGI script.
2021-09-24 08:11:36 -04:00
drpixie
df46e1311b
Include NSD config files from /etc/nsd/nsd.conf.d/*.conf (#2035)
And write MIAB dns zone config into /etc/nsd/nsd.conf.d/zones.conf. Delete lingering old zones.conf file.

Co-authored-by: Joshua Tauberer <jt@occams.info>
2021-09-24 08:07:40 -04:00
Elsie Hupp
353084ce67
Use "smart invert" for dark mode (#2038)
* Use "smart invert" for dark mode

Signed-off-by: Elsie Hupp <9206310+elsiehupp@users.noreply.github.com>

* Add more contrast to form controls

Co-authored-by: Joshua Tauberer <jt@occams.info>
2021-09-19 09:53:03 -04:00
David Duque
04e1c0647e
Ability to set custom TTL values for custom DNS records (#28) 2021-09-16 15:35:04 +01:00
mailinabox-contributor
91079ab934
add numeric flag value to DNSSEC DS status message (#2033)
Some registrars (e.g. Porkbun) accept Key Data when creating a DS RR,
but accept only a numeric flags value to indicate the key type (256 for KSK, 257 for ZSK).

https://datatracker.ietf.org/doc/html/rfc5910#section-4.3
2021-09-10 16:12:41 -04:00
David Duque
4c4cce836e
Merge changes from upstream 2021-09-07 17:08:05 +01:00
Joshua Tauberer
e5909a6287 Allow non-admin login to the control panel and show/hide menu items depending on the login state
* When logged out, no menu items are shown.
* When logged in, Log Out is shown.
* When logged in as an admin, the remaining menu items are also shown.
* When logged in as a non-admin, the mail and contacts/calendar instruction pages are shown.

Fixes #1987
2021-09-06 09:23:58 -04:00
Joshua Tauberer
26932ecb10 Add a 'welcome' panel to the control panel and make it the default page instead of the status checks which take too long to load
Fixes #2014
2021-09-06 09:23:58 -04:00
Joshua Tauberer
e884c4774f Replace HMAC-based session API keys with tokens stored in memory in the daemon process
Since the session cache clears keys after a period of time, this fixes #1821.

Based on https://github.com/mail-in-a-box/mailinabox/pull/2012, and so:

Co-Authored-By: NewbieOrange <NewbieOrange@users.noreply.github.com>

Also fixes #2029 by not revealing through the login failure error message whether a user exists or not.
2021-09-06 09:23:58 -04:00
Joshua Tauberer
53ec0f39cb Use 'secrets' to generate the system API key and remove some debugging-related code
* Rename the 'master' API key to be called the 'system' API key
* Generate the key using the Python secrets module which is meant for this
* Remove some debugging helper code which will be obsoleted by the upcoming changes for session keys
2021-09-06 09:23:58 -04:00
Greatest125
db1330795f
fixed spelling mistake (#26) 2021-08-26 16:59:19 +01:00
David Duque
ba80d9e72d
Show backup retention period form when configuring B2 backups (#2024) 2021-08-23 06:25:41 -04:00
David Duque
d8c77527bd
Debian 11 support (#25) 2021-08-23 02:06:38 +01:00
David Duque
d557885aab
SMTP Relay feature rework (#23) 2021-08-23 02:06:10 +01:00
Joshua Tauberer
67b5711c68 Recommend that DS records be updated to not use SHA1 and exclude MUST NOT methods (SHA1) and the unlikely option RSASHA1-NSEC3-SHA1 (7) + SHA-384 (4) from the DS record suggestions 2021-08-22 14:43:46 -04:00
myfirstnameispaul
20ccda8710 Re-order DS record algorithms by digest type and revise warning message.
Note that 7, 4 is printed last in the status checks page but does not appear in the file, and I couldn't figure out why.
2021-08-22 14:29:36 -04:00
lamkin
daad122236
Ignore bad encoding in email addresses when parsing maillog files (#2017)
local/domain parts of email address should be standard ASCII or
UTF-8. Some email addresses contain extended ASCII, leading to
decode failure by the UTF-8 codec (and thus failure of the
Usage-Report script)

This change allows maillog parsing to continue over lines
containing such addresses
2021-08-16 11:46:32 -04:00
NewbieOrange
21ad26e452
Disable auto-complete for 2FA code in the control panel login form (#2013) 2021-07-28 16:39:40 -04:00
David
c171b6491a
Forgot to account that b2sdk had modules :c 2021-07-04 11:17:21 +01:00
David
e1aabc4504
Backups: Alternative imports for legacy path (debian 10) 2021-07-03 00:25:42 +01:00
David
f55c0a68b6
Management: Add get_os_code() function 2021-07-03 00:21:21 +01:00
David
d0b5794588
New version notice - point to the correct page 2021-06-27 22:26:19 +01:00
David
afe7123f70
Merge v0.54 from upstream 2021-06-27 22:24:26 +01:00
Joshua Tauberer
d510c8ae2a Enable and recommend port 465 for mail submission instead of port 587 (fixes #1849)
Port 465 with "implicit" (i.e. always-on) TLS is a more secure approach than port 587 with explicit (i.e. optional and only on with STARTTLS). Although we reject credentials on port 587 without STARTTLS, by that point credentials have already been sent.
2021-05-15 16:42:14 -04:00
Joshua Tauberer
e283a12047 Add null SPF, DMARC, and MX records for automatically generated autoconfig, autodiscover, and mta-sts subdomains; add null MX records for custom A-record subdomains
All A/AAAA-resolvable domains that don't send or receive mail should have these null records.

This simplifies the handling of domains a bit by handling automatically generated subdomains more like other domains.
2021-05-15 16:42:14 -04:00
Joshua Tauberer
e421addf1c Pre-load domain purpopses when building DNS zonefiles rather than querying mail domains at each subdomain 2021-05-09 08:16:07 -04:00
Joshua Tauberer
354a774989 Remove a debug line added in 8cda58fb 2021-05-09 07:34:44 -04:00
Joshua Tauberer
aaa81ec879 Fix indentation issue in bc4ae51c2d 2021-05-08 09:06:18 -04:00
John @ S4
d4c5872547
Make clear that non-AWS S3 backups are supported (#1947)
Just a few wording changes to show that it is possible to make S3 backups to other services than AWS - prompted by a thread on MIAB discourse.
2021-05-08 08:32:58 -04:00
Hala Alajlan
bc4ae51c2d
Handle query dns timeout unhandled error (#1950)
Co-authored-by: hala alajlan <halalajlan@gmail.com>
2021-05-08 08:26:40 -04:00
Jawad Seddar
12aaebfc54
custom.yaml: add support for X-Frame-Options header and proxy_redirect off (#1954) 2021-05-08 08:25:33 -04:00
David Duque
40babe3e03
do_web_update: Order the domains in some way before writing to the nginx local.conf 2021-04-13 23:01:18 +01:00
David Duque
b9bdf50628
Merge v0.53 from upstream 2021-04-13 16:35:02 +01:00
Joshua Tauberer
8cda58fb22 Speed up status checks a bit by removing a redundant check if the PRIMARY_HOSTNAME certificate is signed and valid 2021-04-12 19:42:12 -04:00
Joshua Tauberer
178c587654 Migrate to the ECDSAP256SHA256 (13) DNSSEC algorithm
* Stop generating RSASHA1-NSEC3-SHA1 keys on new installs since it is no longer recommended, but preserve the key on existing installs so that we continue to sign zones with existing keys to retain the chain of trust with existing DS records.
* Start generating ECDSAP256SHA256 keys during setup, the current best practice (in addition to RSASHA256 which is also ok). See https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml#dns-sec-alg-numbers-1 and https://www.cloudflare.com/dns/dnssec/ecdsa-and-dnssec/.
* Sign zones using all available keys rather than choosing just one based on the TLD to enable rotation/migration to the new key and to give the user some options since not every registrar/TLD supports every algorithm.
* Allow a user to drop a key from signing specific domains using DOMAINS= in our key configuration file. Signing the zones with extraneous keys may increase the size of DNS responses, which isn't ideal, although I don't know if this is a problem in practice. (Although a user can delete the RSASHA1-NSEC3-SHA1 key file, the other keys will be re-generated on upgrade.)
* When generating zonefiles, add a hash of all of the DNSSEC signing keys so that when the keys change the zone is definitely regenerated and re-signed.
* In status checks, if DNSSEC is not active (or not valid), offer to use all of the keys that have been generated (for RSASHA1-NSEC3-SHA1 on existing installs, RSASHA256, and now ECDSAP256SHA256) with all digest types, since not all registers support everything, but list them in an order that guides users to the best practice.
* In status checks, if the deployed DS record doesn't use a ECDSAP256SHA256 key, prompt the user to update their DS record.
* In status checks, if multiple DS records are set, only fail if none are valid. If some use ECDSAP256SHA256 and some don't, remind the user to delete the DS records that don't.
* Don't fail if the DS record uses the SHA384 digest (by pre-generating a DS record with that digest type) but don't recommend it because it is not in the IANA mandatory list yet (https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml).

See #1953
2021-04-12 19:42:12 -04:00
David Duque
c2f627ea82
update_wkd(): Return 'OK' at the end 2021-03-30 20:32:01 +01:00
David Duque
103ff39500
get_web_domains(): Only return www redirects when asked to (include_www_redirects) 2021-03-30 20:01:46 +01:00
David Duque
aa41702825
When creating reports, do not output the number of days until the key expires 2021-03-30 16:23:08 +01:00
David Duque
a2193289e2
Merge jrsupplee's quota fork 2021-03-30 13:09:35 +01:00
David Duque
071002b755
Changes to the noreply-daemon key 2021-03-30 00:14:00 +01:00
David Duque
127629611b
Force WKD rebuild when importing or deleting keys 2021-03-29 17:54:58 +01:00
David Duque
c260e164eb
Remove print() calls 2021-03-29 17:54:24 +01:00
David Duque
c25a935f2b
strip_and_export(): Parse key contents to determine id's to exclude 2021-03-29 17:14:44 +01:00
David Duque
013f6f2ed1
Don't calculate uidlists when parsing the list, as they're not ordered accurately 2021-03-29 16:32:47 +01:00
David Duque
0f5a5bfbb1
Handle 'KEYEXPIRED' warnings 2021-03-29 16:25:50 +01:00
David Duque
200aefee00
Add data sink to the fork_context decorator 2021-03-29 16:23:42 +01:00
David Duque
353645f8db
Sync with master 2021-03-24 11:05:03 +00:00
David Duque
676f3aaf24 Do not disclose the distro in the admin login page (#9) 2021-03-24 10:06:45 +00:00
David Duque
531e67bcdb Change some status check types to 'Not Applicable' as they do not really qualify as warnings 2021-03-24 10:04:41 +00:00
David Duque
d3cf70db27 Add 'not applicable' status check type 2021-03-24 10:01:05 +00:00
David Duque
13b1b31fb1
Fix email_administrator.py script 2021-03-08 23:54:31 +00:00
David Duque
2827d33597
wkd: Sort by domain (web implementation) 2021-03-08 23:48:40 +00:00
David Duque
046dac6f8f
wkd: Sort the email addresses by domain 2021-03-08 23:39:50 +00:00
David Duque
0085dfbbe2
wkd: Use get_all_mail_addresses() 2021-03-07 23:39:31 +00:00
David Duque
b570cca23c
Final bug-fixing 2021-03-07 23:38:34 +00:00
David Duque
c575aea958
get_all_mail_addresses() umbrella function 2021-03-07 23:28:19 +00:00
David Duque
b3a3136859
remove_noreply_address() - use sanitized address 2021-03-07 23:05:46 +00:00
David Duque
6078a994f2
remove_noreply_address() 2021-03-07 23:05:10 +00:00
David Duque
dca9cc09cd
Do not forget to commit at the end 2021-03-07 23:00:41 +00:00
David Duque
96dec08fca
Noreply backend stub 2021-03-07 22:57:41 +00:00
David Duque
e5eb47b765
Do not use naked domains on the 'From' field
Decreases the chances of spamassassin yeeting the message
to the Spam folder
2021-03-07 20:37:43 +00:00
David Duque
c663363668
Do not disclose the distro in the admin login page (#9) 2021-03-07 20:28:33 +00:00
Joshua Tauberer
6653dbb2e2 Sort the Custom DNS by zone and qname, and add an option to go back to the old sort order (creation order)
Update the zone grouping style on the users and aliases page to match.

Fixes #1927
2021-02-28 09:40:32 -05:00
Joshua Tauberer
d36a2cc938 Enable Backblaze B2 backups
This reverts commit b1d703a5e7 and adds python3-setuptools per the first version of #1899 which fixes an installation error for the b2sdk Python package.
2021-02-28 08:04:14 -05:00
jeremitu
82ca54df96
Fixed #1894 log date over year change, START_DATE < END_DATE now. (#1905)
* Fixed #1894 log date over year change, START_DATE < END_DATE now.

* Corrected mail_log.py argument help and message.

Co-authored-by: Jarek <jarek@box.jurasz.de>
2021-02-28 07:59:26 -05:00
David Duque
3862892568
Do not overwrite domain flags 2021-02-14 00:42:16 +00:00
David Duque
8764a69ea2
Change some status check types to 'Not Applicable' as they do not really qualify as warnings 2021-02-13 02:47:22 +00:00
David Duque
d11d0a1708
Add 'not applicable' status check type 2021-02-13 02:43:03 +00:00
David Duque
a5d7ffe29d
Include 'openpgpkey.domain' on status checks 2021-02-13 02:09:16 +00:00
David Duque
36dd640610
Fix WKD folder permissions and 'touch' file before reading it 2021-02-13 01:42:04 +00:00
David Duque
9b50d05751
Resync with master branch 2021-02-13 01:00:37 +00:00
David Duque
ca96f5f5ba
Fix bugs 2021-02-13 00:53:10 +00:00
David Duque
b165e6157d
Implement flags into nginx building 2021-02-13 00:43:13 +00:00
David Duque
40f73985ea
(WIP) web domain flags 2021-02-12 16:23:26 +00:00
David Duque
4e6aa8f0d2
web: Optimize get_web_domains function. Will use something similar but different internally 2021-02-11 23:19:35 +00:00
David Duque
7e4325afd8
dns: Use A/AAAA records instead of CNAME's 2021-02-11 23:18:52 +00:00
David Duque
75fa24c8e9
Less debugging messages 2021-02-11 01:00:44 +00:00
David Duque
ff71bd2c93
Fix typo 2021-02-11 01:00:32 +00:00
David Duque
824b368891
Client-side POST'ing 2021-02-11 00:56:21 +00:00
David Duque
2fe8522585
Always overwrite the .wkdlist.yml file 2021-02-11 00:55:56 +00:00
David Duque
4f3002090e
Fix PGP forking issues (don't copy pipes/sockets/etc.) 2021-02-11 00:55:10 +00:00
David Duque
d218f771a9
Fix WKD building issues (SHA1 backend, hash encoding) 2021-02-11 00:38:23 +00:00
David Duque
7a2edb11a0
Refactor POST config mechanics 2021-02-11 00:34:36 +00:00
David Duque
4641ec112e
Dirty configuration mechanisms 2021-02-11 00:04:52 +00:00
David Duque
49394741d3
Don't display buttons/dropdowns for emails with no keys 2021-02-10 23:49:32 +00:00
David Duque
704335dc1c
Update button 2021-02-10 23:39:23 +00:00
David Duque
3d777d86d2
Don't wrap email addresses 2021-02-10 15:27:32 +00:00
David Duque
f942be515f
Process key emails 2021-02-10 02:56:00 +00:00
David Duque
867be9ba37
Options field is a set 2021-02-10 02:21:36 +00:00