Sharing MH files across computers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Sharing MH files across computers

Thomas Levine
I want to access the same mails from both my laptop computer and my
desktop computer. I can do this with naive copying if I always
synchronize before I inc, refile, send, &c, but that often requires a good
internet connection, and it is too easy for the synchronization to
accidentally not happen and thus to lead to filename conflicts.
Are there any very good ways of using mail between two computers?

Two easy things I thought of

* Use separate folders for the separate computers
  (+laptop/inbox, +laptop/outbox, +desktop/inbox, +desktop/outbox)
  and write wrappers that make the typing less verbose.
* Patch nmh so that you can configure a different modulus for each
  computer. New files will be numbered only as multiples of this
  modulus. In my case, for example, I could use odd numbers for the
  desktop and even numbers for the laptop

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Sharing MH files across computers

hymie
rsync from cron ?

--hymie!    http://lactose.homelinux.net/~hymie    [hidden email]
My fitbit says I've walked 3304 steps today (as of 15:49).

Thomas Levine writes:

>I want to access the same mails from both my laptop computer and my
>desktop computer. I can do this with naive copying if I always
>synchronize before I inc, refile, send, &c, but that often requires a good
>internet connection, and it is too easy for the synchronization to
>accidentally not happen and thus to lead to filename conflicts.
>Are there any very good ways of using mail between two computers?
>
>Two easy things I thought of
>
>* Use separate folders for the separate computers
>  (+laptop/inbox, +laptop/outbox, +desktop/inbox, +desktop/outbox)
>  and write wrappers that make the typing less verbose.
>* Patch nmh so that you can configure a different modulus for each
>  computer. New files will be numbered only as multiples of this
>  modulus. In my case, for example, I could use odd numbers for the
>  desktop and even numbers for the laptop

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Sharing MH files across computers

Thomas Levine
In case the consistency issue isn't as obvious as I had thought, I
present some specific concerns. Suppose, for simplicity, that my desktop
computer is always connected to the internet, with perfect uptime, and
that I have the rsync cron job on my laptop, which is often not
connected to the internet. I can also run the rsync manually. Here are
some problematic situations that could arise.

I inc on the laptop but close it before I run rsync. Then I inc on the
desktop. Both inc runs created new files in the same folder with the
same number.

I write a draft on the laptop when I do not have internet access. Before
I get around to connecting to the laptop, I also write a draft on the
desktop. Both drafts have the same number.

I refile 1000 messages, or I pack, on the laptop while I do not have
internet access. The issue is the same sort of issue as the previous
scenarios, except that it's a lot more messages.



I guess I could do rsync and have a way of resolving the conflicts: If
two identically named files aren't exact matches, rename one of them to
a higher number. Has anyone already written that?

On Thu, Sep 1, 2016, at 03:56 PM, [hidden email] wrote:

> rsync from cron ?
>
> --hymie!    http://lactose.homelinux.net/~hymie   
> [hidden email]
> My fitbit says I've walked 3304 steps today (as of 15:49).
>
> Thomas Levine writes:
> >I want to access the same mails from both my laptop computer and my
> >desktop computer. I can do this with naive copying if I always
> >synchronize before I inc, refile, send, &c, but that often requires a good
> >internet connection, and it is too easy for the synchronization to
> >accidentally not happen and thus to lead to filename conflicts.
> >Are there any very good ways of using mail between two computers?
> >
> >Two easy things I thought of
> >
> >* Use separate folders for the separate computers
> >  (+laptop/inbox, +laptop/outbox, +desktop/inbox, +desktop/outbox)
> >  and write wrappers that make the typing less verbose.
> >* Patch nmh so that you can configure a different modulus for each
> >  computer. New files will be numbered only as multiples of this
> >  modulus. In my case, for example, I could use odd numbers for the
> >  desktop and even numbers for the laptop
>
> _______________________________________________
> Nmh-workers mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/nmh-workers

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Sharing MH files across computers

Conrad Hughes
Hi Thomas,

Thomas> I want to access the same mails from both my laptop computer and my
Thomas> desktop computer.

I've been doing this for a decade or two, among three computers for much
of that time: home desktop, work desktop and laptop.  I use unison for
syncing between hosts: it's much safer than rsync since it's
bidirectional.  However, that's still not good enough when both sides
are reordering or storing new messages.  So for most of this time I
further adopted your solution of different drafts and inbox folders on
each host, along with fairly careful sync discipline whenever I was
doing a lot of refiling.  This kindof requires one host to be always on,
as the centre of the sync topology.

More recently I've set up a couple of aliases which perform the complete
email migration between two hosts: shut down fetchmail on one, sync,
start fetchmail on the other.  Even with this I'm now tempted to perform
additional futzing to disable any NMH commands which alter message
numbers on the non-primary hosts.  I've been contemplating trying out
some kind of IMAP server on my NAS box too: that is pretty much always
on, but IMAP'd leave me in trouble when offline.

I like your modulus idea, though it would run into difficulty with
folder -pack I think; another idea would be for emails to have a
deterministic filename that couldn't change (e.g. a hash — though I note
that "Replied:" annotations would cause trouble here), but scan etc.
would assign virtual numbers to them by some means so you could still
refer to 1, 2, etc. rather than a 20-digit hash :-/  Sounds as if it
might get awkward though.

Would be interested to hear if anyone has tried other approaches.

Conrad

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Sharing MH files across computers

bergman-5
In the message dated: Thu, 01 Sep 2016 22:41:21 +0100,
The pithy ruminations from Conrad Hughes on
<Re: [Nmh-workers] Sharing MH files across computers> were:
=> Hi Thomas,
=>
=> Thomas> I want to access the same mails from both my laptop computer and my
=> Thomas> desktop computer.
=>
=> I've been doing this for a decade or two, among three computers for much
=> of that time: home desktop, work desktop and laptop.  I use unison for
=> syncing between hosts: it's much safer than rsync since it's
=> bidirectional.  However, that's still not good enough when both sides

[SNIP!]

=>
=> I like your modulus idea, though it would run into difficulty with
=> folder -pack I think; another idea would be for emails to have a
=> deterministic filename that couldn't change (e.g. a hash — though I note
=> that "Replied:" annotations would cause trouble here), but scan etc.
=> would assign virtual numbers to them by some means so you could still
=> refer to 1, 2, etc. rather than a 20-digit hash :-/  Sounds as if it
=> might get awkward though.
=>
=> Would be interested to hear if anyone has tried other approaches.

This was my thought experiment, but I haven't actually written the code:

        https://lists.gnu.org/archive/html/nmh-workers/2008-05/msg00046.html

[BEGIN SECURITY & PRIVACY CONCERNS]

Today, I'd seriously look into keeping the mailstore on a cloud service
that offers persistent host-side caching, such as dropbox. That'll give
you the 'synchronization' by having the definitive copy in the cloud,
and it'll enable clients to function off-line. Since your use case, and
mine, is for a single person running nmh on multiple machines, there's
almost no chance of simultaneous changes. If it takes a little while
(seconds, maybe single-digit minutes) for the cloud service to sync
from the active machine, where I'm at the keyboard and running 'inc'
to the other clients, the delay isn't a problem.

[END SECURITY & PRIVACY CONCERNS]

Mark

=>
=> Conrad
=>
=> _______________________________________________
=> Nmh-workers mailing list
=> [hidden email]
=> https://lists.nongnu.org/mailman/listinfo/nmh-workers
=>
--
Mark Bergman    Biker, Rock Climber, SCUBA Diver, Unix mechanic, IATSE #1 Stagehand
'94 Yamaha GTS1000A^2      2015 Aprilia Caponord
[hidden email]       https://www.flickr.com/photos/rmsppu

http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=bergman%40panix.com

I want a newsgroup with a infinite S/N ratio! Now taking CFV on:
rec.motorcycles.stagehands.pet-bird-owners.pinballers.unix-supporters
15+ So Far--Want to join? Check out: http://www.panix.com/~bergman 

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Sharing MH files across computers

Ken Hornstein-2
In reply to this post by Thomas Levine
>I want to access the same mails from both my laptop computer and my
>desktop computer. I can do this with naive copying if I always
>synchronize before I inc, refile, send, &c, but that often requires a good
>internet connection, and it is too easy for the synchronization to
>accidentally not happen and thus to lead to filename conflicts.
>Are there any very good ways of using mail between two computers?

Others have chimed in already, but I wanted to offer my thoughts.

What I do is use a wide-area filesystem to store my MH files.  This doesn't
work when you're offline, of course, but it's occured to me recently that
the times I've been truely offline have been few and far between, and when
I have I mostly don't want to use email.  I realize that's not a real
answer to your query, of course.

It does occur to me that this is a perfect example of what IMAP is
supposed to solve.  Which is another reason we should get IMAP support
working as soon as we can.  Although even if we did that, it would be
ANOTHER pile of work to support offline IMAP.  Sigh.

--Ken

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Sharing MH files across computers

Alexander Zangerl-4
In reply to this post by Thomas Levine
On Thu, 01 Sep 2016 19:49:41 +0000, Thomas Levine writes:
>Are there any very good ways of using mail between two computers?

maybe not 'very good' but 'works for me': a few years ago i programmed
a more or less mh-specific bidirectional sync tool (in perl,
uses ssh and sshfs, gpl).

my primary use case is having both lapdog and main desktop get inbound
email, and me sending from either device. every few days mhsync brings
them back into sync. it hasn't eaten or lost any emails in 5+ years
of use, but certainly could be improved on (e.g. it's not very smart
about sequences).

it's available here: http://snafu.priv.at/mystuff/mhsync.html

regards
az


--
Alexander Zangerl + GPG Key 0xB963BD5F + http://snafu.priv.at/
Any sufficiently advanced bug is indistinguishable from a feature.

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Sharing MH files across computers

Thomas Levine
I have come up with an approach that I like.

I use fastmail.fm as my email provider. They have two features that are
necessary for this approach.

1. I can use IMAP
2. I can configure my account to put mails in the Sent folder when I send them
   through fastmail's SMTP server.

For simplicity, let's say that I have only four folders.

  +inbox
  +drafts
  +local-outbox
  +real-outbox

I configure mbsync to pull from the fastmail IMAP Inbox to a local
maildrop without modifying the mails on fastmail. I run inc from the
local maildrop, deleting the mail from the local maildrop and
incorporating it into the +inbox. (In practice I would really use
slocal, &c. and do filtering, but it's the same idea.)

mbsync keeps track of which mails have already been synced; on
subsequent runs, mbsync downloads and only the new mail and thus
incorporates only the new mail into the maildrop.

When I send mail, nmh puts a copy in +local-outbox. You'll see soon that
this isn't really necessary, but think it is good to do this in case my
internet connection drops while I am sending a message.

Since I send mail through fastmail's SMTP server, fastmail puts a copy
in my remote Sent folder. I use the mbsync process to incorporate this
remote Sent mail to the local +real-outbox, just like how incorporate
the remote Inbox mail to the local +inbox folder.

I skip the +local-outbox folder when I take backups because everything
in there should be in the +real-outbox.

The main thing that is missing from this is a way to synchronize
refilings and drafts. I handle this by refiling only from my desktop
computer. I use my laptop computer or the fastmail web interface to
check email when I'm not at the desktop computer, but I organize mail
and take backups only at the desktop computer.

Conveniently, I don't use refile very much, as I have never been into
manually categorizing my email. The lack of drafts synchronization is a
bit annoying, but the drafts directory is pretty small, so synchronizing
just that should be pretty easy. I would probably use duplicity.

And, now that I have figured it all out, I might not want to use it any
more! For reasons beyond nmh, I'm finding it a bit annoying to maintain
two different computers. I'm planning to get a very nice laptop and a
docking station and using that as the main computer, instead of
switching between the desktop and laptop. When I do this, I may still
use the present mbsync strategy so that I can synchronize sent mails
between the fastmail web application and the local nmh, and I won't
worry about synchronizing drafts.

_______________________________________________
Nmh-workers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/nmh-workers