mox/testdata
Mechiel Lukkien 09fcc49223
add a webapi and webhooks for a simple http/json-based api
for applications to compose/send messages, receive delivery feedback, and
maintain suppression lists.

this is an alternative to applications using a library to compose messages,
submitting those messages using smtp, and monitoring a mailbox with imap for
DSNs, which can be processed into the equivalent of suppression lists. but you
need to know about all these standards/protocols and find libraries. by using
the webapi & webhooks, you just need a http & json library.

unfortunately, there is no standard for these kinds of api, so mox has made up
yet another one...

matching incoming DSNs about deliveries to original outgoing messages requires
keeping history of "retired" messages (delivered from the queue, either
successfully or failed). this can be enabled per account. history is also
useful for debugging deliveries. we now also keep history of each delivery
attempt, accessible while still in the queue, and kept when a message is
retired. the queue webadmin pages now also have pagination, to show potentially
large history.

a queue of webhook calls is now managed too. failures are retried similar to
message deliveries. webhooks can also be saved to the retired list after
completing. also configurable per account.

messages can be sent with a "unique smtp mail from" address. this can only be
used if the domain is configured with a localpart catchall separator such as
"+". when enabled, a queued message gets assigned a random "fromid", which is
added after the separator when sending. when DSNs are returned, they can be
related to previously sent messages based on this fromid. in the future, we can
implement matching on the "envid" used in the smtp dsn extension, or on the
"message-id" of the message. using a fromid can be triggered by authenticating
with a login email address that is configured as enabling fromid.

suppression lists are automatically managed per account. if a delivery attempt
results in certain smtp errors, the destination address is added to the
suppression list. future messages queued for that recipient will immediately
fail without a delivery attempt. suppression lists protect your mail server
reputation.

submitted messages can carry "extra" data through the queue and webhooks for
outgoing deliveries. through webapi as a json object, through smtp submission
as message headers of the form "x-mox-extra-<key>: value".

to make it easy to test webapi/webhooks locally, the "localserve" mode actually
puts messages in the queue. when it's time to deliver, it still won't do a full
delivery attempt, but just delivers to the sender account. unless the recipient
address has a special form, simulating a failure to deliver.

admins now have more control over the queue. "hold rules" can be added to mark
newly queued messages as "on hold", pausing delivery. rules can be about
certain sender or recipient domains/addresses, or apply to all messages pausing
the entire queue. also useful for (local) testing.

new config options have been introduced. they are editable through the admin
and/or account web interfaces.

the webapi http endpoints are enabled for newly generated configs with the
quickstart, and in localserve. existing configurations must explicitly enable
the webapi in mox.conf.

gopherwatch.org was created to dogfood this code. it initially used just the
compose/smtpclient/imapclient mox packages to send messages and process
delivery feedback. it will get a config option to use the mox webapi/webhooks
instead. the gopherwatch code to use webapi/webhook is smaller and simpler, and
developing that shaped development of the mox webapi/webhooks.

for issue #31 by cuu508
2024-04-15 21:49:02 +02:00
..
ctl add a webapi and webhooks for a simple http/json-based api 2024-04-15 21:49:02 +02:00
dmarc-reports mox! 2023-01-30 14:27:06 +01:00
dmarcdb implement outgoing dmarc aggregate reporting 2023-11-02 09:12:30 +01:00
dsn deprecate having only localparts in an Account's Destinations, it should always be a full email address 2023-03-09 22:13:56 +01:00
httpaccount add a webapi and webhooks for a simple http/json-based api 2024-04-15 21:49:02 +02:00
imap prevent unicode-confusion in password by applying PRECIS, and username/email address by applying unicode NFC normalization 2024-03-09 09:20:29 +01:00
imapserverfuzz for fuzzing the imapserver and smtpserver use different config files than regular tests 2023-05-22 15:37:03 +02:00
imaptest deprecate having only localparts in an Account's Destinations, it should always be a full email address 2023-03-09 22:13:56 +01:00
importtest.maildir add funtionality to import zip/tgz with maildirs/mboxes to account page 2023-02-16 09:57:27 +01:00
integration in quickstart, check outgoing smtp connectivity by dialing gmail.com mx host 2024-03-27 09:35:16 +01:00
junk mox! 2023-01-30 14:27:06 +01:00
message add pedantic mode (used by localserve) that refuses some behaviour that is invalid according to specifications and that we normally accept for compatibility 2023-03-12 15:16:01 +01:00
queue add a webapi and webhooks for a simple http/json-based api 2024-04-15 21:49:02 +02:00
smtp prevent unicode-confusion in password by applying PRECIS, and username/email address by applying unicode NFC normalization 2024-03-09 09:20:29 +01:00
smtpservercatchall simplify .gitignore, just on line for ignoring all the testdata/*/data directories 2023-11-09 19:47:33 +01:00
smtpserverfuzz for fuzzing the imapserver and smtpserver use different config files than regular tests 2023-05-22 15:37:03 +02:00
smtpserverquota add per-account quota for total message size disk usage 2023-12-20 20:54:12 +01:00
smtpserversendlimit simplify .gitignore, just on line for ignoring all the testdata/*/data directories 2023-11-09 19:47:33 +01:00
smtpsmuggle add faq for smtp smuggling, fix bug around handling "\nX\n" for any X, reject bare carriage returns and possibly smtp-smuggling attempts 2024-01-01 20:11:16 +01:00
store deprecate having only localparts in an Account's Destinations, it should always be a full email address 2023-03-09 22:13:56 +01:00
tlsreports work around missing timezone in timestamps in tls reports from microsoft 2023-02-05 10:55:34 +01:00
tlsrptsend implement outgoing tls reports 2023-11-09 19:47:26 +01:00
web deprecate having only localparts in an Account's Destinations, it should always be a full email address 2023-03-09 22:13:56 +01:00
webadmin replace http basic auth for web interfaces with session cookie & csrf-based auth 2024-01-05 10:48:42 +01:00
webapisrv add a webapi and webhooks for a simple http/json-based api 2024-04-15 21:49:02 +02:00
webmail prevent unicode-confusion in password by applying PRECIS, and username/email address by applying unicode NFC normalization 2024-03-09 09:20:29 +01:00
webserver implement transparent gzip compression in the webserver 2023-08-21 21:52:35 +02:00
websocket add reverse proxying websocket connections 2023-05-30 22:11:31 +02:00
importtest.maildir.tgz implement storing non-system/well-known flags (keywords) for messages and mailboxes, with imap 2023-06-24 00:24:43 +02:00
importtest.mbox add funtionality to import zip/tgz with maildirs/mboxes to account page 2023-02-16 09:57:27 +01:00
importtest.mbox.zip implement storing non-system/well-known flags (keywords) for messages and mailboxes, with imap 2023-06-24 00:24:43 +02:00