Commit graph

48 commits

Author SHA1 Message Date
Aine
307aca7f23
refactor smtp 2022-11-10 13:26:12 +02:00
Aine
9cfe0a6d4f
show multi-domain aliases everywhere 2022-11-08 21:21:06 +02:00
Aine
42cb5221a1
spamlist wildcards 2022-10-16 20:14:54 +03:00
Aine
6f4da59387
feedback, typos, renaming 2022-10-10 09:41:22 +03:00
Aine
99e509ea3a
Email validations 2022-10-08 00:11:48 +03:00
Aine
6f8e850103
expose security and spam options 2022-10-07 23:24:59 +03:00
Aine
70ef60c934
add 'norecipient' room option, closes #35 2022-10-07 23:07:57 +03:00
Aine
4c6b7c2c1a
set Content-Transfer-Encoding header, fixes #32 2022-10-04 21:10:56 +03:00
Aine
ed5765b42a
move seding files and work with account data to the linkpearl level 2022-10-02 13:51:58 +03:00
Aine
f585e6ba06
fix !pm send parsing 2022-09-23 18:16:39 +03:00
Aine
4bf0f0dee3
switch to password hashes 2022-09-23 11:17:34 +03:00
Aine
ce53d85806
Merge branch 'main' into expose-mta 2022-09-23 10:44:00 +03:00
Aine
3f5a1cd915
rename local to incoming 2022-09-23 10:33:25 +03:00
Aine
d50b79a801
switch email address validation to mail.ParseAddress 2022-09-23 10:29:37 +03:00
Aine
5a19ffad08
securely compare passwords, add notice about message removal 2022-09-23 10:19:25 +03:00
Aine
7473ed9450
send emails in unicode, fixes #31 2022-09-22 22:23:47 +03:00
Aine
070a6ffc76
use postmoogle as general purpose SMTP server and allow other apps or scripts to send emails through it 2022-09-22 18:21:17 +03:00
Aine
97aacbf143
export MXID patterns parsing to external lib 2022-09-14 13:46:56 +03:00
Aine
14c0ebf1f1
fix attachments msg type parser 2022-09-13 18:35:19 +03:00
Aine
76bffd931c
correctly handle attachments mimetype and set proper msgtype, fixes #27 2022-09-13 17:21:00 +03:00
Aine
31a1399736
fix dkim signature (domain), fixes #21 2022-09-08 00:11:10 +03:00
Aine
78210e6487
update utils.RelatesTo and utils.EventParent comments 2022-09-06 22:52:40 +03:00
Slavi Pantaleev
ca758f8825 Apply 1 suggestion(s) to 1 file(s) 2022-09-06 19:49:30 +00:00
Slavi Pantaleev
321d1da79f Apply 1 suggestion(s) to 1 file(s) 2022-09-06 19:49:13 +00:00
Slavi Pantaleev
bac3447db2 Apply 1 suggestion(s) to 1 file(s) 2022-09-06 19:49:02 +00:00
Aine
86890c1f89
refactor email.Compose() 2022-09-06 22:48:37 +03:00
Aine
085cdf5dbf
refactor email2content 2022-09-06 18:39:35 +03:00
Aine
7d435f7ba8
move email composing to utils 2022-09-05 20:38:58 +03:00
Aine
2427d41ae3
move parsing of !pm send to utils, update !pm send instructions 2022-09-05 20:10:07 +03:00
Aine
fda0d62087
send emails 2022-09-04 22:09:53 +03:00
Aine
bf970fc699
remove duplications in utils.Mailbox 2022-08-31 10:24:17 +03:00
Slavi Pantaleev
e59f5d5502 Make Match() with empty list not return a positive result
Now that we use Match() in allowAdmin() as well, it's awkward to
have it return `true` when called with an empty admin list.
No admins defined was taken to mean "everyone is an admin".

We can either have a `len(users) == 0` check in `allowAdmin` which
rejects the request, or we can change `Match()` so that it doesn't
return positive responses when called with an empty list. Doing the
latter sounds better. It's more natural that matching against an empty list
will yield "no match".
2022-08-29 14:10:52 +03:00
Aine
6623251695
refactored 2022-08-29 12:30:43 +03:00
Slavi Pantaleev
dc5ed41723 Merge branch 'main' into 'user-whitelisting'
# Conflicts:
#   bot/bot.go
2022-08-28 14:50:57 +00:00
Aine
6eae1a65c4
add utils.UnwrapError() to provide meaningful error messages 2022-08-27 22:38:23 +03:00
Slavi Pantaleev
275ccbd9e5 Implement feedback 2022-08-27 08:11:36 +03:00
Slavi Pantaleev
bb754f9aa8 Simplify MatchUserWithAllowedRegexes
This used to return an error back when it was dealing with wildcards
(which may or may not have compiled to a valid regex).

But it now deals with pre-compiled regexes and has no chance of failing,
so we need no `error` returns.
2022-08-27 07:50:43 +03:00
Slavi Pantaleev
f8a168b8e7 Add a few more unit test cases 2022-08-27 07:50:43 +03:00
Slavi Pantaleev
8ad2e29930 Add support for configuring user whitelisting
This does not do anything useful just yet.
It will be hooked to access control checks later on.

Wildcards are converted to regular expressions, because it was simpler
to do that than to write (or include) some ugly wildcard matcher library.
It also provides more flexibility, should we wish to use it later.
Regular expressions should also work well performance-wise.

We compile wildcards to regexes early on (during configuration
processing) and fail if we detect a bad pattern. This is meant to
catch various problems (typos or other mistakes) that could happen.

For this to work, configuration building had to be redone, since it can
now return an error. This may be useful in the future for validating
other configuration settings.

Related to https://gitlab.com/etke.cc/postmoogle/-/issues/1
2022-08-27 07:50:41 +03:00
Aine
f2d81495dc
refactor Send(), fixes #6 2022-08-26 23:06:20 +03:00
Aine
331c2a8d5e
strip <style> in html emails 2022-08-25 21:27:00 +03:00
Aine
f9cf94c914
threads 2022-08-24 21:28:30 +03:00
Aine
d021e6715e
Revert "visual fixes"
This reverts commit 34735b2614.
2022-08-24 12:09:23 +03:00
Aine
34735b2614
visual fixes 2022-08-24 12:02:41 +03:00
Aine
e5e9be528b
refactor options to be more generic 2022-08-23 21:58:05 +03:00
Aine
81abe8c785
unoptimal refactoring 2022-08-23 19:23:15 +03:00
Aine
69f20e5670
try to receive attachments 2022-08-22 18:43:12 +03:00
Aine
e6d5e81efe
bugfixes; email parsing; send emails into matrix rooms; e2e tests 2022-08-22 12:28:29 +03:00