I was trying to setup neomutt declaratively with nix home-manager to manage my gmail. I tried a bunch of guides online, a bunch of dotfiles, but all seems to be fruitless.
What works:
- I can send emails and receive email headers from neomutt.
- I can go through all Inbox email headers.
Issues:
- The email headers seem to load just fine, however I cannot get the body -
when I press on the email header, it says ‘No mailing lists found’. - Only Inbox is there - the sidebar doesn’t show Sent/Trash/Drafts/etc.
- Have been trying to also set up my University mailbox
(they have Thunderbird instructions). It’s not gmail-based.
When I try syncing it with mbsync, I get:
Socket error: secure connect to <mail_server> (<mail_ip>:993): error:0A00018A:SSL routines::dh key too small
Here is my neomutt.nix
:
{ pkgs, config, ... }:
let
# Variables here
in
{
# Partially based on https://github.com/Baitinq/nixos-config/blob/c9851e910f6e0dc574527e2da4be29d704eda27d/modules/email/default.nix
accounts.email= {
maildirBasePath = "Maildir";
accounts.gmail = {
address = gmailname;
userName = gmailname;
msmtp.enable = true;
mbsync = {
enable = true;
create = "maildir";
};
folders = {
inbox = "Inbox";
sent = "\[Gmail\]/Sent\\ Mail";
trash = "\[Gmail\]/Trash";
drafts = "\[Gmail\]/Drafts";
#spam = "[Gmail]/Spam";
};
#notmuch = {
# enable = true;
# neomutt.enable = true;
#};
neomutt = {
enable = true;
mailboxName = "Inbox";
#extraMailboxes = [
# "\[Gmail\]/Sent\ Mail"
# "\[Gmail\]/Bin"
# "\[Gmail\]/Starred"
# "\[Gmail\]/Drafts"
#];
extraConfig = ''
set edit_headers = yes # See the headers when editing
set charset = UTF-8 # value of $LANG; also fallback for send_charset
unset use_domain # because joe@localhost is just embarrassing
set use_from = yes
set index_format='%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s'
'';
};
primary = true;
realName = realname;
#imap = {
# host = "imap.gmail.com";
# port = 993;
#};
#smtp = {
# host = "smtp.gmail.com";
# port = 587;
#};
imapnotify = {
enable = true;
boxes = [ "Inbox" ];
onNotifyPost = ''
${pkgs.libnotify}/bin/notify-send "New mail arrived."
'';
};
signature.text = signature;
signature.showSignature = "append";
passwordCommand = pass_cmd;
flavor = "gmail.com"; # flavor sorta works, while individual imap/smtp setup doesn't
#maildir.path = "gmail";
};
};
services = {
mbsync.enable = true;
imapnotify.enable = true;
};
programs = {
neomutt = {
enable = true;
vimKeys = true;
sidebar.enable = true;
sort = "reverse-date";
};
mbsync.enable = true;
msmtp.enable = true;
};
home.packages = with pkgs; [ openssl ];
#programs.notmuch = {
# enable = true;
#};
}
Just a few things I have tried (some commented out):
- imap/smtp setup manually instead of using flavor option
(refused to even load the email headers. Flavor at least loads the headers) - Setting gmail directories in folders option or neomutt.extraMailboxes
- Changing directory that stores emails on disk
- Tryin combinations of “imap”/“maildir”/“both” in mbsync.create
and/or neomutt.mailboxType - Using/not using mbsync and/or notmuch
- Not using imapnotify (wasn’t in my original configuration,
before I found cited github config) - Hard-coding things into extraConfig, going without it, etc.
The way I call variables like ‘pass_cmd’ might be wrong,
but that’s not actually what I’m doing in the actual file,
just replaced them for privacy reasons here.
Variables are definitely not the issue.
Please help, I tried fixing this error for a few days,
and cannot find anything even remotely useful online that improves my situation.
Even if you can give me a direction where I can go to, that would be amazing.
Thank you!