Re: save/reply single command

2014-12-09 Thread Jon LaBadie
On Tue, Dec 09, 2014 at 06:32:13PM -0500, Patrick Shanahan wrote:
> * Jon LaBadie  [12-09-14 18:22]:
>  [...]
> > When I save it is most often to a file specific to the message sender. 
> > So I might save a message from you to a file called "ptilopteri" and it
> > would be appended to our previous communications.  My reply would also
> > be automatically saved to the end of the same file.
> > 
> > In "ptilopteri" your message would appear before my reply.  That is what
> > I called "proper order".  If I reply and later save, the order in the
> > file is reversed.
> > 
> > The order of messages in a file doesn't matter much if I read it with
> > mutt -f "".  But I've looked at enough mail files with less
> > or edited them with vi, to appreciate having the messages in "proper
> > order".
> 
> So you are more interested in the "order" within the mbox file rather than
> what an email client would present.  You are changing horses and this
> conversation would have been considerably briefer had you explained this. 
> I still see no value in your approach, but now understand what you are
> saying.

No, my primary interest is in a single command to "save, reply, delete".

jl
-- 
Jon H. LaBadie j...@jgcomp.com
 11226 South Shore Rd.  (703) 787-0688 (H)
 Reston, VA  20190  (703) 935-6720 (C)


Re: save/reply single command

2014-12-09 Thread Patrick Shanahan
* Jon LaBadie  [12-09-14 18:22]:
 [...]
> When I save it is most often to a file specific to the message sender. 
> So I might save a message from you to a file called "ptilopteri" and it
> would be appended to our previous communications.  My reply would also
> be automatically saved to the end of the same file.
> 
> In "ptilopteri" your message would appear before my reply.  That is what
> I called "proper order".  If I reply and later save, the order in the
> file is reversed.
> 
> The order of messages in a file doesn't matter much if I read it with
> mutt -f "".  But I've looked at enough mail files with less
> or edited them with vi, to appreciate having the messages in "proper
> order".

So you are more interested in the "order" within the mbox file rather than
what an email client would present.  You are changing horses and this
conversation would have been considerably briefer had you explained this. 
I still see no value in your approach, but now understand what you are
saying.
 
> mairix sounds interesting, thanks for mentioning it.

Used to not work on mbox but several years ago was revised and I have
never looked back.  It still has some rough edges but not enough to worry
about.  If you use mairix, you have no need to be concerned about the
"order" within the mbox files.  The order would be that which *you* direct
mutt or other mail client to observe as mairix delivers what you define in
an mbox file and anything you do to those msgs do not change the
originals.  The location of the originals is also provided within the
mairix formed mbox file.

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://linuxcounter.net


Re: save/reply single command

2014-12-09 Thread Jon LaBadie
On Tue, Dec 09, 2014 at 05:45:21PM -0500, Patrick Shanahan wrote:
> * Jon LaBadie  [12-09-14 16:56]:
> > On Tue, Dec 09, 2014 at 02:46:30PM -0500, Patrick Shanahan wrote:
> > > * Jon LaBadie  [12-09-14 14:26]:
> > > > If I want to save a message and reply to the sender
> > > > it is a multi-step operation.  "s", which saves the
> > > > message, deletes it from the inbox, and indexes to
> > > > the next unread message.  Then I have to return to
> > > > the deleted message and hit "r".
> > > > 
> > > > Does anyone have a way to do this in one operation?
> > > 
> > > Not in one, nor would I prefer, but you can eliminate a step by replying
> > > first and then saving, or using something like procmail to direct the msg
> > > to your "save" destination and reply from there.  That would eliminate
> > > *all* the extra steps.
> > 
> > Minor reason to not do it in reply -> save order.  The physical
> > order in the mbox-style file would be out of order.  
> 
> When you save or move a msg from one directory to another does not change
> the delivery date.  
> 
> > Doesn't matter if it is only viewed with a threaded reader like mutt. 
> > But in case other tools are used, like text searches, I'd prefer to keep
> > the "proper order".
> 
> I guess "proper order" is undefined.  I sort by thread on rec'd time-date
> and nothing changes on moving or saving except the mbox file time.  The
> msg is an entity within the mbox file, not a stand-a-lone file.  Guess I
> fail to understand your needs or you fail to understand mbox.  I use
> mairix to find and present and it presents in a directory sorted as I
> demand, thread by date-time.

When I save it is most often to a file specific to the message sender.
So I might save a message from you to a file called "ptilopteri" and it
would be appended to our previous communications.  My reply would also
be automatically saved to the end of the same file.

In "ptilopteri" your message would appear before my reply.  That is what
I called "proper order".  If I reply and later save, the order in the
file is reversed.

The order of messages in a file doesn't matter much if I read it with
mutt -f "".  But I've looked at enough mail files with less
or edited them with vi, to appreciate having the messages in "proper
order".

mairix sounds interesting, thanks for mentioning it.

Jon
-- 
Jon H. LaBadie j...@jgcomp.com
 11226 South Shore Rd.  (703) 787-0688 (H)
 Reston, VA  20190  (703) 935-6720 (C)


Re: Stupid regexp tricks

2014-12-09 Thread David Champion
* On 09 Dec 2014, John Long wrote: 
> The messages seem to all have message-ids in the form
> 
> bunchofch...@m.something.com

You'll need to be much more specific if you want help writing a matching
regex.  Is "something" a semantic variable or literal?  What does
"bunchofchars" look like?

>From all I can gather it sounds like they're generating totally legit
and normalized message-ids.  Any message-id that someone out here
provides you will match false positives as well.  That's why we need
specific examples to help.

> They also have email ids in the form
> 
> Idiot Spammer 

By "email id" do you mean address?  Again, that looks completely normal.
Matching it will require examples.

> > However if your spammer's message-ids are actually showing an RFC822
> > address format, you might try:
> > 
> > ~i '\S+\s+<\S+@\S+>'
> > 
> > I'm assuming your regex library supports \s, \S. PCRE does. Otherwise
> > you could try
> > 
> > ~i '[^ ]+ +<[^ ]+@[^ ]+>'
> 
> You lost me on these two regexps. What's going on here?

That matches the following:

[text][whitespace]<[text]@[text]>

This is what an email address should look like, but a message ID should
have only the  part.  (It should not have leading text +
whitespace.)

-- 
David Champion • d...@bikeshed.us


Re: save/reply single command

2014-12-09 Thread Patrick Shanahan
* Jon LaBadie  [12-09-14 16:56]:
> On Tue, Dec 09, 2014 at 02:46:30PM -0500, Patrick Shanahan wrote:
> > * Jon LaBadie  [12-09-14 14:26]:
> > > If I want to save a message and reply to the sender
> > > it is a multi-step operation.  "s", which saves the
> > > message, deletes it from the inbox, and indexes to
> > > the next unread message.  Then I have to return to
> > > the deleted message and hit "r".
> > > 
> > > Does anyone have a way to do this in one operation?
> > 
> > Not in one, nor would I prefer, but you can eliminate a step by replying
> > first and then saving, or using something like procmail to direct the msg
> > to your "save" destination and reply from there.  That would eliminate
> > *all* the extra steps.
> 
> Minor reason to not do it in reply -> save order.  The physical
> order in the mbox-style file would be out of order.  

When you save or move a msg from one directory to another does not change
the delivery date.  

> Doesn't matter if it is only viewed with a threaded reader like mutt. 
> But in case other tools are used, like text searches, I'd prefer to keep
> the "proper order".

I guess "proper order" is undefined.  I sort by thread on rec'd time-date
and nothing changes on moving or saving except the mbox file time.  The
msg is an entity within the mbox file, not a stand-a-lone file.  Guess I
fail to understand your needs or you fail to understand mbox.  I use
mairix to find and present and it presents in a directory sorted as I
demand, thread by date-time.

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://linuxcounter.net


Re: save/reply single command

2014-12-09 Thread Jon LaBadie
On Tue, Dec 09, 2014 at 02:46:30PM -0500, Patrick Shanahan wrote:
> * Jon LaBadie  [12-09-14 14:26]:
> > If I want to save a message and reply to the sender
> > it is a multi-step operation.  "s", which saves the
> > message, deletes it from the inbox, and indexes to
> > the next unread message.  Then I have to return to
> > the deleted message and hit "r".
> > 
> > Does anyone have a way to do this in one operation?
> 
> Not in one, nor would I prefer, but you can eliminate a step by replying
> first and then saving, or using something like procmail to direct the msg
> to your "save" destination and reply from there.  That would eliminate
> *all* the extra steps.

Minor reason to not do it in reply -> save order.  The physical
order in the mbox-style file would be out of order.  Doesn't
matter if it is only viewed with a threaded reader like mutt.
But in case other tools are used, like text searches, I'd
prefer to keep the "proper order".
-- 
Jon H. LaBadie j...@jgcomp.com
 11226 South Shore Rd.  (703) 787-0688 (H)
 Reston, VA  20190  (703) 935-6720 (C)


Re: Stupid regexp tricks

2014-12-09 Thread Nathan Stratton Treadway
On Tue, Dec 09, 2014 at 16:17:00 -0500, Nathan Stratton Treadway wrote:
> but mutt also processes backslashes when it is parsing the command line
> defining the expresion -- so you may need to quote the backslashes.

(Here's the explaination of this topic from the mutt manual, near the
bottom of the "Pattern Modifier" section:
  Special attention has to be payed when using regular expressions
  inside of patterns. Specifically, Mutt's parser for these patterns
  will strip one level of backslash (\), which is normally used for
  quoting. If it is your intention to use a backslash in the regular
  expression, you will need to use two backslashes instead (\\).
)

Nathan



Re: Stupid regexp tricks

2014-12-09 Thread John Long
Hi, answers within

On Tue, Dec 09, 2014 at 02:53:50PM -0600, David Champion wrote:
> * On 09 Dec 2014, John Long wrote: 
> > On Tue, Dec 09, 2014 at 02:54:59AM -0500, Jon LaBadie wrote:
> > > On Tue, Dec 09, 2014 at 07:15:13AM +, John Long wrote:
> > 
> > > In your RE expression you have two literal periods (m. and
> > > .com) plus one meta-period (.*).  One of the literal periods
> > > is escaped (\.com) the other is not.
> > > 
> > > Both literal periods should be the same (escaped or not escaped)
> > > and the meta-period should be the opposite.
> > 
> > Thanks. If I understood what you said and did this right then that did match
> > the spammers but is still killing google mail.
> 
> I'm not sure what exactly you need to match - your example in the first
> mail looks like a paraphrasing, so not sure what parts are variable.

The messages seem to all have message-ids in the form

bunchofch...@m.something.com

They also have email ids in the form

Idiot Spammer 

> However if your spammer's message-ids are actually showing an RFC822
> address format, you might try:
> 
> ~i '\S+\s+<\S+@\S+>'
> 
> I'm assuming your regex library supports \s, \S. PCRE does. Otherwise
> you could try
> 
> ~i '[^ ]+ +<[^ ]+@[^ ]+>'

You lost me on these two regexps. What's going on here?

> Also note the "spam" command, which can be used to classify spam.  It's
> normally for matching spam scores from spam filters, but you could use
> it instead to add these messages as high-scoring spam.  This allows you
> to treat all spam in aggregate, distinctly from other scoring.
> 
> http://www.mutt.org/doc/devel/manual.html#spam

Thanks, I looked over this when I first asked about killfiling but I decided
scoring was enough for my purposes. My only problem is not understanding how
to match these bastards. All of the other miscreants have already been
successfully killfiled.

Thanks a lot,

/jl

-- 
ASCII ribbon campaign ( ) Powered by Lemote Fuloong
 against HTML e-mail   X  Loongson MIPS and OpenBSD
   and proprietary/ \http://www.mutt.org
 attachments /   \  Code Blue or Go Home!
 Encrypted email preferred  PGP Key 2048R/DA65BC04 


Re: Stupid regexp tricks

2014-12-09 Thread Nathan Stratton Treadway
On Tue, Dec 09, 2014 at 20:39:16 +, John Long wrote:
> score '~i @m\..*\.com'-
> 
> matches on 
> 
> Message-ID: <5486ad9f.8186460a.0aee.1...@mx.google.com>

You want the actual regex to contain backslashed period characters...
but mutt also processes backslashes when it is parsing the command line
defining the expresion -- so you may need to quote the backslashes.

In other words, does this work?
  score '~i @m\\..*\\.com'  -

Alternatively, you might be able to use this form to specify a literal
"." character without the need for backslashes:
  score '~i @m[.].*[.]com'  -

Nathan


Re: Stupid regexp tricks

2014-12-09 Thread David Champion
* On 09 Dec 2014, John Long wrote: 
> On Tue, Dec 09, 2014 at 02:54:59AM -0500, Jon LaBadie wrote:
> > On Tue, Dec 09, 2014 at 07:15:13AM +, John Long wrote:
> 
> > In your RE expression you have two literal periods (m. and
> > .com) plus one meta-period (.*).  One of the literal periods
> > is escaped (\.com) the other is not.
> > 
> > Both literal periods should be the same (escaped or not escaped)
> > and the meta-period should be the opposite.
> 
> Thanks. If I understood what you said and did this right then that did match
> the spammers but is still killing google mail.

I'm not sure what exactly you need to match - your example in the first
mail looks like a paraphrasing, so not sure what parts are variable.
However if your spammer's message-ids are actually showing an RFC822
address format, you might try:

~i '\S+\s+<\S+@\S+>'

I'm assuming your regex library supports \s, \S. PCRE does. Otherwise
you could try

~i '[^ ]+ +<[^ ]+@[^ ]+>'

Also note the "spam" command, which can be used to classify spam.  It's
normally for matching spam scores from spam filters, but you could use
it instead to add these messages as high-scoring spam.  This allows you
to treat all spam in aggregate, distinctly from other scoring.

http://www.mutt.org/doc/devel/manual.html#spam

-- 
David Champion • d...@bikeshed.us


Re: Stupid regexp tricks

2014-12-09 Thread John Long
On Tue, Dec 09, 2014 at 02:54:59AM -0500, Jon LaBadie wrote:
> On Tue, Dec 09, 2014 at 07:15:13AM +, John Long wrote:

> In your RE expression you have two literal periods (m. and
> .com) plus one meta-period (.*).  One of the literal periods
> is escaped (\.com) the other is not.
> 
> Both literal periods should be the same (escaped or not escaped)
> and the meta-period should be the opposite.

Thanks. If I understood what you said and did this right then that did match
the spammers but is still killing google mail.

score '~i @m\..*\.com'  -

matches on 

Message-ID: <5486ad9f.8186460a.0aee.1...@mx.google.com>

Any ideas? Thanks.

/jl

-- 
ASCII ribbon campaign ( ) Powered by Lemote Fuloong
 against HTML e-mail   X  Loongson MIPS and OpenBSD
   and proprietary/ \http://www.mutt.org
 attachments /   \  Code Blue or Go Home!
 Encrypted email preferred  PGP Key 2048R/DA65BC04 


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Cameron Simpson

On 09Dec2014 10:33, Chris Green  wrote:

On Tue, Dec 09, 2014 at 06:21:31PM +1100, Cameron Simpson wrote:

On 08Dec2014 22:04, Chris Green  wrote:
>Doesn't anyone use IMAP?  I must admit when I tried it (a few times
>over the years, but not very recently) it never felt quite as easy and
>transparent as using mutt on a local mail spool.

I would advocate trying offlineimap. I am a huge fan of having one's
mail local to the machine for all the reasons you have outlined.


[snip]

Well, looking at offlineimap has lead me to notmuch as well which has
got me thinking down those lines too!  :-)

However, for me, moving to offlineimap involves quite a bit of
reconfiguration work as I currently use mbox and I don't have an IMAP
server running on the machine where the E-Mails initially get
delivered.


You can probably install dovecot on the main machine easily. If the remote 
machine is personal (you desktop machine, yes?) you could configure its IMAP 
and POP services to listen only on localhost for security; use an ssh port 
forward to gain remote access to them.


If you choose offlineimap for bidirectional mirroring then you have the maildir 
conversion issue to consider.


Note that maildirs do take more disc space due to the separation of messages 
into individual files. My personal practice is presently to use maildirs for 
most "live" folders and to use mbox for archival folders. Offlineimap does not 
need to mirror all your folders; it can manage an arbitrary subset.


Then the primary change is to tell dovecot to use maildirs (and to convert your 
mail folders). For dovecot, the dovecot.conf file wants the mail_location 
setting configured, for example:


 mail_location = maildir:~/Maildir

which says to use maildir and to look for the user's folders in ~/Maildir.

Mutt will cope automatically for existing folders, though you may want to tell 
it to make maildirs by default for new folders:


 set mbox_type=maildir

Then there's mbox to maildir conversion. Tedious. There are ways to automate 
that. The simplest may to script mutt itself. Have a look at my mboxify script:


 https://bitbucket.org/cameron_simpson/css/src/tip/bin/mboxify

which I am using to progressively turn my archive folders into mboxes, and 
reverse it. It has a bunch of checks, but you could pull out the core 
invocation of mutt towards the bottom of the script and invert it to convert an 
mbox into a maildir.


Cheers,
Cameron Simpson 

Your reality is lies and balderdash, and I'm glad to say that I have no grasp
of it.  - Baron Munchausen


Re: save/reply single command

2014-12-09 Thread Patrick Shanahan
* Jon LaBadie  [12-09-14 14:26]:
> If I want to save a message and reply to the sender
> it is a multi-step operation.  "s", which saves the
> message, deletes it from the inbox, and indexes to
> the next unread message.  Then I have to return to
> the deleted message and hit "r".
> 
> Does anyone have a way to do this in one operation?

Not in one, nor would I prefer, but you can eliminate a step by replying
first and then saving, or using something like procmail to direct the msg
to your "save" destination and reply from there.  That would eliminate
*all* the extra steps.

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://linuxcounter.net


save/reply single command

2014-12-09 Thread Jon LaBadie
If I want to save a message and reply to the sender
it is a multi-step operation.  "s", which saves the
message, deletes it from the inbox, and indexes to
the next unread message.  Then I have to return to
the deleted message and hit "r".

Does anyone have a way to do this in one operation?

Jon
-- 
Jon H. LaBadie j...@jgcomp.com
 11226 South Shore Rd.  (703) 787-0688 (H)
 Reston, VA  20190  (703) 935-6720 (C)


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Eduardo Alvarez
On Mon, Dec 08, 2014 at 10:04:26PM +, Chris Green wrote:
> > Hello, Chris,
> > 
> > What I do is that at work, I mount my home mail folder using sshfs. That 
> > way, I
> > can use my local copies of mutt, xpdf, etc. With large messages, it can get
> > slow, sometimes, but it does save some time.
> > 
> Yes, I guess that's one way of doing it, not too difficult to automate
> using a script.  I could simply mount my ~/.mutt and my ~/Mail
> directories and run mutt on the laptop (which is what I'm always using
> when away from home).  Slow with mbox I fear though, I might have to
> change to Maildir to make it usable.
> 
> Doesn't anyone use IMAP?  I must admit when I tried it (a few times
> over the years, but not very recently) it never felt quite as easy and
> transparent as using mutt on a local mail spool.

My setup consists on downloading all my email via getmail onto my local
machine, with regular updates via cron, and posting via msmtpqueue. It harkens
back to a time when internet access wasn't always a given for me, and I like
how it works now, so...

-- 
Eduardo Alvarez

"Stercus, Stercus, Stercus, moriturus sum"
  -- Rincewind The Wizzard


pgpGn7F97azY3.pgp
Description: PGP signature


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Will Yardley
On Mon, Dec 08, 2014 at 03:38:18PM +, Chris Green wrote:
> On Mon, Dec 08, 2014 at 10:30:46AM -0500, Patrick Shanahan wrote:
> > * Chris Green  [12-08-14 10:21]:
> > > E.g. if I want to view an HTML E-Mail in Firefox (default browser)
> > > instead of within mutt (using lynx) can I just do 'v' followed by
> > > selecting the HTML attachment as I would when running mutt locally on
> > > the machine where mail is hosted?

> > I work somewhat similarily.  I store all mail on my local box and maintain
> > a tmux session which I access remotely via ssh -X.

> Yes, that's the alternative (to IMAP) really.  However a lot of my
> remote locations are very remote and have slow connections, running a
> browser remotely would be unusably slow and similarly NFS would be
> messy and insecure.

You could also look at tools like offlineimap or imapsync

https://wiki.archlinux.org/index.php/OfflineIMAP



Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Dave Dodge
On Mon, Dec 08, 2014 at 03:19:55PM +, Chris Green wrote:
> At the moment to access my mail remotely I ssh into the server and run
> mutt.  This works well in general but there are some disadvantages, in
> particular the 'v' command to access and view HTML, PDF and other
[...]
> 
> So, I'm wondering if using IMAP would make my life easier.  I would
> run Dovecot I expect.  If I do this do things become more transparent
> to a remote mutt?

Just as a data point I'll note that I use both methods on a daily
basis.  As you guessed, aside from the attachment situation there
isn't much difference.

At home I use ssh and run mutt on my mail server.  When I have to
access attachments I use sshfs to access my homedir on the server.

At work I use IMAP (actually IMAPS) because the IT department uses
Microsoft Exchange as their mail server.  There are some annoying
issues with how Exchange's IMAP module sometimes handles TNEF messages
sent by Outlook users, but that's something you wouldn't need to deal
with if you're running your IMAP server on Linux.

In the IMAP situation I can still edit messages in my inbox,
link/unlink threads, move messages between folders including back and
forth between IMAP folders and local maildir directories, and so on.

One case where IMAP might be a downside is if you often have to search
the message bodies, since I think they aren't cached on the mutt side
and will have to be retrieved over IMAP each time you do a search.
The headers do get cached by mutt.

  -Dave Dodge/dodo...@dododge.net


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread John Long
On Tue, Dec 09, 2014 at 11:42:49AM +, Chris Green wrote:

> > If we all misunderstood and you have multiple instances of mutt running and
> > want to be able to access your mail from any of them then use POP and leave
> > the email on the server. Are you forced to use IMAP?
> > 
> I currently read my E-Mails (at different times, not simultaneously)
> using mutt on:-
> 
> The desktop Linux system which is also where Postfix runs to
> receive my E-Mail.
> 
> My laptop running Linux, sometimes on the LAN with the above
> desktop, sometimes out and about connected by someone's home WiFi
> or a 3G connection.
> 
> Rarely, but occasionally, on someone else's system.
> 
> The reason I'd use IMAP rather than POP3 is that I have mail filtering
> running on the desktop server.  There's a custom script that delivers
> mailing list E-Mails (in particular) to separate mailboxes.  I want to
> be able to see these when I read my E-Mail remotely.  Thus I'd simply
> do everything remotely using IMAP, not store anything on the laptop.

If you paint yourself into a corner by not understanding what you are doing
it is much harder for anybody to answer your questions. It seems you are
hell-bent on misunderstanding things and have already decided on an
incorrect unnecessarily, complicated conclusion.

Mail filtering works independent of POP or IMAP. Delivery to spool is
independent of POP or IMAP. The only practical difference between POP and
IMAP is at the client level. IMAP syncs in real time. If you delete a
message in IMAP it is gone from the server. If you use POP you can set
things up so that messages are left on the server for you to access from
other clients.

/jl

-- 
ASCII ribbon campaign ( ) Powered by Lemote Fuloong
 against HTML e-mail   X  Loongson MIPS and OpenBSD
   and proprietary/ \http://www.mutt.org
 attachments /   \  Code Blue or Go Home!
 Encrypted email preferred  PGP Key 2048R/DA65BC04 


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread John Long
On Tue, Dec 09, 2014 at 11:36:48AM +, Chris Green wrote:
> On Tue, Dec 09, 2014 at 10:56:04AM +, John Long wrote:
> > > > If I understood you then yes, but the local machine as far as mutt is
> > > > concerned is the machine where mutt is running [your remote system], not
> > > > where you are running [your ssh session from, your local system]. All
> > > > mutt's working data is where mutt runs, as in all normal apps. 
> > > > 
> > > Exactly.  I'm sitting using my laptop in France (for example) and I
> > > run mutt on the laptop using IMAP to access the E-Mails on my mail
> > > server machine at home.
> > 
> > Are you saying you can host a mail server but you can't understand the
> > difference between running Mutt on a local or remote system? That's
> > difficult to fathom. 
> > 
> > > So, when I use 'v' to view an HTML E-Mail it stores the file in /tmp on
> > > the laptop and points my laptop browser at it to view it?
> > 
> > Check and see?
> 
> That's not so easy!  I don't currently have an IMAP server for mutt to
> connect to, hence
> > 
> > > This was really my original question!  :-) 
> > 
> > If so then you had no question at all. It's obvious Mutt will save the file
> > on the system where mutt is running. It cannot work any other way and this
> > has absolutely nothing to do with IMAP or POP.
> > 
> It could perfectly well use IMAP and save the file somewhere in the
> IMAP hierarchy on the remote system.

No, this is not the way Mutt works. It has nothing to do with IMAP or
POP. The only practical difference is with IMAP what's on the server is
synced with your client. If you delete it, it's deleted on the server. With
POP you can intentionally leave things on the server or delete them when
read. 

> > I believe everyone understood from the beginning of this thread you were
> > ssh-ing to a remote box and running Mutt on the remote machine. All the
> > answers until now have been based on that.
> > 
> Yes, and using IMAP is an *alternative* approach to reading E-Mail
> remotely.

No it is not. It is a mail protocol.

> > > OK, it has to download the file so won't be instant but at least it
> > > works without any extra configuration or commands (except the extra
> > > complexity, if any, of using IMAP).
> > 
> > I must have missed a few posts. This seems out of context.
> > 
> I'm trying to compare the convenience/ease of doing what I do at the
> moment (ssh to remote, run mutt there) and running mutt on the local
> laptop and using IMAP.

It doesn't matter whether you use IMAP or POP. It matters where mutt runs.

> > If you think that's slow then how do you think an SSH filesystem over the
> > same connection will work? Sounds like a terribly bad idea. 
> > 
> The trouble is that Firefox via X transfers vast amounts of data to
> continuously update the screen, there's no attempt at efficiency.  The
> ssh filesystem won't have to transfer anything like the same amoount
> of data.

That's not the point. What is more important to you, having a web page
rendered properly or having your file system in good shape? Anyway this
whole thing is unnecessary.

/jl

-- 
ASCII ribbon campaign ( ) Powered by Lemote Fuloong
 against HTML e-mail   X  Loongson MIPS and OpenBSD
   and proprietary/ \http://www.mutt.org
 attachments /   \  Code Blue or Go Home!
 Encrypted email preferred  PGP Key 2048R/DA65BC04 


Re: Some fairly simple-minded questions about using mutt with IMAP - my conclusion/solution

2014-12-09 Thread Chris Green
Thanks everyone for all the ideas and feedback.

I *think* I have a solution that will work for me.

I'll change the default mutt temporary directory to something that I
can mount easily on the laptop using sshfs, as long as this has a
unique name that can be the same on the desktop server and on the
laptop then files viewed using mutt should be in the 'right place' on
both systems.

I just need to write a wrapper to mount and unmount the directory when
mutt is run on the laptop (or I could just mount it whenever I connect
I suppose).

This requires minimal reconfiguration - no IMAP server, no changes to
my mailbox format - and fixes my current niggles (I think/hope!).

Again, thank you everyone for all your help.

-- 
Chris Green


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Chris Green
On Tue, Dec 09, 2014 at 10:57:33AM +, John Long wrote:
> On Tue, Dec 09, 2014 at 10:33:05AM +, Chris Green wrote:
> > On Tue, Dec 09, 2014 at 06:21:31PM +1100, Cameron Simpson wrote:
> > > On 08Dec2014 22:04, Chris Green  wrote:
> > > >Doesn't anyone use IMAP?  I must admit when I tried it (a few times
> > > >over the years, but not very recently) it never felt quite as easy and
> > > >transparent as using mutt on a local mail spool.
> > > 
> > > I would advocate trying offlineimap. I am a huge fan of having one's
> > > mail local to the machine for all the reasons you have outlined.
> > > 
> > [snip]
> > 
> > Well, looking at offlineimap has lead me to notmuch as well which has
> > got me thinking down those lines too!  :-)
> > 
> > However, for me, moving to offlineimap involves quite a bit of
> > reconfiguration work as I currently use mbox and I don't have an IMAP
> > server running on the machine where the E-Mails initially get
> > delivered. 
> > 
> > So I just need to decide which of many possible routes will serve me
> > best.
> 
> If we all misunderstood and you have multiple instances of mutt running and
> want to be able to access your mail from any of them then use POP and leave
> the email on the server. Are you forced to use IMAP?
> 
I currently read my E-Mails (at different times, not simultaneously)
using mutt on:-

The desktop Linux system which is also where Postfix runs to
receive my E-Mail.

My laptop running Linux, sometimes on the LAN with the above
desktop, sometimes out and about connected by someone's home WiFi
or a 3G connection.

Rarely, but occasionally, on someone else's system.

The reason I'd use IMAP rather than POP3 is that I have mail filtering
running on the desktop server.  There's a custom script that delivers
mailing list E-Mails (in particular) to separate mailboxes.  I want to
be able to see these when I read my E-Mail remotely.  Thus I'd simply
do everything remotely using IMAP, not store anything on the laptop.



-- 
Chris Green


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Chris Green
On Tue, Dec 09, 2014 at 10:56:04AM +, John Long wrote:
> > > If I understood you then yes, but the local machine as far as mutt is
> > > concerned is the machine where mutt is running [your remote system], not
> > > where you are running [your ssh session from, your local system]. All
> > > mutt's working data is where mutt runs, as in all normal apps. 
> > > 
> > Exactly.  I'm sitting using my laptop in France (for example) and I
> > run mutt on the laptop using IMAP to access the E-Mails on my mail
> > server machine at home.
> 
> Are you saying you can host a mail server but you can't understand the
> difference between running Mutt on a local or remote system? That's
> difficult to fathom. 
> 
> > So, when I use 'v' to view an HTML E-Mail it stores the file in /tmp on
> > the laptop and points my laptop browser at it to view it?
> 
> Check and see?

That's not so easy!  I don't currently have an IMAP server for mutt to
connect to, hence
> 
> > This was really my original question!  :-) 
> 
> If so then you had no question at all. It's obvious Mutt will save the file
> on the system where mutt is running. It cannot work any other way and this
> has absolutely nothing to do with IMAP or POP.
> 
It could perfectly well use IMAP and save the file somewhere in the
IMAP hierarchy on the remote system.


> I believe everyone understood from the beginning of this thread you were
> ssh-ing to a remote box and running Mutt on the remote machine. All the
> answers until now have been based on that.
> 
Yes, and using IMAP is an *alternative* approach to reading E-Mail
remotely.


> > OK, it has to download the file so won't be instant but at least it
> > works without any extra configuration or commands (except the extra
> > complexity, if any, of using IMAP).
> 
> I must have missed a few posts. This seems out of context.
> 
I'm trying to compare the convenience/ease of doing what I do at the
moment (ssh to remote, run mutt there) and running mutt on the local
laptop and using IMAP.  It seems as if IMAP will overcome a couple of
the niggles of ssh/mutt but I'm not sure if it's worth the extra
hassle of running an IMAP server and putting up with the extra work
(not much but there is a bit) of using mutt with IMAP.


> > > > No, as I said I just tried it and it doesn't work because Firefox is
> > > > too clever and uses the local Firefox rather than the remote one so the
> > > > file is in the wrong place.
> > > 
> > > Firefox is POS technology, but depending on the version you can start it 
> > > not
> > > to use your local/running instance. try firefox --no-remote and look 
> > > around
> > > on the web if that doesn't do it. I have run into this several times with
> > > network firefox etc and I have it working.
> > > 
> > Yes, I've done it in the past when I was at work and really needed to
> > view something that was only accessible from the browser on my home
> > machine.  Even across a fairly quick UK only internet connection it
> > was horrendously slow.
> 
> If you think that's slow then how do you think an SSH filesystem over the
> same connection will work? Sounds like a terribly bad idea. 
> 
The trouble is that Firefox via X transfers vast amounts of data to
continuously update the screen, there's no attempt at efficiency.  The
ssh filesystem won't have to transfer anything like the same amoount
of data.

-- 
Chris Green


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread John Long
On Tue, Dec 09, 2014 at 10:11:53AM +, Chris Green wrote:
> On Tue, Dec 09, 2014 at 07:07:10AM +, John Long wrote:
> > > > I don't see how IMAP helps. What exactly is the difference in terms of 
> > > > how
> > > > you read mail and where the apps run as opposed to POP? The only thing 
> > > > IMAP
> > > > does it make you rely on a remote mail server. I never use IMAP unless 
> > > > they
> > > > don't serve POP. I know one mail provider that doesn't honor POP delete
> > > > requests so to avoid leaving 100,000 emails on their server that I can't
> > > > delete I use IMAP with them. Everywhere else, POP. I'd rather rely on 
> > > > my own
> > > > email storage.
> > > > 
> > > I wondered if, when using IMAP, mutt will store the temporary HTML for
> > > passing to Firefox on the local machine rather than the remote
> > > machine.  One would expect it to somehow.

This has nothing to do with IMAP. It has to do with how apps work.

I'll clarify within my own comments:

> > If I understood you then yes, but the local machine as far as mutt is
> > concerned is the machine where mutt is running [your remote system], not
> > where you are running [your ssh session from, your local system]. All
> > mutt's working data is where mutt runs, as in all normal apps. 
> > 
> Exactly.  I'm sitting using my laptop in France (for example) and I
> run mutt on the laptop using IMAP to access the E-Mails on my mail
> server machine at home.

Are you saying you can host a mail server but you can't understand the
difference between running Mutt on a local or remote system? That's
difficult to fathom. 

> So, when I use 'v' to view an HTML E-Mail it stores the file in /tmp on
> the laptop and points my laptop browser at it to view it?

Check and see?

> This was really my original question!  :-) 

If so then you had no question at all. It's obvious Mutt will save the file
on the system where mutt is running. It cannot work any other way and this
has absolutely nothing to do with IMAP or POP.

I believe everyone understood from the beginning of this thread you were
ssh-ing to a remote box and running Mutt on the remote machine. All the
answers until now have been based on that.

> OK, it has to download the file so won't be instant but at least it
> works without any extra configuration or commands (except the extra
> complexity, if any, of using IMAP).

I must have missed a few posts. This seems out of context.

> > > No, as I said I just tried it and it doesn't work because Firefox is
> > > too clever and uses the local Firefox rather than the remote one so the
> > > file is in the wrong place.
> > 
> > Firefox is POS technology, but depending on the version you can start it not
> > to use your local/running instance. try firefox --no-remote and look around
> > on the web if that doesn't do it. I have run into this several times with
> > network firefox etc and I have it working.
> > 
> Yes, I've done it in the past when I was at work and really needed to
> view something that was only accessible from the browser on my home
> machine.  Even across a fairly quick UK only internet connection it
> was horrendously slow.

If you think that's slow then how do you think an SSH filesystem over the
same connection will work? Sounds like a terribly bad idea. 

/jl

-- 
ASCII ribbon campaign ( ) Powered by Lemote Fuloong
 against HTML e-mail   X  Loongson MIPS and OpenBSD
   and proprietary/ \http://www.mutt.org
 attachments /   \  Code Blue or Go Home!
 Encrypted email preferred  PGP Key 2048R/DA65BC04 


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread John Long
On Tue, Dec 09, 2014 at 10:33:05AM +, Chris Green wrote:
> On Tue, Dec 09, 2014 at 06:21:31PM +1100, Cameron Simpson wrote:
> > On 08Dec2014 22:04, Chris Green  wrote:
> > >Doesn't anyone use IMAP?  I must admit when I tried it (a few times
> > >over the years, but not very recently) it never felt quite as easy and
> > >transparent as using mutt on a local mail spool.
> > 
> > I would advocate trying offlineimap. I am a huge fan of having one's
> > mail local to the machine for all the reasons you have outlined.
> > 
> [snip]
> 
> Well, looking at offlineimap has lead me to notmuch as well which has
> got me thinking down those lines too!  :-)
> 
> However, for me, moving to offlineimap involves quite a bit of
> reconfiguration work as I currently use mbox and I don't have an IMAP
> server running on the machine where the E-Mails initially get
> delivered. 
> 
> So I just need to decide which of many possible routes will serve me
> best.

If we all misunderstood and you have multiple instances of mutt running and
want to be able to access your mail from any of them then use POP and leave
the email on the server. Are you forced to use IMAP?

/jl

-- 
ASCII ribbon campaign ( ) Powered by Lemote Fuloong
 against HTML e-mail   X  Loongson MIPS and OpenBSD
   and proprietary/ \http://www.mutt.org
 attachments /   \  Code Blue or Go Home!
 Encrypted email preferred  PGP Key 2048R/DA65BC04 


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Chris Green
On Tue, Dec 09, 2014 at 06:21:31PM +1100, Cameron Simpson wrote:
> On 08Dec2014 22:04, Chris Green  wrote:
> >Doesn't anyone use IMAP?  I must admit when I tried it (a few times
> >over the years, but not very recently) it never felt quite as easy and
> >transparent as using mutt on a local mail spool.
> 
> I would advocate trying offlineimap. I am a huge fan of having one's
> mail local to the machine for all the reasons you have outlined.
> 
[snip]

Well, looking at offlineimap has lead me to notmuch as well which has
got me thinking down those lines too!  :-)

However, for me, moving to offlineimap involves quite a bit of
reconfiguration work as I currently use mbox and I don't have an IMAP
server running on the machine where the E-Mails initially get
delivered. 

So I just need to decide which of many possible routes will serve me
best.

-- 
Chris Green


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Chris Green
On Tue, Dec 09, 2014 at 07:07:10AM +, John Long wrote:
> > > I don't see how IMAP helps. What exactly is the difference in terms of how
> > > you read mail and where the apps run as opposed to POP? The only thing 
> > > IMAP
> > > does it make you rely on a remote mail server. I never use IMAP unless 
> > > they
> > > don't serve POP. I know one mail provider that doesn't honor POP delete
> > > requests so to avoid leaving 100,000 emails on their server that I can't
> > > delete I use IMAP with them. Everywhere else, POP. I'd rather rely on my 
> > > own
> > > email storage.
> > > 
> > I wondered if, when using IMAP, mutt will store the temporary HTML for
> > passing to Firefox on the local machine rather than the remote
> > machine.  One would expect it to somehow.
> 
> If I understood you then yes, but the local machine as far as mutt is
> concerned is the machine where mutt is running, not where you are
> running. All mutt's working data is where mutt runs, as in all normal apps.
> 
Exactly.  I'm sitting using my laptop in France (for example) and I
run mutt on the laptop using IMAP to access the E-Mails on my mail
server machine at home.  So, when I use 'v' to view an HTML E-Mail it
stores the file in /tmp on the laptop and points my laptop browser at
it to view it?  This was really my original question!  :-)

OK, it has to download the file so won't be instant but at least it
works without any extra configuration or commands (except the extra
complexity, if any, of using IMAP).


> > No, as I said I just tried it and it doesn't work because Firefox is
> > too clever and uses the local Firefox rather than the remote one so the
> > file is in the wrong place.
> 
> Firefox is POS technology, but depending on the version you can start it not
> to use your local/running instance. try firefox --no-remote and look around
> on the web if that doesn't do it. I have run into this several times with
> network firefox etc and I have it working.
> 
Yes, I've done it in the past when I was at work and really needed to
view something that was only accessible from the browser on my home
machine.  Even across a fairly quick UK only internet connection it
was horrendously slow.

-- 
Chris Green


Re: Stupid regexp tricks

2014-12-09 Thread John Long
Thank you I will try this. Waiting for new spam to show up.

> In your RE expression you have two literal periods (m. and
> .com) plus one meta-period (.*).  One of the literal periods
> is escaped (\.com) the other is not.
> 
> Both literal periods should be the same (escaped or not escaped)
> and the meta-period should be the opposite.



Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-09 Thread Suvayu Ali
Hi Cameron,

On Tue, Dec 09, 2014 at 06:21:31PM +1100, Cameron Simpson wrote:
> 
> For me this is all theoretical so far as I have not had time. But it is a
> real issue I need to address, and I'd like to hear of your efforts if you
> try this route.

I have been doing this for some years now, with great success I might
add.  I use a combination of OfflineIMAP[1] (syncing over IMAP),
Notmuch[2] (indexing), and Mutt-kz[3] (a mutt fork with notmuch
support).  This is my chain:

- Sync with OfflineIMAP
- Call "notmuch new" from OfflineIMAP postsynchook
- Read and send emails with Mutt-kz

Notmuch offers a few pre and post hooks, I address my regular tagging
needs in these hooks.  The rest I do while reading the emails.  Easy
enough :).  I also use a (notmuch) search based address book[4] with
Mutt.  In fact, the latest notmuch release also added a notmuch-address
command.

Let me know if you are interested, I can share more details.

Cheers,


Footnotes:

[1] http://offlineimap.org/
[2] http://notmuchmail.org/
[3] http://kzak.redcrew.org/doku.php?id=mutt:start
[4] https://github.com/domo141/nottoomuch

-- 
Suvayu

Open source is the future. It sets us free.