MiddleMail is an email sending middleware: It offers an API for transaction email delivery and activity logging and acts as a middleware for other delivery services. Because all parts of MiddleMail are pluggable it can be used in different configurations for both production and staging applications: E.g. you can turn off actual delivery for a staging deployment but leave activity logging enabled to view recent email activity.
The three most important concepts in MiddleMail are MessageSource, Storage and Delivery.
A MiddleMail.IMessageSource
defines how MiddleMail consumes emails. Those emails then enter the processing pipeline.
To persist information about email activity MiddleMail uses a MiddleMail.IStorage
.
Depending on the implementation this makes email activity easily searchable and debuggable.
For actual delivery an MiddleMail.IMailDeliverer
is used: MiddleMail.Delivery.Smtp
implements such a deliverer for SMTP but it is easy to plugin your prefered Email Delivery SaaS or disable delivery for debugging and testing.
The following table lists the configurable parameters for MiddleMail. To pass them as environment variables on bash replace :
with __
.
Parameter | Description |
---|---|
MiddleMail:Delivery:Smtp:Server |
Hostname of the upstream SMTP server |
MiddleMail:Delivery:Smtp:Port . |
Port of the SMTP server |
MiddleMail:Delivery:Smtp:Username |
Username for the SMTP connection |
MiddleMail:Delivery:Smtp:Password |
Password for the SMTP connection |
MiddleMail:Delivery:MimeMessage:MessageIdDomainPart |
Domain part of the message id as in <[email protected]> used to construct the message id of a mime message. |
MiddleMail:ExponentialBackoff:Multiplicator |
delay = 2^iteration * multiplicator seconds delay after processing failure. |
MiddleMail:Storage:ElasticSearch:Uri |
URI of the Elasticsearch instance |
MiddleMail:Storage:ElasticSearch:Index |
name of the Elasticsearch index we write messages to |
MiddleMail:MessageSource:RabbitMQ:ConnectionString |
Connectionstring to rabbitmq, as defined at https://github.com/EasyNetQ/EasyNetQ/wiki/Connecting-to-RabbitMQ. E.g. host=localhost;prefetchcount=10 |
MiddleMail:MessageSource:RabbitMQ:SubscriptionId |
Unique subscription id for this instance of middle mail |
REDIS_CONFIGURATION |
Configuration used to connect to Redis, as defined at https://stackexchange.github.io/StackExchange.Redis/Configuration |
REDIS_INSTANCE_NAME |
The Redis instance name |
DISABLE_SMTP |
Do not actually send anything via SMTP. |
Project | Description |
---|---|
EmailMessageGenerator | Generates test email messages |