move mail to fastemail

This commit is contained in:
Gabriel Fontes
2022-09-01 16:35:34 -03:00
parent cde903984f
commit 63915b837c
3 changed files with 81 additions and 49 deletions
@@ -176,13 +176,13 @@ in
return-type = "json";
exec = jsonOutput {
pre = ''
count=$(find ~/Mail/*/INBOX/new -type f | wc -l)
count=$(find ~/Mail/*/Inbox/new -type f | wc -l)
if [ "$count" == "0" ]; then
subjects="No new mail"
status="read"
else
subjects=$(\
grep -h "Subject: " -r ~/Mail/*/INBOX/new | cut -d ':' -f2- | \
grep -h "Subject: " -r ~/Mail/*/Inbox/new | cut -d ':' -f2- | \
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | ${xml} esc | sed -e 's/^/\-/'\
)
status="unread"
+79 -25
View File
@@ -1,9 +1,11 @@
{ pkgs, persistence, lib, config, ... }:
let
mbsync = "${config.programs.mbsync.package}/bin/mbsync";
gpg = "${config.programs.gnupg.package}/bin/gpg";
pass = "${config.programs.password-store.package}/bin/pass";
common = rec {
msmtp.enable = true;
realName = "Gabriel Fontes";
gpg = {
key = "7088 C742 1873 E0DB 97FF 17C2 245C AB70 B4C2 25E9";
@@ -11,7 +13,6 @@ let
};
signature = {
showSignature = "append";
# TODO update domain
text = ''
${realName}
@@ -32,59 +33,112 @@ in
personal = rec {
primary = true;
address = "gabriel@gsfontes.com";
userName = address;
passwordCommand = "${pass} mail1.netim.hosting/${address}";
imap.host = "mail1.netim.hosting";
smtp.host = "mail1.netim.hosting";
folders = {
inbox = "INBOX";
inbox = "Inbox";
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
mbsync = {
enable = true;
create = "maildir";
expunge = "both";
};
msmtp = {
enable = true;
};
neomutt = {
enable = true;
extraMailboxes = [ "Drafts" "Sent" "Trash" "Archive" "Junk" ];
mailboxName = "Personal -> Inbox";
extraMailboxes = [ "Archive" "Drafts" "Sent" "Spam" "Trash" ];
};
imap.host = "imap.fastmail.com";
smtp.host = "smtp.fastmail.com";
userName = address;
passwordCommand = "${pass} ${smtp.host}/${address}";
} // common;
college = rec {
address = "g.fontes@usp.br";
userName = address;
passwordCommand = "${pass} smtp.gmail.com/${address}";
folders = {
inbox = "Inbox";
drafts = "[Gmail]/Drafts";
sent = "[Gmail]/Sent";
trash = "[Gmail]/Trash";
};
mbsync = {
enable = true;
create = "maildir";
expunge = "both";
};
msmtp = {
enable = true;
};
neomutt = {
enable = true;
mailboxName = "USP -> Inbox";
extraMailboxes = [ "[Gmail]/All Mail" "[Gmail]/Drafts" "[Gmail]/Spam" "[Gmail]/Sent Mail" "[Gmail]/Trash" ];
};
imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com";
userName = address;
passwordCommand = "${pass} ${smtp.host}/${address}";
} // common;
work = rec {
address = "gabriel.fontes@uget.express";
userName = address;
passwordCommand = "${pass} smtp.gmail.com/${address}";
folders = {
inbox = "Inbox";
drafts = "[Gmail]/Drafts";
sent = "[Gmail]/Sent";
trash = "[Gmail]/Trash";
};
mbsync = {
enable = true;
create = "maildir";
expunge = "both";
};
msmtp = {
enable = true;
};
neomutt = {
enable = true;
mailboxName = "U-Get -> Inbox";
extraMailboxes = [ "[Gmail]/All Mail" "[Gmail]/Drafts" "[Gmail]/Spam" "[Gmail]/Sent Mail" "[Gmail]/Trash" ];
};
imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com";
userName = address;
passwordCommand = "${pass} ${smtp.host}/${address}";
} // common;
};
};
programs.mbsync.enable = true;
programs.msmtp.enable = true;
systemd.user.services.mbsync = {
/*
systemd.user.services.mbsync = {
Unit = { Description = "mbsync synchronization"; };
Service = let keyring = import ./keyring.nix { inherit pkgs; };
in {
Type = "oneshot";
ExecCondition = ''
/bin/sh -c "${keyring.isUnlocked}"
'';
ExecStart = "${pkgs.isync}/bin/mbsync -a";
Service =
let keyring = import ./keyring.nix { inherit pkgs; };
in
{
Type = "oneshot";
ExecCondition = ''
/bin/sh -c "${keyring.isUnlocked}"
'';
ExecStart = "${mbsync} -a";
};
};
systemd.user.timers.mbsync = {
};
systemd.user.timers.mbsync = {
Unit = { Description = "Automatic mbsync synchronization"; };
Timer = {
OnBootSec = "30";
OnUnitActiveSec = "5m";
OnBootSec = "30";
OnUnitActiveSec = "5m";
};
Install = { WantedBy = [ "timers.target" ]; };
};
};
*/
}
-22
View File
@@ -48,26 +48,4 @@ in {
username = "eu@misterio.me"
password.fetch = ["command", "${pass}", "mail.gandi.net/eu@misterio.me"]
'';
/*
systemd.user.services.vdirsyncer = {
Unit = { Description = "vdirsyncer synchronization"; };
Service = let keyring = import ./keyring.nix { inherit pkgs; };
in {
Type = "oneshot";
ExecCondition = ''
/bin/sh -c "${keyring.isUnlocked}"
'';
ExecStart = "${pkgs.vdirsyncer}/bin/vdirsyncer sync";
};
};
systemd.user.timers.vdirsyncer = {
Unit = { Description = "Automatic vdirsyncer synchronization"; };
Timer = {
OnBootSec = "30";
OnUnitActiveSec = "5m";
};
Install = { WantedBy = [ "timers.target" ]; };
};
*/
}