2019-08-12 01:04:15 +00:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
let
|
|
|
|
default_mailbox = {
|
|
|
|
MailboxName = "<missing>";
|
|
|
|
MatrixRoomId = "<missing>";
|
|
|
|
MatrixHomeserverUrl = "https://matrix.maralorn.de";
|
|
|
|
MatrixUserId = "@marabot:matrix.maralorn.de";
|
2020-10-01 05:10:28 +00:00
|
|
|
MatrixAccessToken = pkgs.privateValue "" "matrix/marabot-token";
|
2019-08-12 01:04:15 +00:00
|
|
|
IgnoreSubject = false;
|
|
|
|
IgnoreBody = false;
|
2019-08-13 21:49:38 +00:00
|
|
|
SkipMarkdown = false;
|
2019-08-12 01:04:15 +00:00
|
|
|
};
|
|
|
|
email2matrix-config = pkgs.writeText "email2matrix-config.json"
|
|
|
|
(builtins.toJSON {
|
|
|
|
Smtp = {
|
|
|
|
ListenInterface = "[::1]:2525";
|
|
|
|
Hostname = "email2matrix.maralorn.de";
|
|
|
|
Workers = 10;
|
|
|
|
};
|
|
|
|
Matrix = {
|
|
|
|
Mappings = [
|
2019-09-11 16:01:21 +00:00
|
|
|
(default_mailbox // {
|
|
|
|
MailboxName = "notify";
|
|
|
|
MatrixRoomId = "!kTKVQjRwxjaoMQmcve:maralorn.de";
|
|
|
|
})
|
2019-08-12 01:04:15 +00:00
|
|
|
(default_mailbox // {
|
|
|
|
MailboxName = "subjects";
|
|
|
|
MatrixRoomId = "!kTKVQjRwxjaoMQmcve:maralorn.de";
|
|
|
|
IgnoreBody = true;
|
|
|
|
})
|
|
|
|
(default_mailbox // {
|
|
|
|
MailboxName = "weather";
|
|
|
|
MatrixRoomId = "!ELeFcSrHXgMqOmwnxg:maralorn.de";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
Misc = { Debug = true; };
|
|
|
|
});
|
2021-05-18 14:33:28 +00:00
|
|
|
in
|
|
|
|
{
|
2019-08-12 01:04:15 +00:00
|
|
|
systemd.services.email2matrix = {
|
|
|
|
script =
|
2020-05-22 01:41:05 +00:00
|
|
|
"${pkgs.email2matrix}/bin/devture-email2matrix --config ${email2matrix-config}";
|
2019-08-12 01:04:15 +00:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
|
|
|
}
|