61 Commits

Author SHA1 Message Date
Alberto Bertogli
c34c073c1c chasquid: Load and resolve aliases
This patch integrates the aliases resolution into the daemon and queue.

The queue now will resolve aliases at Put time.
2016-10-10 00:51:04 +01:00
Alberto Bertogli
bab8a8083c queue: Support sending to pipes
With the introduction of aliases, the queue may now be delivering mail to
pipes. This patch implements pipe delivery.

It uses a fixed 30s timeout for now, as these commands should really not take
much time, and we don't want to overly complicate the configuration for now.
2016-10-10 00:51:04 +01:00
Alberto Bertogli
aacf8ffea7 queue: Implement persistency
This patch makes the queue read and write items to disk.

It uses protobuf for serialization. We serialize to text format to make
manual troubleshooting easier, as the performance difference is not very
relevant for us.
2016-10-10 00:51:04 +01:00
Alberto Bertogli
aac2d3c061 Minor style and simplification cleanups
This patch does various minor style and simplification cleanups, fixing things
detected by tools such as go vet, gofmt -s, and golint.

There are no functional changes, this change is purely cosmetic, but will
enable us to run those tools more regularly now that their output is clean.
2016-09-12 04:06:56 +01:00
Alberto Bertogli
9d172a6ea0 Make the queue aware of local and remote couriers
The routing courier is a nice idea in theory, but at least for now, we want
the queue to be aware of when a destination is local so we can implement
differentiated logic.

This may change in the future, though, but at the moment it's not clear that
the abstractions will be worth it.

So this patch removes it, and makes the queue do the routing. There is no
difference in how the two are handled yet, those will come in subsequent
patches.
2016-07-22 01:44:45 +01:00
Alberto Bertogli
831ef13132 queue: Add a mutex to protect item's results
The item results get accessed in various places concurrently, so this patch
adds a mutex to protect it.
2016-07-22 01:44:45 +01:00
Alberto Bertogli
17c536f5e3 queue: Incremental delays
This patch introduces incremental delays in the queue, so retries are not all
done with the same delay.

The table is static; we could perturb it but there's not that much benefit
anyway, at least for now.
2015-11-13 03:41:06 +00:00
Alberto Bertogli
4de805ab34 queue: Send mails in parallel
This patch makes queue items deliver mail in parallel to all recipients.
2015-11-13 03:41:06 +00:00
Alberto Bertogli
77d547288f Implement couriers
This patch introduces the couriers, which the queue uses to deliver mail.

We have a local courier (using procmail), a remote courier (uses SMTP), and a
router courier that decides which of the two to use based on a list of local
domains.

There are still a few things pending, but they all have their basic
functionality working and tested.
2015-11-13 03:41:06 +00:00
Alberto Bertogli
fbf1060b71 Introduce a trace wrapper
This patch introduces a wrapper to golang.org/x/net/trace with a new method
that will be useful later on, making logging and tracing less verbose.
2015-11-06 10:27:11 +00:00
Alberto Bertogli
58de5a6200 Add a skeleton queue
This patch introduces a basic, in-memory queue that only holds emails for now.

This slows down the benchmarks because we don't yet have a way to wait for
delivery (even if fake), that will come in later patches.
2015-11-06 10:27:05 +00:00