Re: Nested Folders Not Accessible With OfflineIMAP

2011-11-02 Thread Michael Graham
On Wed, Nov 02, 2011 at 05:10, du yang wrote:

Hi Du Yang,

 There is minor error in your script.
 
 The if condition's syntax is incorrect, it should be like as writing below. 
 (Note the quote mark position.)
 
 if [ -x $folder ]; then

I’ll make that change and see if it works.

 The intention of the script is to generate first level mailboxes start
 with '.' as well as the sub-level mailboxes(mbox or maildir) which starts 
 with '.'(except
 '.', '..', '.customflags', '.subscriptions'). 
 
 Note to show the sub-level mailboxes it requires the first level folder
 not start with '.'. Is this you want?

I don’t really mind whether the first-level folder starts with a ‘.’ or not; I 
only chose “.mail” so it would keep my Finder a little tidier.

 I have some tests with the script. there is a maildir folder structure
 created as below,
 
 # find .maildir/
 .maildir/
 .maildir/list
 .maildir/list/.c
 .maildir/list/.a
 .maildir/list/.b
 .maildir/inbox
 .maildir/.mbox
 .maildir/.list
 .maildir/.list/.c
 .maildir/.list/.a
 .maildir/.list/.b
 
 
 # ./a.sh 
 +.list +.mbox +list/.a +list/.b +list/.c
 
 # ./b.sh 
 +.list +.mbox +.list/.a +.list/.b +.list/.c
 
 The a.sh's  result should be the author's expectation. the b.sh is assume 
 that the first level folder starts with '.' when showing sub-level mailboxes. 
 Both of them are attached.

None of my sublevel mailboxes start with a ‘.’ — they’re just regular 
mailboxes.  A quick ls shows:

drwx--   7 mike   238B 31 Oct 18:58 Accounts/
drwx--   5 mike   170B 31 Oct 18:58 Archive/
drwx--  14 mike   476B 31 Oct 18:58 Archives/
drwx--   5 mike   170B 31 Oct 18:58 Deleted Messages/
snip

Is that where my problem is?  Should I force offlineimap to generate sublevel 
mailboxes that start ‘.’?

Thanks once again for all your help,
Mike

-- 
 __ __ __
/ /_  ___ _/ /__ _/ / _  __
   /  '_/ _ \/ __/ _ `/ / _ `/ __/ _ \ |/ /Raconteur, Mostly
  /_/\_\\___/_/  \_,_/_/\_,_/\__/\___/___/ http://koralatov.com/



Re: Nested Folders Not Accessible With OfflineIMAP

2011-11-02 Thread du yang
On Thursday 11/03/11 05:48:25 CST, Michael Graham wrote:
 None of my sublevel mailboxes start with a ‘.’ — they’re just regular 
 mailboxes.  A quick ls shows:
 
 drwx--   7 mike   238B 31 Oct 18:58 Accounts/
 drwx--   5 mike   170B 31 Oct 18:58 Archive/
 drwx--  14 mike   476B 31 Oct 18:58 Archives/
 drwx--   5 mike   170B 31 Oct 18:58 Deleted Messages/
 snip
 
 Is that where my problem is?  Should I force offlineimap to generate sublevel 
 mailboxes that start ‘.’?

If all your mailboxes are regular boxes, please try this script,

# find .maildir/
.maildir/
.maildir/list
.maildir/list/Archive
.maildir/list/.c
.maildir/list/.a
.maildir/list/Accounts
.maildir/list/.b
.maildir/list/Deleted Messages
.maildir/inbox
.maildir/.mbox
.maildir/.list
.maildir/.list/.c
.maildir/.list/.a
.maildir/.list/.b

# ./c.sh 
+inbox +list +list/Accounts +list/Archive +list/Deleted Messages

Does this you expect?

Best regards,
du yang
-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


c.sh
Description: C.SH


signature.asc
Description: Digital signature


Re: Nested Folders Not Accessible With OfflineIMAP

2011-11-01 Thread Michael Graham
On Sun, Oct 30, 2011 at 12:01, du yang wrote:

 I think the error is mostly caused by the space in the directory names. 
 Try to use a double-quote mark for variable $folder in if condition.
 
 if [ -x $folder ];

Hi Du Yang,

Thanks for the above; it fixed the terminal errors, and now I’m running it 
without anything being printed to the terminal on exit.
  However, it’s *still* not letting me traverse the nested folders using 
the browser — I just end up in the top-level folder.  I can go there directly 
using macros (I have one, ga, set to get me to the current year’s archive 
folder).
  My .muttrc is now as follows:

   set   mbox_type =Maildir
   set   pager_stop
   set   folder=~/.mail
   set   spoolfile =~/.mail/INBOX
   set   record=~/.mail/Sent\ Messages
   set   postponed =~/.mail/Drafts
   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; \
 for folder in ~/.mail/*; do \
   if [ -x $folder ]; then \
 box=$(basename $folder); \
 for file in ~/.mail/$box/.*; do \
box2=$(basename $file); \
if [ ! $box2 = '.' -a ! $box2 = '..' -a ! $box2 = 
'.customflags' \
 -a ! $box2 = '.subscriptions' ]; then \
   echo -n \+$box/$box2\ ; \
fi; \
 done; \
fi; \
  done`

Any ideas on why I can’t burrow down into the lower-level folders using the 
browser?

Many thanks,
Mike

-- 
 __ __ __
/ /_  ___ _/ /__ _/ / _  __
   /  '_/ _ \/ __/ _ `/ / _ `/ __/ _ \ |/ /Raconteur, Mostly
  /_/\_\\___/_/  \_,_/_/\_,_/\__/\___/___/ http://koralatov.com/



Re: Nested Folders Not Accessible With OfflineIMAP

2011-11-01 Thread du yang
On Tuesday 11/01/11 21:24:02 CST, Michael Graham wrote:
 Hi Du Yang,
 
 Thanks for the above; it fixed the terminal errors, and now I’m running it 
 without anything being printed to the terminal on exit.
   However, it’s *still* not letting me traverse the nested folders using 
 the browser — I just end up in the top-level folder.  I can go there directly 
 using macros (I have one, ga, set to get me to the current year’s archive 
 folder).
   My .muttrc is now as follows:
 
set   mbox_type =Maildir
set   pager_stop
set   folder=~/.mail
set   spoolfile =~/.mail/INBOX
set   record=~/.mail/Sent\ Messages
set   postponed =~/.mail/Drafts
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; \
  for folder in ~/.mail/*; do \
if [ -x $folder ]; then \
  box=$(basename $folder); \
  for file in ~/.mail/$box/.*; do \
 box2=$(basename $file); \
 if [ ! $box2 = '.' -a ! $box2 = '..' -a ! $box2 = 
 '.customflags' \
  -a ! $box2 = '.subscriptions' ]; then \
echo -n \+$box/$box2\ ; \
 fi; \
  done; \
 fi; \
   done`
 
 Any ideas on why I can’t burrow down into the lower-level folders using the 
 browser?
 

Hi Mike,

There is minor error in your script.

The if condition's syntax is incorrect, it should be like as writing
below. (Note the quote mark position.)

if [ -x $folder ]; then


The intention of the script is to generate first level mailboxes start
with '.' as well as the sub-level mailboxes(mbox or maildir) which starts with 
'.'(except
'.', '..', '.customflags', '.subscriptions'). 

Note to show the sub-level mailboxes it requires the first level folder
not start with '.'. Is this you want?


I have some tests with the script. there is a maildir folder structure
created as below,

# find .maildir/
.maildir/
.maildir/list
.maildir/list/.c
.maildir/list/.a
.maildir/list/.b
.maildir/inbox
.maildir/.mbox
.maildir/.list
.maildir/.list/.c
.maildir/.list/.a
.maildir/.list/.b


# ./a.sh 
+.list +.mbox +list/.a +list/.b +list/.c

# ./b.sh 
+.list +.mbox +.list/.a +.list/.b +.list/.c

The a.sh's  result should be the author's expectation. the b.sh
is assume that the first level folder starts with '.' when showing
sub-level mailboxes. Both of them are attached.

Which one is you like? or both?

Best regards
du yang
-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


a.sh
Description: A.SH


b.sh
Description: B.SH


signature.asc
Description: Digital signature


Re: Nested Folders Not Accessible With OfflineIMAP

2011-10-30 Thread Michael Graham
On Sun, Oct 30, 2011 at 03:06, du yang wrote:

 Are the last one script?
 There is one space missing in it. the if condition should be like
 
 if [ -x $folder ];
 
 instead of
 
 if [ -x $folder];
 
 Is that your problem?
 
 The first one script looks having no problem on syntax after removing tailing 
 space.

Hi Du Yang,

I tried making the fix you suggested, but it still hasn’t workedi — I still 
can’t access the nested folders.  I don’t get the previous error in printed in 
the terminal on exit, but I now get this: 

sh: line 0: [: too many arguments
sh: line 0: [: /Users/mike/.mail/Deleted: binary operator expected
sh: line 0: [: /Users/mike/.mail/Sent: binary operator expected
Mailbox is unchanged.

I suspect “Deleted” and “Sent” are “Deleted Messages” and “Sent Messages”.  I 
use these mailboxes because my iPhone created them and I can’t work out how to 
make it use other folders.
  Any other ideas on how to fix this?

Thanks,
Mike

-- 
 __ __ __
/ /_  ___ _/ /__ _/ / _  __
   /  '_/ _ \/ __/ _ `/ / _ `/ __/ _ \ |/ /Raconteur, Mostly
  /_/\_\\___/_/  \_,_/_/\_,_/\__/\___/___/ http://koralatov.com/



Re: Nested Folders Not Accessible With OfflineIMAP

2011-10-30 Thread du yang
On Sunday 10/30/11 19:00:14 CST, Michael Graham wrote:
 I tried making the fix you suggested, but it still hasn’t workedi — I still 
 can’t access the nested folders.  I don’t get the previous error in printed 
 in the terminal on exit, but I now get this: 
 
 sh: line 0: [: too many arguments
 sh: line 0: [: /Users/mike/.mail/Deleted: binary operator expected
 sh: line 0: [: /Users/mike/.mail/Sent: binary operator expected
 Mailbox is unchanged.
 
 I suspect “Deleted” and “Sent” are “Deleted Messages” and “Sent Messages”.  I 
 use these mailboxes because my iPhone created them and I can’t work out how 
 to make it use other folders.
   Any other ideas on how to fix this?


Hi Mike,

I think the error is mostly caused by the space in the directory names. 
Try to use a double-quote mark for variable $folder in if condition.

if [ -x $folder ];

-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


signature.asc
Description: Digital signature


Re: Nested Folders Not Accessible With OfflineIMAP

2011-10-29 Thread Michael Graham
On Sat, Oct 29, 2011 at 15:40, Michael Graham wrote:

 I’ve been trying to set up OfflineIMAP to sync my mail to my machine into a 
 Maildir set of folders.  So far, mostly works, but I can’t access nested 
 folders — only the top-level folders.  I used ‘/’ as the seperator so that 
 OfflineIMAP would create local nested folders.
   My .muttrc has the following:
 
 set   mbox_type =Maildir   
 set   pager_stop   
 set   folder   =~/.mail  
 set   spoolfile=+INBOX   
 set   record   =+Sent Messages
 set   postponed=+Drafts  
 set   mask =!^\\.[^.] 
 
 I think the problem is with the mask, but I’ve tried mucking around with it 
 to no avail.
   Anyone know what it should read?  Or if it’s not the mask, then what 
 the problem is?

I’ve been researching this a little further, trying to get it fixed, but still 
haven’t made any progress.
  I followed a Maildir guide on the mutt wiki (http://tinyurl.com/mexy9), 
making sure I removed the trailing whitespace from the \s, but it still doesn’t 
work.  Hitting enter on one of the folders I *know* has subfolders (which I can 
navigate to with the cd command, still just opens that folder.
  When I exit, I see this in the terminal printed several times, just after 
the command to start mutt:

sh: line 0: [: missing `]'

I tried fixing it, but I know nothing about shell scripting, so I couldn’t seem 
to strike upon the required placing for the missing `.
  Anyone know how to fix?

Thanks,
Mike

PS: The subject line in the original email got mangled by my VPS’s copy of 
mutt, so I’ve fixed it this time around.  Apologies if this breaks your 
threading. 

-- 
 __ __ __
/ /_  ___ _/ /__ _/ / _  __
   /  '_/ _ \/ __/ _ `/ / _ `/ __/ _ \ |/ /Raconteur, Mostly
  /_/\_\\___/_/  \_,_/_/\_,_/\__/\___/___/ http://koralatov.com/



Re: Nested Folders Not Accessible With OfflineIMAP

2011-10-29 Thread du yang
On Sunday 10/30/11 06:48:28 CST, Michael Graham wrote:
   When I exit, I see this in the terminal printed several times, just 
 after the command to start mutt:
 
 sh: line 0: [: missing `]'
 

Are the last one script?
There is one space missing in it. the if condition should be
like

if [ -x $folder ];

instead of

if [ -x $folder];

Is that your problem?

The first one script looks having no problem on syntax after removing
tailing space.

Best regards
du yang
-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


signature.asc
Description: Digital signature