If no configuration file is provided, the mailserver listens on port `1025, any authentication credentials are ignored and nothing happens when an incoming mail is received.
./mailbridge
A configuration file can be provided using the -f
flag. This must be a json file, see below.
./mailbridge -f config.json
- handlers: Configurable actions that should be executed when receiving new incoming emails. Multiple handlers can be configured, the
username
andpassword
fields are used to decide which handler to execute. You can use the same username/password combination multiple times if one emails should be processed by multiple handlers. If this is the case, each handler will be invoked in the same order as they are declared. Consult the conf/ folder for more information about the available handlers. - name: The name of the mailserver, this can be anything and will be used when answering to
HELO/EHLO
requests. - port: The port that this mailserver should run on.
{
"handlers": [{
"handler": "slack",
"username": "some_user",
"password": "some_password",
"options": {
"channel": "some_channel_name",
"webhook": "https://hooks.slack.com/services/a/b/c"
}
}],
"name": "thepieterdc.github.io",
"port": 25
}
config/environments/development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'localhost',
authentication: :plain,
password: 'my_password',
port: 2525,
user_name: 'my_username'
}