[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-users
Subject:    Re: fetching mails with mutt/imap
From:       Jude DaShiell <jdashiel () panix ! com>
Date:       2016-12-04 22:54:22
Message-ID: alpine.NEB.2.20.1612041750510.26129 () panix1 ! panix ! com
[Download RAW message or body]

Some of this may work, I'll send an url to some expect examples in next 
reply.  You may need to cover another case when mutt finds messages and 
exit the expect script when that happens.

#!/usr/bin/expect -f
# chmod 755 before use and change path on line 1 if necessary.
spawn > mutt -n -f imap://imap.1blu.de/ \
> -e "set sort=mailbox-order; set confirmappend=no; set delete=yes; push \
> '<tag-pattern>.<enter><tag-prefix><save-message>/usr/home/jude/mailboxtmp<enter><sync-mailbox><exit>'"
> 
expect "No hay mensajes"
send "q"

I hope this helps.
On Sun, 4 Dec 2016, Matthias 
Apitz wrote:

> Date: Sun, 4 Dec 2016 10:40:59
> From: Matthias Apitz <guru@unixarea.de>
> To: mutt-users@mutt.org
> Subject: Re: fetching mails with mutt/imap
> 
> El d?a Sunday, December 04, 2016 a las 09:06:18AM -0500, Jude DaShiell escribi?:
> 
> > You might be able to use a little expect in that script to catch and
> > handle mutt's no mail case when that happens.
> 
> The last two lines in the terminal were the script is running say:
> 
> ---Mutt: imap://imap.1blu.de/INBOX \
> [Msgs:0]---(mailbox-order/date)--------------------------(all)--- No hay mensajes.
> 
> ('No hay mensajes' is Spanish for 'No mails').
> 
> How could I catch this in the script and send 'push q'? Can you please
> point me to some place in mutt's manual or some examples.
> 
> Thanks
> 
> 
> mutt -n -f imap://imap.1blu.de/ \
> -e "set sort=mailbox-order; set confirmappend=no; set delete=yes; push \
> '<tag-pattern>.<enter><tag-prefix><save-message>/usr/home/guru/mailboxtmp<enter><sync-mailbox><exit>'"
>  
> I have added at the end:
> 
> ... <sync-mailbox><exit>'; push q"
> 
> and it seems to do the trick.
> 
> 	matthias
> 

-- 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic