1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 01:57:02 +00:00
Commit Graph

68 Commits

Author SHA1 Message Date
James Hillyerd
8e66be63f5 Retention scanner respects global shutdown
- Clean up vars in retention.go
- Check globalShutdown in several parts of the retention scanner
- smtpd.Drain() now waits for scanner to shut down
- Closes #22
2016-02-29 21:56:29 -08:00
James Hillyerd
28adcf0437 Graceful shutdown on error for httpd, smtpd, pop3d 2016-02-29 20:21:49 -08:00
James Hillyerd
4b4121bb3a Use channels to communicate shutdown request
- httpd now uses shutdown channel
- smtpd now uses shutdown channel
- pop3d now uses shutdown channel
- timedExit now removes PID file
- tidy up some struct instantiations, var blocks
2016-02-28 23:48:09 -08:00
James Hillyerd
982ad857e8 Take care of more TODO flagged code
- Improve TODO comments, mention related issues
- Export ErrNotWritable, move it to datastore.go
- Improve logging of corrupt mailbox GOB file
2016-02-28 16:14:37 -08:00
James Hillyerd
3f654e48be Fix retention tests on Windows 2016-02-28 13:42:17 -08:00
James Hillyerd
e6b7e335cb Follow meta-linter recommendations for all of Inbucket
- Rename BUILD_DATE to BUILDDATE in goxc
- Update travis config
- Follow linter recommendations for inbucket.go
- Follow linter recommendations for config package
- Follow linter recommendations for log package
- Follow linter recommendations for pop3d package
- Follow linter recommendations for smtpd package
- Follow linter recommendations for web package
- Fix Id -> ID in templates
- Add shebang to REST demo scripts
- Add or refine many comments
2016-02-22 00:16:45 -08:00
James Hillyerd
affcc01d19 Convert test message lengths to int64 to fix tests 2015-05-02 10:34:33 -07:00
James Hillyerd
88ae99abb0 Reformat *.go with goimports command 2014-05-19 19:40:33 -07:00
James Hillyerd
63084c67b9 Support numeric domain-parts, closes #24 2014-05-19 19:08:39 -07:00
James Hillyerd
d98e6a2b58 Missing message is now 404 instead of 500
- Added smtpd.ErrNotExist to make detecting missing message easier
- Return 404 instead of 500 when requesting a non-extistant message
- More REST unit tests
2013-11-14 15:08:46 -08:00
James Hillyerd
46fa714cc7 Add configurable mailbox message cap
- Add new configuration option [datastore]mailbox.message.cap
- Modify filestore to enforce message cap if value > 0
- Filestore unit tests for message cap when enabled & disabled
- Change to DataStore.Mailbox.NewMessage() interface to allow error
  return
2013-11-12 10:42:39 -08:00
James Hillyerd
2e1c937d23 Now adds a Recieved: header to raw message 2013-11-09 12:57:45 -08:00
James Hillyerd
df11575b3a Handle missing .raw better, closes #19
- Add filestore unit tests to exercise #19
- Move deferred file close under error check
- Handle error message from server gracefully on message click
- Scroll to top of page when message loads successfully
2013-11-09 08:47:20 -08:00
James Hillyerd
d80521b24d Use MockDataStore for handler_test.go 2013-11-06 17:18:56 -08:00
James Hillyerd
ef48b9c2dd Extend ParseMailboxName()
- Checks for invalid characters, returns useful error if it finds them
- Extended unit tests for ParseMailboxName
- Closes #6
2013-11-06 15:36:46 -08:00
James Hillyerd
6b606ebb9b SMTP, logging changes
- smtpd/handler uses ParseEmailAddress() when opening mailbox and
  checking domainNoStore
- Added host info to logging for both SMTP and POP3, closes #16
2013-11-05 15:18:19 -08:00
James Hillyerd
a0a5a9acb0 Wire address validation into MAIL & RCPT handlers 2013-11-05 12:12:25 -08:00
James Hillyerd
596b268380 Completed ParseEmailAddress() 2013-11-04 17:02:17 -08:00
James Hillyerd
193a5f6f13 Commit incomplete ParseEmailAddress() 2013-11-04 16:18:30 -08:00
James Hillyerd
21ad7a2452 Checkpoint before converting Validator->Parser 2013-11-04 14:00:23 -08:00
James Hillyerd
bd4db645bb ValidateLocalPart: Handle backslash quoted chars 2013-11-03 20:53:37 -08:00
James Hillyerd
ba943cb682 Initial version of ValidateLocalPart
Does not support any quoting yet, not RFC compliant
2013-11-03 10:25:34 -08:00
James Hillyerd
b2c3c4ce0f More testing
Test DATA on handler
Add a 2 second wait if the test fails so that all the logging data can
be collected.
2013-10-30 14:42:55 -07:00
James Hillyerd
038f4fafd3 Capture log output during unit tests 2013-10-30 11:43:35 -07:00
James Hillyerd
f34a73f8a6 Domain validator + tests (unwired) 2013-10-29 20:40:47 -07:00
James Hillyerd
e5b6ed2230 Add many more SMTP handler tests 2013-10-29 17:01:54 -07:00
James Hillyerd
38c124875e Prevent panic when submitting an empty message 2013-10-29 17:01:21 -07:00
James Hillyerd
00243a622f Framework for testing SMTP over Pipe() connection 2013-10-29 13:58:21 -07:00
James Hillyerd
5ccd6b2044 Inversion of Control for smtpd.Server
Allow more control over how Server is instaniated so that it can be unit
tested.
2013-10-29 10:27:55 -07:00
James Hillyerd
483ddc1c5e Track retained messages over time 2013-10-25 15:24:30 -07:00
James Hillyerd
ea7274e5dd Fix bad Fatalf's, release 1.0-rc1 2013-10-17 16:06:17 -07:00
James Hillyerd
6679ce9250 Replace panic() with t.Fatalf where possible 2013-10-14 15:50:07 -07:00
James Hillyerd
1e85699ccf Add REST call for purging an entire mailbox 2013-10-14 15:35:09 -07:00
James Hillyerd
46d4f7be1d Message size calculation changes
Message sizes are now calculated as the message is written out to disk,
and saved into the index.gob file
2013-10-13 21:03:51 -07:00
James Hillyerd
52771e19b6 Finishing up index.gob work
- Wrote more unit tests to make sure filestore behaves as expected
 - Renamed NewFileDataStore to DefaultFileDataStore, implemented a new
   NewFileDataStore for unit tests.
 - filestore now removes entire mailbox dir when last message is deleted
2013-10-13 11:46:20 -07:00
James Hillyerd
08f16db7ac More index.gob work
Use a global lock for reading/writing any index file.  Possible
bottleneck, but good enough for now.

Don't create a mailbox directory until a message is being written to it.
2013-10-11 20:06:33 -07:00
James Hillyerd
9354b9692f First crack at single gob per mailbox, hardly works 2013-10-09 21:43:45 -07:00
James Hillyerd
62b4abf26e Fix broken MockMessage 2013-10-01 14:05:16 -07:00
James Hillyerd
c9392c7eb1 Wired character-set decoding into From and Subject
- Removed extra message object from ReadBody() return type
 - We now use enmime's GetHeader() when building the GOB, this will get
   us alternate character set decoding for the From and Subject headers.
 - Added a swaks test with a utf-8 subject line
2013-10-01 14:01:08 -07:00
James Hillyerd
2e78e4e6f7 Logging and unit test changes
Logging methods were renamed so they don't trigger go-vet warnings for
error() and Error() formatting.

Unit tests were updated to use new github.com/stretchr repo (was renamed
from stretchrcom)

Missing methods were added to Message mock object.
2013-09-13 14:06:57 -07:00
James Hillyerd
f50061ac82 Handle space after "MAIL FROM:" for Outlook SMTP 2013-09-13 09:01:36 -07:00
James Hillyerd
06ce860435 Impl deletes, update SMTP session tracing 2013-09-12 17:00:08 -07:00
James Hillyerd
01f6ad514b Started impl DELE 2013-09-12 15:55:45 -07:00
James Hillyerd
983b4f745a More basic POP3 implementation
Filestore/Datastore now supports a Size() method.
2013-09-10 17:56:04 -07:00
James Hillyerd
9ee9afe5cc More shutdown work, closes #11
- Drain SMTP connections
- Force exit after 15 seconds of draining
2012-11-16 21:29:53 -08:00
James Hillyerd
7ccef7b977 Basic SIGTERM handling 2012-11-16 20:44:41 -08:00
James Hillyerd
cabc5f0d2b Metrics: rename Delivered to Received, closes #10 2012-11-14 17:36:39 -08:00
James Hillyerd
afe14da506 Metrics improvements
- Label graphs by their duration, not update period
- Extend to 60 units so they are either 10 minutes or an hour of data
- Improvements to retention information
- Change javascript calculations, fixes #9 (I hope)
2012-11-14 17:22:25 -08:00
James Hillyerd
b8f2527b93 Mixed use support
You can now optionally configure a "no store" domain.  When inbucket
receives a message destined for a user at that domain, it will accept
the message but not store it to disk.  This allows the same instance
of Inbucket to be shared by people who wish to view email content and
those who want to load test.
2012-11-07 15:26:15 -08:00
James Hillyerd
afe0d779cb Replace internal MIME with go.enmime 2012-11-04 13:25:24 -08:00