summaryrefslogtreecommitdiffstats
path: root/tv/2configs/exim-smarthost.nix
blob: 2beaa28efc37423058b8c01fb196ccc6f0780081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ config, lib, pkgs, ... }:

with config.krebs.lib;

{
  krebs.exim-smarthost = {
    enable = true;
    dkim = {
      domain = "viljetic.de";
    };
    sender_domains = [
      "krebsco.de"
      "shackspace.de"
      "viljetic.de"
    ];
    relay_from_hosts = concatMap (host: host.nets.retiolum.addrs4) [
      config.krebs.hosts.nomic
      config.krebs.hosts.wu
      config.krebs.hosts.xu
    ];
    internet-aliases = with config.krebs.users; [
      { from = "postmaster@viljetic.de"; to = tv.mail; } # RFC 822
      { from = "mirko@viljetic.de"; to = mv.mail; }
      { from = "tomislav@viljetic.de"; to = tv.mail; }
      { from = "tv@destroy.dyn.shackspace.de"; to = tv.mail; }
      { from = "tv@viljetic.de"; to = tv.mail; }
      { from = "tv@shackspace.de"; to = tv.mail; }
    ];
    system-aliases = [
      { from = "mailer-daemon"; to = "postmaster"; }
      { from = "postmaster"; to = "root"; }
      { from = "nobody"; to = "root"; }
      { from = "hostmaster"; to = "root"; }
      { from = "usenet"; to = "root"; }
      { from = "news"; to = "root"; }
      { from = "webmaster"; to = "root"; }
      { from = "www"; to = "root"; }
      { from = "ftp"; to = "root"; }
      { from = "abuse"; to = "root"; }
      { from = "noc"; to = "root"; }
      { from = "security"; to = "root"; }
      { from = "root"; to = "tv"; }
      { from = "mirko"; to = "mv"; }
    ];
  };
  krebs.setuid.sendmail = {
    filename = "${pkgs.exim}/bin/exim";
    mode = "4111";
  };
  tv.iptables.input-internet-accept-new-tcp = singleton "smtp";
}