1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00
Commit Graph

41 Commits

Author SHA1 Message Date
James Hillyerd
5a5864fde6 storage test: fix failures on windows (#457)
* storage test: close source reader
* fstore: properly close directory handle
2023-12-12 19:31:14 -08:00
James Hillyerd
32b83e6345 test: preserve SYSTEMROOT on windows (#451) 2023-11-29 16:36:40 -08:00
James Hillyerd
41889ee83a test: impl StoreStub.PurgeMessages (#444)
Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-11-21 14:56:21 -08:00
James Hillyerd
1b5a783dbd test: impl StoreStub.MarkSeen (#443)
* test: impl StoreStub.MarkSeen

Signed-off-by: James Hillyerd <james@hillyerd.com>

* continue to Message interface in StoreStub

Signed-off-by: James Hillyerd <james@hillyerd.com>

* test errors

Signed-off-by: James Hillyerd <james@hillyerd.com>

---------

Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-11-18 11:21:09 -08:00
James Hillyerd
208d20582e test: Add tests for StoreStub (#440)
Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-11-17 16:34:49 -08:00
James Hillyerd
01fb161df8 extension: BeforeMessageStored event to rewrite envelope (#417)
* extension: add InboundMessage type
* manager: fires BeforeMessageStored event
* manager: Reacts to BeforeMessageStored event response
* manager: Apply BeforeMessageStored response fields to message

Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-11-06 14:53:38 -08:00
James Hillyerd
9836c0ffbb go: update mod and imports to correctly reflect major version (#388) 2023-09-09 12:36:21 -07:00
guangwu
0ae452ed17 chore: remove refs to deprecated io/ioutil (#376)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-08-07 16:25:36 -07:00
James Hillyerd
36095a2cdf extension: split out an async specific broker for "after" events (#346)
Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-02-16 16:17:06 -08:00
James Hillyerd
a55da8b7d1 file & mem stores should emit delete events on purge (#338)
Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-02-14 19:51:42 -08:00
James Hillyerd
69b6225554 storage: emit AfterMessageDeleted events (#334)
* Ignore test lua script

Signed-off-by: James Hillyerd <james@hillyerd.com>

* Wire ExtHost into storage system
imports

Signed-off-by: James Hillyerd <james@hillyerd.com>

* storage/file: emit deleted events

Signed-off-by: James Hillyerd <james@hillyerd.com>

* storage/mem: emit deleted events

Signed-off-by: James Hillyerd <james@hillyerd.com>

---------

Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-02-13 17:11:04 -08:00
James Hillyerd
5adef42df7 Replace message.Metadata usage with event.MessageMetadata (#333)
Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-02-13 13:52:28 -08:00
James Hillyerd
8fd5cdfc86 extension: Add BeforeMailAccepted event (#320)
Signed-off-by: James Hillyerd <james@hillyerd.com>

Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-01-22 18:01:56 -08:00
James Hillyerd
f0d457b8f5 extension: Add MessageStored event (#316)
* Replace existing direct StoreManager->msghub communication with this
  event
* For #280 #309 #312 #310

Signed-off-by: James Hillyerd <james@hillyerd.com>

Signed-off-by: James Hillyerd <james@hillyerd.com>
2023-01-16 21:30:47 -08:00
James Hillyerd
eae4926b23 Dependency injection improvements (#288)
Refactor server life-cycle into it's own file, make service startup and monitoring more consistent and testable.

* Extract services creation in preparation for DI
* pop3: rename New to NewServer
* lifecycle: Add fatal error Notify()
* web: Introduce Server struct w/ Notify()
* Extract Start in lifecycle
* Add Start() to Hub
* RetentionScanner startup consistent with other svcs
* Remove global shutdown channel
* Implement a readiness notification system
2022-08-13 13:22:34 -07:00
Abirdcfly
29d1ed1e7f delete minor unreachable code caused by t.Fatal (#287)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-08-10 08:59:09 -07:00
James Hillyerd
1f1a8b4192 Handle IP address domains (#285)
* Add basic TestRecipientAddress tests

* Handle forward-path route spec

* Validate IP addr "domains"

* Forward-path test cases

* Add integration test

* Add IPv4 recip swaks test

* Special case domain mailbox extraction

* add IPv6 swaks test

* Formatting

Signed-off-by: James Hillyerd <james@hillyerd.com>

* Update changelog
2022-08-07 20:13:58 -07:00
James Hillyerd
e4c48a0705 go code: rename to github.com/inbucket/inbucket 2019-02-24 09:43:10 -08:00
James Hillyerd
523c04a522 Logging improvements, handler extraction.
- rest: improve error logging.
- web: extract handlers/middleware into their own file.
- web: log all requests, not just ones hitting our handlers.
- test: improve integration test logging format.
2018-11-12 20:38:00 -08:00
James Hillyerd
7a5459ce08 test: Fix integation test server startup 2018-11-12 20:38:00 -08:00
James Hillyerd
60db73b813 test: Correctly shutdown integration test server 2018-11-03 18:53:24 -07:00
James Hillyerd
30e3892cb0 webui, rest: Render UTF-8 addresses correctly, fixes #117 2018-10-22 18:29:03 -07:00
James Hillyerd
fcb4bc20e0 test: Add basic integration test suite, closes #119 2018-10-22 16:25:27 -07:00
James Hillyerd
8a3d2ff6a2 storage: Add test for id='latest', implment in mem store. 2018-10-22 15:43:17 -07:00
James Hillyerd
12f98868ba smtp/policy: Store messages with full naming for #33
- Added some tests to make sure stores do not enforce their own naming.
- Improve recipient structured logging.
2018-04-07 13:06:56 -07:00
James Hillyerd
939ff19991 policy: Tie mailbox extraction to Addressing for #33 2018-04-02 20:15:50 -07:00
James Hillyerd
dc02092cf6 rest: Implement MarkSeen for #58
- message: Add MarkSeen to Manager, StoreManager.
- rest: Add PATCH for /mailbox/name/id.
- rest: Add MailboxMarkSeenV1 handler.
- rest: Add Seen to model.
- rest: Update handlers to set Seen.
- rest: Add doJSONBody func.
2018-04-01 13:30:43 -07:00
James Hillyerd
cc5cd7f9c3 storage: Add Seen flag, tests for #58 2018-04-01 13:30:43 -07:00
James Hillyerd
412b62d6fa storage/mem: implement size enforcer for #88 2018-03-24 20:27:05 -07:00
James Hillyerd
b42ea130ea storage/mem: implement message cap for #88
- Move message cap tests into storage test suite.
- Update change log.
2018-03-24 14:36:23 -07:00
James Hillyerd
30a329c0d3 Renames, closes #69
- storage: rename StoreMessage to Message
- storage: rename Message.RawReader() to Source()
2018-03-17 17:56:06 -07:00
James Hillyerd
a22412f65e manager: Add MailboxForAddress(), calls policy pkg #84 2018-03-17 15:17:44 -07:00
James Hillyerd
e84b1f8952 storage: Make locking an implementation detail for #69
- file: Store handles its own locking #77
- file: Move mbox into its own file
- file & test: remove LockFor()
2018-03-17 14:02:50 -07:00
James Hillyerd
9b3d3c2ea8 test: Finish initial storage test suite, closes #82 2018-03-16 22:43:32 -07:00
James Hillyerd
5e13e50763 test: Start work on test suite for #82
- smtp: Tidy up []byte/buffer/string use in delivery #69
2018-03-14 22:51:40 -07:00
James Hillyerd
2cc0da3093 storage: More refactoring for #69
- impl Store.AddMessage
- file: Use AddMessage() in tests
- smtp: Switch to AddMessage
- storage: Remove NewMessage, Append, Close methods
2018-03-14 20:37:20 -07:00
James Hillyerd
10bc07a18e message: Implement service layer, stubs for #81
I've made some effort to wire the manager into the controllers, but
tests are currently failing.
2018-03-12 20:21:59 -07:00
James Hillyerd
487e491d6f storage: Message refactoring for #69
- Message interface renamed to StoreMessage
- Message.Delete becomes Store.RemoveMessage
- Added deleted message tracking to Store stub for #80
2018-03-11 15:01:40 -07:00
James Hillyerd
137466f89b storage: Move NewMessage() into Store interface for #69 2018-03-11 10:48:50 -07:00
James Hillyerd
d9b5e40c87 storage: More refactoring for #69
- retention: Start from pkg main instead of server/smtp
- file: Remove DefaultStore() constructor
- storage: AllMailboxes replaced with VisitMailboxes for #69
- test: Stub VisitMailboxes for #80
2018-03-10 22:05:10 -08:00
James Hillyerd
9c18f1fb30 Large refactor for #69
- makefile: Don't refresh deps automatically, causes double build
- storage: Move GetMessage, GetMessages (Mailbox), PurgeMessages to the
  Store API for #69
- storage: Remove Mailbox.Name method for #69
- test: Create new test package for #79
- test: Implement StoreStub, migrate some tests off MockDataStore for
  task #80
- rest & webui: update controllers to use new Store methods
2018-03-10 19:34:51 -08:00