help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using movemail directly in .emacs


From: lee
Subject: Re: using movemail directly in .emacs
Date: Sat, 24 May 2014 14:39:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Hikaru Ichijyo <ichijyo@macross.sdf.jp> writes:

> I'd like to start handling my email in Emacs, probably in VM.  But I 
> have seen that all Emacs mailreaders like to move the spool file into 
> the home directory before operating, because none of them can do locking 
> on a mailbox in place while the system mailer daemon is trying to append 
> new messages.  (This is not as outrageous of an expectation as it 
> sounds.  Mutt, Pine/Alpine, and KMail can all do this, and they all 
> provide code examples for ways it could be done.)

Gnus can probably do what you want.  However, I wouldn`t recommend
operating on the mail spool file or otherwise using a single file to
store emails.

> I'd like to keep my inbox in the system spool where other email programs 
> expect it, so I can freely go back and forth between various email 
> programs while I'm in the process of getting myself moved over to an 
> Emacs way of thinking.

IMAP might be the best solution for this.

> Would it be possible to directly call movemail from the .emacs file and 
> make it do the following?  This is what I want to do:

Gnus can do mail splitting on it`s own.

> - When Emacs launches, I want my .emacs file to run movemail, and put my 
> system spool inbox into my home directory in a place that VM expects it.

You could start gnus from within your .emacs.

> - It can be safely assumed that so long as Emacs is running, I'm not 
> going to run Alpine or Mutt or anything similar -- if Emacs is 
> available, I'll use Emacs for mail, and it won't matter that my inbox is 
> in my home directory at that time.

When you have your MTA deliver in maildir format, you can run all your
MUAs at the same time.

> - When Emacs shuts down, I'd like to use its shutdown hooks to append 
> any newly received messages in the system spool to the inbox in my home 
> directory, and then use movemail to put the whole home directory inbox 
> back into /var/spool/mail before Emacs quits itself.

You would need to disable mail delivery to the spool file (lock the
spool file) during this operation.  And I wouldn`t want to copy a file
of currently over 4GB back and forth every time I start or exit emacs.

> Is any of this impossible or misguided?  I'd just strongly prefer my 
> mailbox in the system spool area where most UNIX tools expect it to
> be.

It`s not impossible, yet it doesn`t make much sense.  Using a single
file like the spool file is an anachronism (and apparently doesn`t work
too well over NFS).  A single file is very awkward to work with: When
you delete an email somewhere within the file or set a flag (like read,
answered, etc.), the whole file needs to be rewritten.  That wouldn`t be
ideal with a file of over 4GB.

In any case, the file can easily be damaged, in which case you might
loose all your email.  What happens when your computer crashes while
it`s copying or rewriting your 4GB+ spool file?

Do you really need an assortment of various tools that work with the
spool file?  I doubt it, especially not when you use gnus.  If you do
need to use many different MUAs, IMAP may be a good idea.  When you use
maildir or IMAP, you can use both gnus and mutt and any other MUA that
supports maildir.

Other than that, just use gnus with it`s native nnml.  While getting
used to gnus, just back up your email frequently.

In any case, do not store all your email in a single file.  It`s one
file per email since file systems don`t have issues with many files in a
single directory anymore.


-- 
Knowledge is volatile and fluid.  Software is power.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]