View Single Post
  #2   (View Single Post)  
Old 9th November 2022
Sehnsucht94's Avatar
Sehnsucht94 Sehnsucht94 is offline
Real Name: Paolo Vincenzo Olivo
Package Pilot
 
Join Date: Oct 2017
Location: Rome
Posts: 169
Default

Quote:
Originally Posted by shep View Post
Anyone used mutt w/ mbox_type = maildir? Offlineimap/isync with a MDA, specifically nmh?
Also open to alternative suggestions.
I use mutt with mbox_type = maildir, relying on offlineimap to sync mailboxes from my account on the tildeverse. I use msmtp as MDA (though I've also used the portable version of DragonFly BSD's DMA). offlineimap and msmtp invoke password-store to decrypt my password.
Th only downside of OfflineIMAP is that it's still written in python2.

~/.offlineimaprc:
Code:
[general]
# List of accounts to be synced, separated by a comma.
accounts = Tilde 
metadata = ~/.offlineimap
#ui = basic   
pythonfile = ~/.bin/offlineimap.py
maxsyncaccounts = 1
             
[Account Tilde]
# Identifier for the local repository; e.g. the maildir to be synced via IMAP.
localrepository = tilde-local
# Identifier for the remote repository; i.e. the actual IMAP, usually non-local.
remoterepository = tilde-remote
# Minutes between syncs
autorefresh = 1
quick = 10     
               
[Repository tilde-local]
# OfflineIMAP supports Maildir, GmailMaildir, and IMAP for local repositories.
type = Maildir 
# Where should the mail be placed?
localfolders = ~/Mail
               
[Repository tilde-remote]
# Remote repos can be IMAP or Gmail, the latter being a preconfigured IMAP.
type = IMAP    
remotehost = tilde.pink
remoteuser = <username>
# Synchronize folders 
folderfilter = lambda foldername: foldername in ["INBOX", "Drafts", "Sent", "Archive", "Trash"]
# Decrypt and read the encrypted password
remotepasseval = get_pass("")
ssl=yes        
sslcacertfile = /etc/openssl/certs/ca-certificates.crt
ssl_version = tls1_2
keepalive = 60 
holdconnectionopen = yes
~/.bin/offlineimap.py
Code:
#! /usr/bin/env python2.7
from subprocess import check_output

def get_pass():
    return check_output("pass mail/tilde",
     shell=True).strip("\n")
~/.msmstprc
Code:
# Set default values for all following accounts.
defaults
auth           on
tls            on
tls_starttls   on
tls_trust_file /etc/openssl/certs/ca-certificates.crt
tls_cert_file  ~/.mutt/certificates/mutt.crt
tls_key_file   ~/.mutt/private/mutt.key
syslog         on
tls_certcheck  on
logfile        ~/.msmtp.log

# home server 
account      tilde
host           smtp.tilde.pink
port           587
user           <username>
from           <username>@tilde.pink
passwordeval   "pass mail/tilde" 

account  default : tilde
~/.mutt/accounts/mdir.pink :
Code:
set realname= "<MY Name>"
set mbox_type=Maildir
set folder=~/Mail
set mask=".*" 
mailboxes ! + `\
for file in ~/Mail/*; do \
   box=$(basename "$file"); \
   if [ ! "$box" = '.' -a ! "$box" = '..' -a ! "$box" = '.customflags' \
       -a ! "$box" = '.subscriptions' ]; then \
       echo -n "\"+$box\" "; \
   fi; \
done`
set spoolfile=+INBOX
set postponed= +Drafts
set record = +Sent
set maildir_trash = yes
set sendmail="/usr/pkg/bin/msmtp -a tilde -t"
set use_from=yes
set envelope_from=yes
set from= "My Name <username@tilde.pink>"
set mail_check = 90
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„
Reply With Quote