Commit Graph

66 Commits

Author SHA1 Message Date
Jeremy Lin 455a23361f Clean up datetime output and code
* For clarity, add `UTC` suffix for datetimes in the `Diagnostics` admin tab.
* Format datetimes in the local timezone in the `Users` admin tab.
* Refactor some datetime code and add doc comments.
2020-12-13 19:49:22 -08:00
BlackDex 6faaeaae66 Updated email processing.
- Added an option to enable smtp debugging via SMTP_DEBUG. This will
  trigger a trace of the smtp commands sent/received to/from the mail
server. Useful when troubleshooting.
- Added two options to ignore invalid certificates which either do not
  match at all, or only doesn't match the hostname.
- Updated lettre to the latest alpha.4 version.
2020-11-18 12:07:08 +01:00
BlackDex 6a0d024c69 Format some common Lettre errors a bit simpler
Currently when for example using the admin interface to send out a test e-mail just
returns `SmtpError`. This is not very helpful. What i have done.

- Match some common Lettre errors to return the error message.
- Other errors will just be passed on as before.

Some small other changes:
- Fixed a clippy warning about using clone().
- Fixed a typo where Lettere was spelled with one t.
2020-09-14 20:47:46 +02:00
Daniel García 3c377d97dc
Merge pull request #1137 from BlackDex/smtp-multi-auth-mechanism
Allow multiple SMTP Auth meganisms.
2020-09-13 15:09:58 +02:00
BlackDex c877583979 Allow multiple SMTP Auth meganisms.
- Allow all SMTP Auth meganisms supported by Lettre.
- The config value order is leading and values can be separated by a
  comma ','
- Case doesn't matter, and invalid values are ignored.
- Warning is printed when no valid value is found at all.
2020-09-12 21:47:24 +02:00
BlackDex 844cf70345 Updated lettre (and other crates) and workflow.
General:
- Updated several dependancies

Lettre:
- Updateded lettere and the workflow
- Changed encoding to base64
- Convert unix newlines to dos newlines for e-mails.
- Created custom e-mail boundary (auto generated could cause errors)

Tested the e-mails sent using several clients (Linux, Windows, MacOS, Web).
Run msglint (https://tools.ietf.org/tools/msglint/) on the generated e-mails until all errors were gone.

Lettre has changed quite some stuff compared between alpha.1 and alpha.2, i haven't noticed any issues sending e-mails during my tests.
2020-09-11 23:52:20 +02:00
Daniel García 668d5c23dc
Removed try_trait and some formatting, particularly around imports 2020-07-14 18:34:22 +02:00
Jeremy Lin a28ebcb401 Use local time in email notifications for new device logins
In this implementation, the `TZ` environment variable must be set
in order for the formatted output to use a more user-friendly
time zone abbreviation (e.g., `UTC`). Otherwise, the output uses
the time zone's UTC offset (e.g., `+00:00`).
2020-07-07 21:30:18 -07:00
Daniel García 596c9b8691
Add option to set name during HELO in email settings 2020-07-05 01:59:15 +02:00
Daniel García 5e802f8aa3
Update lettre to alpha release instead of git commit, and update the rest of dependencies while we are at it 2020-05-31 17:58:06 +02:00
Daniel García 6c5e35ce5c
Change the mails content types to more closely match what we sent before 2020-05-07 00:51:46 +02:00
Daniel García 63cbd9ef9c
Update lettre to latest master 2020-05-03 17:41:53 +02:00
Daniel García 9cca64003a
Remove unused dependency and simple feature, update dependencies and fix some clippy lints 2020-05-03 17:24:51 +02:00
Daniel García d2d9fb08cc
Revert "Use opportunistic TLS in SMTP connections" 2020-03-19 13:56:53 +01:00
Daniel García afd9f4e278
Allow the smtp mechanism to be provided without quotes and all lowercase 2020-03-14 22:31:41 +01:00
Samuel Leweke 5d3b765a23 Use opportunistic TLS in SMTP connections
If SSL is disabled, the SMTP ClientSecurity of the lettre crate
defaults to None, that is, an insecure connection. This is changed to
Opportunistic, which uses TLS if available. If TLS is not available,
the insecure connection is used (i.e., this change is backward
compatible).
2020-03-12 11:40:52 +01:00
BlackDex 5a974c7b94 Added SMTP test button in the admin gui
- Added a test button for checking the e-mail settings.
- Fixed a bug with the _post JavaScript function:
  A function was overwriten with a variable and errors were not handled
correctly like a 500 for example.
2020-02-26 16:49:56 +01:00
Daniel García f5916ec396
Fix backwards indices 2020-01-30 22:33:50 +01:00
Daniel García def174a517
Convert email domains to punycode 2020-01-30 22:11:53 +01:00
Daniel García ff7b4a3d38
Update handlebars to 3.0 which included performance improvements.
Updated lettre to newer git revision, which should give better error messages now.
2020-01-26 15:29:14 +01:00
Daniel García a0ece3754b
Formatting 2019-12-27 18:37:14 +01:00
tomuta bd1e8be328 Implement change-email, email-verification, account-recovery, and welcome notifications 2019-11-24 22:28:49 -07:00
BlackDex c52adef919 Added configurable smtp timeout.
- Added config option for smtp timeout
 - Lowered default timeout to 15 seconds instead of default 60.
2019-11-06 21:39:33 +01:00
Daniel García d29b6bee28
Remove unnecessary clones and other clippy fixes 2019-11-02 17:39:01 +01:00
Daniel García df8114f8be
Updated client kdf iterations to 100000 and fixed some lints 2019-09-05 21:56:12 +02:00
Daniel García c07c9995ea
Merge pull request #555 from vverst/email-codes
Add Email 2FA login
2019-08-27 21:07:41 +02:00
ViViDboarder 672a245548 Remove unecessary clone 2019-08-27 10:40:38 -07:00
ViViDboarder 2d2745195e Allow explicitly defined smtp auth mechansim 2019-08-23 16:22:14 -07:00
vpl 0b60f20eb3 Add email message for twofactor email codes 2019-08-03 18:49:34 +02:00
Daniel García c9c3f07171
Updated dependencies and fixed panic getting icons 2019-07-30 19:42:05 +02:00
vpl 60e39a9dd1 Move retrieve/new device from connData to separate function 2019-07-22 12:30:26 +02:00
vpl bc6a53b847 Add new device email when user logs in 2019-07-22 08:26:24 +02:00
Nick Fox 2e300da057
Fix #468 - Percent-encode the email address in invite link 2019-07-02 22:55:13 -04:00
Daniel García 874f5c34bd
Formatting 2019-04-26 22:08:26 +02:00
BlackDex 6b686c18f7 Fixed long e-mail message extending 1000 lines.
- Added quoted_printable crate to encode the e-mail messages.
- Change the way the e-mail gets build to use custom part headers.
2019-03-25 09:48:19 +01:00
Daniel García e93538cea9
Add option to use wrapped TLS in email, instead of STARTTLS upgrade 2019-03-10 14:45:42 +01:00
Daniel García 9e1f030a80
Explicitly close SMTP connection in case of error. 2019-03-07 20:21:10 +01:00
Daniel García 04922f6aa0
Some formatting and dependency updates 2019-03-03 16:11:55 +01:00
Daniel García 79fdfd6524
Add missing url parameter 2019-02-10 21:40:20 +01:00
Daniel García d086a99e5b
Implemented HTML emails with text alternative 2019-02-10 19:12:34 +01:00
Daniel García 8b4a6f2a64
Fixed some clippy lints and changed update_uuid_revision to only use one db query 2019-02-08 18:45:07 +01:00
Daniel García 86ed75bf7c
Config can now be serialized / deserialized 2019-02-06 17:34:29 +01:00
Daniel García 700e084101
Add 2FA icon to admin panel 2019-01-25 18:50:57 +01:00
Daniel García a1dc47b826
Change config to thread-safe system, needed for a future config panel.
Improved some two factor methods.
2019-01-25 18:24:57 +01:00
Daniel García bfd93e5b13
Show organizations in admin panel, implement reload templates option 2019-01-20 17:43:56 +01:00
Daniel García 97aa407fe4
Move email templates to subfolder 2019-01-19 17:40:18 +01:00
Daniel García 0e4a746eeb
Added SMTP_FROM_NAME 2019-01-15 15:28:47 +01:00
Daniel García 19b6bb0fd6
Initial stab at templates 2019-01-15 15:28:46 +01:00
Daniel García 50eeb4f651
Remove whitespace before processing tokens 2019-01-07 20:37:14 +01:00
Nick Fox 0a74e79cea
Refactor generate_invite_claims, make org_name and org_id optional 2019-01-05 23:03:49 -05:00