~kaction/config

569cada1bc5709b76d4fd05eb2696044ad68c338 — Dmitry Bogatov 6 months ago 8c4c1b1
Configure email fetching
3 files changed, 45 insertions(+), 0 deletions(-)

M flake.nix
A universe/mpop/default.nix
A universe/mpop/mpop.conf
M flake.nix => flake.nix +2 -0
@@ 51,6 51,7 @@
            ./universe/less
            ./universe/libarchive
            ./universe/libusb1
            ./universe/mpop
            ./universe/msmtp
            ./universe/newsboat
            ./universe/openssh


@@ 140,6 141,7 @@
              less
              man-pages # syscall and libc library reference.
              msmtp
              mpop
              newsboat
              nix # unstable Nix with flakes support
              nixfmt

A universe/mpop/default.nix => universe/mpop/default.nix +30 -0
@@ 0,0 1,30 @@
{ mpop, execline, substituteAll, rewrite-paths }:
let
  config =
    # Mild obfuscation to make sure my email address is not greppable in
    # the source by something as primitive as \w+@\w+.\w+. I would be
    # shoked if spammer would actually build derivation to grep it for
    # email addresses.

    # For now I setup maildir instead of mh, since these days I do not
    # receive much mail, and configuring mmh is slightly more involved
    # than configuring mutt.
    let
      user = "demigod";
      domain = "kaction.cc";
    in substituteAll {
      src = ./mpop.conf;
      account = "user ${user}@${domain}";
    };
  stage1 = rewrite-paths {
    drv = mpop;
    postBuild = ''
      mv $out/bin/mpop $out/bin/.mpop
      cat << EOF > $out/bin/mpop
      #!${execline}/bin/execlineb -WS0
      $out/bin/.mpop --file=${config} \$@
      EOF
      chmod +x $out/bin/mpop
    '';
  };
in stage1

A universe/mpop/mpop.conf => universe/mpop/mpop.conf +13 -0
@@ 0,0 1,13 @@
account default
delivery maildir ~/Mail
uidls_file ~/Mail/.uidls
received_header off
host pop.migadu.com
@account@
port 995
keep on
tls on
tls_starttls off
tls_trust_file /etc/ssl/certs/ca-certificates.crt
passwordeval cat /dev/shm/kaction/volatile/kaction.cc