<<< Date Index >>>     <<< Thread Index >>>

Re: mailbox does not sync from a macro



On 2006-05-22, Michelle Konzack <linux4michelle@xxxxxxxxxx> wrote:
> Hello,
> 
> I have two macros:
> 
> macro index   <F5>  "|tdmailbody --add=spam_body1\n:set 
> delete=yes\ns=.ATTENTION.FLT_spam_body1/\n<sync-mailbox>\n:set 
> delete=ask-yes\n"
> 
> It should do:
>     1.  Pipe the current message to 'tdmailbody'
>     2.  I do not want to be ask for deleting
>     3.  I save the message to =.ATTENTION.FLT_spam_body1/
>     4.  I sync the mailbox
>     5.  For futur messages I want to be ask for deleting
> 
> Problem:
>     1.  The message is saved in the new folder, and in the
>         current marked as deleted but the folder is not synced.
> 
> macro index   <F17> "!tdmailbody --remove=spam_body1\n:set delete=yes\n:set 
> editor=tdmailclean\ne\n:set 
> editor=mcedit\n<next-unread>\ns=.000/\n<sync-mailbox>\n:set delete=ask-yes\n"
> 
> It should do:
>     1.  Execute 'tdmailbody' and let me do some stuff
>     2.  I do not want to be ask for deleting
>     3.  Set the editor to my tdmailclean
>     4.  Start the editor and cleanup previously by 'tdmailbody'
>         added headers (some False-Positives happen)
>     5.  Set editor back to 'mcedit'
>     6.  Since if I leave the editor the old (deleted) message is
>         selected jump to the next unread which is probabli the
>         edited one
>     7.  I save the message to =.000/ for rescanning
>         (done by a script and procmail in the background)
>     8.  Sync the mailbox
>     9.  For futur messages I want to be ask for deleting
> 
> Problem:
>     1.  The message is saved in the new folder, and in the
>         current marked as deleted but the folder is not synced.
> 
> It seems my think machine is broken...
> 
> Does anyone see the error?

I'm not sure, but I think I know what's happening.  Whenever I type 
's' to save a message, after entering the file name, I get a prompt 
that says either

    Create /home/garyjohn/Mail/filename? ([yes]/no):

or

    Append messages to /home/garyjohn/Mail/filename? ([yes]/no):

My guess is that your macro is answering that prompt with 
"<sync-mailbox>" and a Return.  If that's the case, then I think a 
solution would be to follow the file name with "\n\n" instead of 
just "\n".

Also, I don't think you need to follow "<sync-mailbox>" with "\n".  
The parser executes the function when it reads the ">".  The extra 
"\n" will be seen as another command and could cause you other 
problems.

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA