2022-03-08 01:42:46 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
2019-08-12 01:04:15 +00:00
|
|
|
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"
|
2022-03-08 01:42:46 +00:00
|
|
|
(builtins.toJSON {
|
|
|
|
Smtp = {
|
|
|
|
ListenInterface = "[::1]:2525";
|
|
|
|
Hostname = "email2matrix.maralorn.de";
|
|
|
|
Workers = 10;
|
|
|
|
};
|
|
|
|
Matrix = {
|
|
|
|
Mappings = [
|
|
|
|
(default_mailbox
|
|
|
|
// {
|
|
|
|
MailboxName = "notify";
|
|
|
|
MatrixRoomId = "!kTKVQjRwxjaoMQmcve:maralorn.de";
|
|
|
|
})
|
|
|
|
(default_mailbox
|
|
|
|
// {
|
|
|
|
MailboxName = "subjects";
|
|
|
|
MatrixRoomId = "!kTKVQjRwxjaoMQmcve:maralorn.de";
|
|
|
|
IgnoreBody = true;
|
|
|
|
})
|
|
|
|
(default_mailbox
|
|
|
|
// {
|
|
|
|
MailboxName = "weather";
|
|
|
|
MatrixRoomId = "!ELeFcSrHXgMqOmwnxg:maralorn.de";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
Misc = {Debug = true;};
|
|
|
|
});
|
|
|
|
in {
|
2019-08-12 01:04:15 +00:00
|
|
|
systemd.services.email2matrix = {
|
2022-03-08 01:42:46 +00:00
|
|
|
script = "${pkgs.email2matrix}/bin/devture-email2matrix --config ${email2matrix-config}";
|
|
|
|
wantedBy = ["multi-user.target"];
|
2019-08-12 01:04:15 +00:00
|
|
|
};
|
|
|
|
}
|