Re: How can I use mutt on disconnected laptops?
I think IMAP would probably be the best solution for this setup. But another thing comes to my mind: what about (mis)using CVS for this task? -- Christian Ordig | Homepage: http://thor.prohosting.com/~chrordig/ Germany |eMail: Christian Ordig [EMAIL PROTECTED] PGP signature
Re: How can I use mutt on disconnected laptops?
Peter Jaques [EMAIL PROTECTED] wrote on Sun, 15 Oct 2000: there's a tricky thing here, though. Of course, it's not a simple setup (to get working right, at least). if a message exists on the desktop machine, not on the laptop, there are two possibilities. 1) you downloaded it to the laptop deleted it, or 2) it's new mail you've never downloaded to laptop. this could be dealt with by keeping a record of when syncs happen comparing that to file mod times, i suppose. or does maildir do this in some special way? Well, Maildir keeps new messages in a separate dir from the read messages, but that doesn't really help here -- unless you make sure to never do the sync with new mail in the "new" dir. Keeping a record of sync times and then comparing which files have been created when is probably the best way. That I can think of, anyway. Note that this problem isn't unique to Maildirs, the mbox folders suffer from the same problem -- if there's new mail there in the folder, how can you tell if it's something you did download to the laptop and already deleted, or if it's something you've really not seen before? So the same problem needs to be solved there. Mikko -- // Mikko Hänninen, aka. Wizzu // [EMAIL PROTECTED] // http://www.iki.fi/wiz/ // The Corrs list maintainer // net.freak // DALnet IRC operator / // Interests: roleplaying, Linux, the Net, fantasy scifi, the Corrs / 10.0 times 0.1 is hardly ever 1.0.
Re: How can I use mutt on disconnected laptops?
Note that this problem isn't unique to Maildirs, the mbox folders suffer from the same problem -- if there's new mail there in the folder, how can you tell if it's something you did download to the laptop and already deleted, or if it's something you've really not seen before? So the same problem needs to be solved there. What about keeping trash-folders of deleted mails? Merge the trash folders, build a message-id cache, and use the "remove duplicates" procmail filter on the incomming folder(s).
Re: How can I use mutt on disconnected laptops?
On Sun, Oct 15, 2000 at 12:30:55PM +0100, Conor Daly [EMAIL PROTECTED] wrote: I was thinking have having the laptop nfs share the mailfolders to the desktop, since I assume that the laptop will always be with him... OK, that's fine so long as the desktop machine *isn't* receiving mail while the laptop is away. My home server collects email about 6 times per day whether I'm there or not so that wouldn't work for me Well, as long as the home server is the only machine receiving mail (i.e., you don't check with your laptop, too), you could keep your downloaded mail and folders on your laptop and export them as an NFS share to your desktop (as mentioned). To handle mail that arrives when the laptop is disconnected, try running a home machine as a POP3 server, and then use fetchmail to get all new mail to the laptop when connected. To check mail at home, make sure the laptop is up-to-date (i.e., has run fetchmail recently) and then check mail normally, which will access your mail folders on your laptop. -- Bob Bell [EMAIL PROTECTED] - "For example, OS/360 devotes 26 bytes of the permanently resident date-turnover routine to the proper handling of December 31 on leap years (when it is Day 366). That might have been left to the operator." -- Fred Brooks, _The Mythical Man-Month_, on wasting resources
Re: How can I use mutt on disconnected laptops?
On Mon, Oct 16, 2000 at 10:25:47AM -0400 or so it is rumoured hereabouts, Bob Bell thought: On Sun, Oct 15, 2000 at 12:30:55PM +0100, Conor Daly [EMAIL PROTECTED] wrote: I was thinking have having the laptop nfs share the mailfolders to the desktop, since I assume that the laptop will always be with him... OK, that's fine so long as the desktop machine *isn't* receiving mail while the laptop is away. My home server collects email about 6 times per day whether I'm there or not so that wouldn't work for me Well, as long as the home server is the only machine receiving mail (i.e., you don't check with your laptop, too), you could keep your downloaded mail and folders on your laptop and export them as an NFS share to your desktop (as mentioned). To handle mail that arrives when the laptop is disconnected, try running a home machine as a POP3 server, and then use fetchmail to get all new mail to the laptop when connected. To check mail at home, make sure the laptop is up-to-date (i.e., has run fetchmail recently) and then check mail normally, which will access your mail folders on your laptop. Nice, elegant, OH NO! I left the laptop at work!!! What now?? Perhaps run an imap daemon and access that with the desktop if the laptop isn't available... -- Conor Daly [EMAIL PROTECTED] Domestic Sysadmin :-)
Re: How can I use mutt on disconnected laptops?
On 16 Oct 00, 11:31AM, Mikko Hänninen wrote: Note that this problem isn't unique to Maildirs, the mbox folders suffer from the same problem -- if there's new mail there in the folder, how can you tell if it's something you did download to the laptop and already deleted, or if it's something you've really not seen before? So the same problem needs to be solved there. sure, maildirs are certainly the way to go here; you can just copy/compare/delete files, instead of needing something that can actually change flags in an mbox, or delete messages c. -- Peter Jaques [EMAIL PROTECTED] http://cs.oberlin.edu/~pjaques klezmerbalkanturkish clarinet; free foodshelter; books to prisoners pgp: email me with subject "get pgp key", or finger [EMAIL PROTECTED] PGP signature
Re: How can I use mutt on disconnected laptops?
On Sat, Oct 14, 2000 at 08:44:28PM -0400 or so it is rumoured hereabouts, Dan Boger thought: On Sat, Oct 14, 2000 at 08:44:58PM +0100, Conor Daly wrote: another way to go at it, and this also works only if there's only one machine that is getting the mail, is just put the mailfolder (or the maildir) in an nfs share... That'll only work while the laptop is connected. He wants to work on his email while roaming with the laptop and have all the folders kept in sync. I was thinking have having the laptop nfs share the mailfolders to the desktop, since I assume that the laptop will always be with him... :) OK, that's fine so long as the desktop machine *isn't* receiving mail while the laptop is away. My home server collects email about 6 times per day whether I'm there or not so that wouldn't work for me -- Conor Daly [EMAIL PROTECTED] Domestic Sysadmin :-)
Re: How can I use mutt on disconnected laptops?
On Sat, Oct 14, 2000 at 06:41:47PM +0100 or so it is rumoured hereabouts, Dan Boger thought: On Sat, Oct 14, 2000 at 02:35:24PM +, Conor Daly wrote: cat ~/mbox | /usr/bin/formail -D 8192 msgid.cache laptop:~/mbox cat laptop:~/mbox | /usr/bin/formail -D 8192 msgid.cache ~/mbox and similarly for other folders (I don't know what the "8192" bit means above, I just copied it blindly from Telsa's .procmailrc). the 8192 is the size of the cache for the IDs - if you're processing a large mailbox though, (say, more than 10-20 messages) you'd defenitly want this larger... at least 64k, if not more... another way to go at it, and this also works only if there's only one machine that is getting the mail, is just put the mailfolder (or the maildir) in an nfs share... Dan That'll only work while the laptop is connected. He wants to work on his email while roaming with the laptop and have all the folders kept in sync. -- Conor Daly [EMAIL PROTECTED] Domestic Sysadmin :-)
Re: How can I use mutt on disconnected laptops?
Claus Fischer [EMAIL PROTECTED] wrote on Fri, 13 Oct 2000: 1. I'm thinking of using rsync for the mail folders. I'd have to use an mbox since rsync doesn't know about mail spool locking. How about you use Maildir instead? It's file-per-message, so rsync presumably would work better with that, instead of having to compare file contents and find the differences... The problems I see with Maildir is: - message flags changes, if these are reflected in the filenames, then rsync thinks they are two different files, when they're still the same message - message deletion -- can rsync be instructed to look at contents of directory A and compare it to directory B, and as well as create any missing files in directory B, also delete any extra files? In fact solving the delete problem also solves the first problem, since the old message with old flags will get deleted, and the message with new flags will get created. Since Maildir stores new messages in a separate directory from the old/read messages, you can have different synchronising methods for each -- that way you won't ever delete messages during a sync from the "new" dir, only the old/read dir ("cur"). Can I somehow run mutt in batch mode to move all mail from /var/spool/username to ~username/mbox before syncing? Hmm, I suppose it could be doable: create a special .muttrc with $move set to "yes", and then push something to mark everything as read, and then exit Mutt -- it will then automatically move every message from the folder on exit. But I wouldn't use Mutt for this, I would use some specialised script or some other tool maybe. Or better yet, use a Maildir-format INBOX which would be located somewhere under the home directory, and deliver all incoming mail there with procmail or maildrop. 3. I need to guarantee that mutt isn't running while I do the rsync, otherwise something will be corrupted. This won't be a problem under Maildir, the same design which eliminates the need for locking also means this isn't a problem. Regards, Mikko -- // Mikko Hänninen, aka. Wizzu // [EMAIL PROTECTED] // http://www.iki.fi/wiz/ // The Corrs list maintainer // net.freak // DALnet IRC operator / // Interests: roleplaying, Linux, the Net, fantasy scifi, the Corrs / "Out of my mind. Back in five minutes."
Re: How can I use mutt on disconnected laptops?
Claus - I read email from both my laptop and desktop machines (which are each in different email domains, ISPs, etc), and I do this fairly simply since my email server uses POP3 (I believe that something similar is possible using IMAP, but I don't know exactly how to do it since I don't have access to any mail servers which run IMAP). Just use fetchmail and supply the UIDL keyword - now each host running email will d/l its own copy of your mail (thus, both the laptop and the main PC will each have the full set of email). Of course, you'll have to d/l and mark as read email on 1 machine which you've already read on the other but that's pretty trivial and easy. And using fetchmail makes it easy to use procmail as well, which is a Good Thing. Here's my fetchmail invocation from my .fetchmailrc: poll pop3 mail server with proto POP3 uidl user "remote username" there with password "password" is "local username" here options keep Works okay for me and is fully automatic. No need for rsync, single mutt running guarantees, etc. /joel Quoting Claus Fischer [EMAIL PROTECTED]: -- Date: Fri, 13 Oct 2000 23:31:03 -0700 From: Claus Fischer [EMAIL PROTECTED] Subject: How can I use mutt on disconnected laptops? I have a laptop which is sometimes disconnected from my main PC. I want to use mutt alternatingly on both systems, for the same inbox and mail folders. Does anyone have a proven method of doing that? Like that: work on main PC synchronize disconnect work on laptop connect synchronize ... [ start over ] 1. I'm thinking of using rsync for the mail folders. I'd have to use an mbox since rsync doesn't know about mail spool locking. Can I somehow run mutt in batch mode to move all mail from /var/spool/username to ~username/mbox before syncing? 2. Is there a better tool for handling mail boxes than rsync? One that merges two mailbox files but doesn't create duplicate identical messages? 3. I need to guarantee that mutt isn't running while I do the rsync, otherwise something will be corrupted. Is it possible to gracefully terminate a running mutt? killall -QUIT mutt mutt: - kill editor - postpone currently composed message - do a `quit' (including expunge) - remove pid file - exit(0) wait for pid file to go away and rsync [ just dreaming ] If someone has experience with that situation I would appreciate scripts or comments; otherwise I'll experiment and perhaps report back. Regards, Claus - -- Claus Fischer [EMAIL PROTECTED] -- joel wittenberg [EMAIL PROTECTED] [work] [EMAIL PROTECTED] [permanent]
Re: How can I use mutt on disconnected laptops?
On Sun, Oct 15, 2000 at 12:15:04PM -0700, joel wittenberg wrote: I read email from both my laptop and desktop machines (which are each in different email domains, ISPs, etc), and I do this fairly simply since my email server uses POP3 (I believe that something similar is possible using IMAP, but I don't know exactly how to do it since I don't have access to any mail servers which run IMAP). Just use fetchmail and supply the UIDL keyword - now each host running email will d/l its own copy of your mail (thus, both the laptop and the main PC will each have the full set of email). Of course, you'll have to d/l and mark as read email on 1 machine which you've already read on the other but that's pretty trivial and easy. And using fetchmail makes it easy to use procmail as well, which is a Good Thing. this would work for getting mail, but you would still lose the sent mail data, and would have to process all your mail twice... the only way to achieve all this that I can think of, without scripts and such, is to use IMAP... which is a whole other bag of tricks... :) -- Dan Boger System Administrator [EMAIL PROTECTED] PGP signature
Re: How can I use mutt on disconnected laptops?
On Sun, Oct 15, 2000 at 06:34:55PM -0400, Dan Boger wrote: : On Sun, Oct 15, 2000 at 12:15:04PM -0700, joel wittenberg wrote: : I read email from both my laptop and desktop machines (which are : each in different email domains, ISPs, etc), and I do this fairly simply : since my email server uses POP3 (I believe that something similar is : possible using IMAP, but I don't know exactly how to do it since I don't : have access to any mail servers which run IMAP). Just use fetchmail and : supply the UIDL keyword - now each host running email will d/l its own : copy of your mail (thus, both the laptop and the main PC will each have : the full set of email). Of course, you'll have to d/l and mark as read : email on 1 machine which you've already read on the other but that's : pretty trivial and easy. And using fetchmail makes it easy to use : procmail as well, which is a Good Thing. : : this would work for getting mail, but you would still lose the sent mail : data, and would have to process all your mail twice... the only way to : achieve all this that I can think of, without scripts and such, is to use : IMAP... which is a whole other bag of tricks... That's just the point. I archive my sent mail and also important incoming mail, and I want to share the archive system between my laptop and my desktop. I have a fetchmail setup right now, but this is not what I want. I want to wade through my 100 emails/day exactly once: some is junk, some is mailing lists which I mostly digest and delete, some is important and needs to be answered and/or saved. Right now I see scripts as my only chance; if someone has experience with a good setup please let me know. Claus -- Claus Fischer [EMAIL PROTECTED]
Re: How can I use mutt on disconnected laptops?
Claus Fischer [EMAIL PROTECTED] wrote on Sun, 15 Oct 2000: Right now I see scripts as my only chance; if someone has experience with a good setup please let me know. Well, one alternative you may consider looking into is AFS (Andrew File System). I've never used it myself, but IIRC it supports "disconnected" use, with syncing upon reconnect. If you put your mail directory via AFS and then mount that from your laptop, you should be able to disconnect and then reconnect later, and the filesystem would take care of the syncing. However in this case I do recommend (again) Maildir, as I'm not sure how will it would handle changes to a single file while disconnected (ie. mbox folders). From what little I know of AFS, it's not simple to set up, so may be too complex for this kind of use. Still, it may be worth looking into. Regards, Mikko -- // Mikko Hänninen, aka. Wizzu // [EMAIL PROTECTED] // http://www.iki.fi/wiz/ // The Corrs list maintainer // net.freak // DALnet IRC operator / // Interests: roleplaying, Linux, the Net, fantasy scifi, the Corrs / SETI@home -- http://setiathome.ssl.berkeley.edu/ -- The aliens must be found!
Re: How can I use mutt on disconnected laptops?
there's a tricky thing here, though. if a message exists on the desktop machine, not on the laptop, there are two possibilities. 1) you downloaded it to the laptop deleted it, or 2) it's new mail you've never downloaded to laptop. this could be dealt with by keeping a record of when syncs happen comparing that to file mod times, i suppose. or does maildir do this in some special way? peter On 16 Oct 00, 2:43AM, Mikko Hänninen wrote: Claus Fischer [EMAIL PROTECTED] wrote on Sun, 15 Oct 2000: Right now I see scripts as my only chance; if someone has experience with a good setup please let me know. Well, one alternative you may consider looking into is AFS (Andrew File System). I've never used it myself, but IIRC it supports "disconnected" use, with syncing upon reconnect. If you put your mail directory via AFS and then mount that from your laptop, you should be able to disconnect and then reconnect later, and the filesystem would take care of the syncing. However in this case I do recommend (again) Maildir, as I'm not sure how will it would handle changes to a single file while disconnected (ie. mbox folders). From what little I know of AFS, it's not simple to set up, so may be too complex for this kind of use. Still, it may be worth looking into. Regards, Mikko
Re: How can I use mutt on disconnected laptops?
On Fri, Oct 13, 2000 at 11:31:03PM -0700 or thereabouts, Claus Fischer wrote: I have a laptop which is sometimes disconnected from my main PC. I want to use mutt alternatingly on both systems, for the same inbox and mail folders. Does anyone have a proven method of doing that? Like that: work on main PC synchronize disconnect work on laptop connect synchronize ... [ start over ] There's a few interesting issues here... Differences arise depending on whether your main PC connects to the internet while the laptop is disconnected or not. If there's no internet connection happening, you could do something as simple as copy the more recent file over the older version in either direction. OTOH, if the main PC is receiving mail while the laptop's away, you,ll need a more sophisticated solution. I'd be thinking of something along the lines of a combination of pop, procmail and formail. For example, you could do something like cat ~/mbox | /usr/bin/formail -D 8192 msgid.cache laptop:~/mbox cat laptop:~/mbox | /usr/bin/formail -D 8192 msgid.cache ~/mbox and similarly for other folders (I don't know what the "8192" bit means above, I just copied it blindly from Telsa's .procmailrc). If you create a new folder on one machine, a script like the following should duplicate it on the other one. #!/bin/bash # Synchronise mail folders on two machines # We'll assume that somehow (NFS?) the user's laptop $HOME directory has # been mounted as $HOME/laptop on the desktop machine # First we process the mail on the desktop machine cd ~/ for MAIL_FOLDER in (./mbox `echo Mail/*`); do cat ~/$MAIL_FOLDER | /usr/bin/formail -D 8192 $MAIL_FOLDER.msgid.cache ~/laptop/$MAIL_FOLDER done # Next we process the laptop cd ~/laptop for MAIL_FOLDER in (./mbox `echo Mail/*`); do cat ~/laptop/$MAIL_FOLDER | /usr/bin/formail -D 8192 $MAIL_FOLDER.msgid.cache ~/$MAIL_FOLDER done # That's it. It's up to the user now to keep the mail folders trim to avoid # lots of old messages from being reprocessed! This should synchronise all mail folders in either direction and duplicate new folders also at the cost of reprocessing *every* email message in your possession! Note: usual disclaimers apply, this has not been tested. If it breaks, you get to keep both pieces. The "formail -D" bit should be properly researched before using it on your valuable email. 3. I need to guarantee that mutt isn't running while I do the rsync, otherwise something will be corrupted. Is it possible to gracefully terminate a running mutt? killall -QUIT mutt mutt: - kill editor - postpone currently composed message - do a `quit' (including expunge) - remove pid file - exit(0) wait for pid file to go away and rsync [ just dreaming ] I don't know if it's necessary to kill mutt using this method. I'm certainly running mutt when new mail arrives and gets added to the currently open mailbox. I think, since formail and mutt are used to getting along, there's no need to worry. That's nice because it means you can set up a cron job to keep the machines synchronised or maybe have something in the user's .login and .logout to check if the two machines are connected and if so, synchronise! If someone has experience with that situation I would appreciate scripts or comments; otherwise I'll experiment and perhaps report back. Experiment won't you... Regards, Claus Waiting to hear what happened... :-) -- Conor Daly Met Eireann, Glasnevin Hill, Dublin 9, Ireland Ph +353 1 8064217 Fax +353 1 8064275
Re: How can I use mutt on disconnected laptops?
On Sat, Oct 14, 2000 at 02:35:24PM +, Conor Daly wrote: cat ~/mbox | /usr/bin/formail -D 8192 msgid.cache laptop:~/mbox cat laptop:~/mbox | /usr/bin/formail -D 8192 msgid.cache ~/mbox and similarly for other folders (I don't know what the "8192" bit means above, I just copied it blindly from Telsa's .procmailrc). the 8192 is the size of the cache for the IDs - if you're processing a large mailbox though, (say, more than 10-20 messages) you'd defenitly want this larger... at least 64k, if not more... another way to go at it, and this also works only if there's only one machine that is getting the mail, is just put the mailfolder (or the maildir) in an nfs share... Dan PGP signature
Re: How can I use mutt on disconnected laptops?
On Sat, Oct 14, 2000 at 01:45:51PM -0400, Dan Boger wrote: the 8192 is the size of the cache for the IDs - if you're processing a large mailbox though, (say, more than 10-20 messages) you'd defenitly want this larger... at least 64k, if not more... The cache is merely a set of null-terminated message IDs. On my box, a 256k cache holds about 6500 msgids, in other words the msgids are averaging about 40 bytes each. Adjust the cache size accordingly. -- - Bruce