Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Mail infrastructure #295

Closed
wants to merge 4 commits into from
Closed

[WIP] Mail infrastructure #295

wants to merge 4 commits into from

Conversation

rycee
Copy link
Member

@rycee rycee commented Jun 25, 2018

This is an experimental setup for the new mail infrastructure. Highly inspired (i.e. copied) from #225 but with some crucial differences. The primary difference is that I've attempted to keep the base mail module as generic as possible, the accounts option in the mail module is then externally extended by the different program and service modules. See the basic mbsync module for demonstration of this idea.

With this my setup with this

{
  programs.mbsync = {
    enable = true;

    groups = {
      Quick =
        let
          mboxes = [ "INBOX" "Sent" "Drafts" "Archives/2018" ];
        in {
          RyceeNet = mboxes;
          ChaitsaCom = mboxes;
        };
    };
  };

  accounts.mail = {
    maildirBasePath = config.home.homeDirectory + "/Mail";

    accounts = {
      RyceeNet = {
        flavor = "runbox.com";
        userName = "XYZ";
        passwordCommand = "secret-tool lookup XYZ";
        mbsync = {
          enable = true;
          patterns = [ "*" "!Archives" ];
        };
      };

      ChaitsaCom = {
        flavor = "runbox.com";
        userName = "XYZ";
        passwordCommand = "secret-tool lookup XYZ";
        mbsync = {
          enable = true;
          patterns = [ "*" "!Archives" ];
        };
      };
    };
  };
}

@rycee rycee mentioned this pull request Jun 25, 2018
@rycee rycee force-pushed the infrastructure/mail branch 9 times, most recently from d197817 to ada9615 Compare June 30, 2018 21:59
@rycee
Copy link
Member Author

rycee commented Jun 30, 2018

I've added the generated documentation for these commits here: https://rycee.github.io/home-manager/options.html

Note in particular the account.mail hierarchy.

Any feedback on this design would be much appreciated.

Edit: The link above pointed for a while to a temporary location. I've changed it to point to the primary documentation since the bulk of this PR has been merged and the documentation updated accordingly.

@rycee rycee force-pushed the infrastructure/mail branch 3 times, most recently from 773ee0f to 39acddb Compare July 1, 2018 16:02
This adds a general module infrastructure for configuring email
accounts. The intent is to specify high level information such as IMAP
and SMTP hostnames and login information so that more specific program
and service modules do not have to duplicate options for specifying
accounts.

It is allowed for modules to inject further options within this
namespace where relevant. For example, an MUA may wish add an option
to add per-account filter rules.

Co-authored-by: Matthieu Coudron <mattator@gmail.com>
rycee and others added 3 commits July 1, 2018 18:44
Co-authored-by: Matthieu Coudron <mattator@gmail.com>
Co-authored-by: Matthieu Coudron <mattator@gmail.com>
Co-authored-by: Robert Helgesson <robert@rycee.net>
@rycee rycee closed this Jul 1, 2018
@rycee rycee deleted the infrastructure/mail branch July 1, 2018 17:06
@bsima
Copy link
Contributor

bsima commented Jul 1, 2018

@rycee
Copy link
Member Author

rycee commented Jul 1, 2018

@bsima Sorry, yes. The link above was correct but I removed it after doing the merge. I'll update the comment above. Thanks for being so observant!

@teto teto removed mail labels Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants