![]() |
|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
The 21st century has caught me and I'm looking at adapting my mail backup system to
include multiple devices (cellphone) on the same account. My Workstation uses fetchmail to pull pop3 email, without deleting them on the server, and Mail Delivery Agent (MDA) stanza to pipe them to nmh. nmh processes them to #mh format and delivers to +inbox I back these up yearly but they would not include an email sent from my laptop or cellphone. Once backup'd, I delete all emails from the server for several reasons: server has storage limits, mail sorting time becomes noticeable and emails that sit on a server for longer than 6 months have no privacy protection in the U.S. My laptop uses mutt w/ imap4, set mbox_type=mh and cellphone Monocles Mail/imap4. I'm thinking about switching all devices to imap4 and then running a backup script every 6 months. @j65nko uses fetchmail as a backup solution but I would like to pull mails from inbox and sent. https://daemonforums.org/showpost.ph...79&postcount=1 I prefer storage formats where each email is a spearate file; eg #mh or maildir http://mutt.postle.net/storage/index.html mail/offlineimap and mail/isync both look to handle several folders although I'll be using Spectrum rather than Gmail Both can utilize maildir format for storage. http://www.offlineimap.org/doc/use_cases.html http://isync.sourceforge.net/ I've not used mutt mbox_type = maildir and alpine does not support maildir without a patch - I'm leaning toward staying with mh format but could not find documentation to use nmh with offlineimap or isync. Anyone used mutt w/ mbox_type = maildir? Offlineimap/isync with a MDA, specifically nmh? Also open to alternative suggestions. Solved: Fetchmail allows multiple email servers to be specified with an mda entry for each server. One minor annoyance is that passwords for each server are asked in sequence at the start of fetchmail. The first time I ran it, the SentMail folder had an authorization failure which I suspected was due to a timeout. I commented out the Inbox entry and retrieved the SentMail box. I tried again w/ Inbox and SentMail enabled and it downloaded both folders. Fetchmail does not have a "keep alive" function like Mutt. It may be prudent to split the Inbox and SentMail boxes into 2 separate fetchmailrc configuration files and run each separately when backing up. The mda entry worked perfectly to put both folders into #mh format. I'll post my files in @j65nko howto as a F/U. Last edited by shep; 10th January 2023 at 08:35 PM. |
|
||||
![]() Quote:
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 Code:
#! /usr/bin/env python2.7 from subprocess import check_output def get_pass(): return check_output("pass mail/tilde", shell=True).strip("\n") 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 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„ |
|
|||
![]() Quote:
https://github.com/OfflineIMAP/offlineimap https://github.com/OfflineIMAP/offlineimap3 I ended up with a fetchmail/nmh solution but updating offlineimap -> offlineimap3 would be a worthy port upgrade for OpenBSD. In my research, I also found a performance comparison between offlineimap and isync. For large backup's, isync (coded in C) was said to perform about 35% faster. https://irreal.org/blog/?p=8184 I'm on the fence as far as Maildir vs #mh storage formats. Out of the box, Evolution/Thunderbird use Maildir and Sylpheed/Claws-Mail use #mh. Last edited by shep; 9th November 2022 at 02:29 PM. |
|
||||
![]() Quote:
Quote:
Quote:
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„ |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simple backup questions | unixjingleman | FreeBSD General | 15 | 27th February 2011 11:21 PM |
uw-imap connection timeout | andrewm | OpenBSD Packages and Ports | 4 | 22nd October 2009 11:03 AM |
backup freeBSD 7.0 using Backup Exec | ccc | FreeBSD General | 2 | 25th April 2009 09:23 PM |
Courier IMAP Different MD5 version | jrs665 | OpenBSD Packages and Ports | 3 | 30th October 2008 12:34 PM |
Recommendation for Imap and POP server | Pher | FreeBSD Installation and Upgrading | 5 | 20th July 2008 07:43 PM |