[imapfilter-devel] Adding a header flag all messages

Daniel-Constantin Mierla miconda at gmail.com
Sat Dec 24 00:41:36 EET 2011


Hello,

maybe it helps to look at/reuse the rawmessage.lua script from this thread:
http://lists.hellug.gr/pipermail/imapfilter-devel/2010/000737.html

Cheers,
Daniel

On 11/22/11 5:36 PM, Steve Traylen wrote:
> Hi,
>
> This is my really my first go with imapfilter. I took the example
> from man page and sample files and modified a little.
>
> The plan - Take mail from INBOX and write to Mutt having added
> an X-Label.
>
> CERN.Mutt:check_status()
> CERN.INBOX:check_status()
> results = CERN.INBOX:select_all()
>
> for _, mesg in ipairs(results) do
>      mbox, uid = unpack(results)
>      header    = mbox[uid]:fetch_header()
>      body      = mbox[uid]:fetch_body()
>      message   = header:gsub('[\r\n]+$', '\r\n') ..
>                'X-Label: C\r\n' .. '\r\n' .. body
>      CERN.Mutt:append_message(message)
> end
>
> result.
>
> Subscribed mailbox straylen at imap.cern.ch/INBOX.
> 268 messages, 0 recent, 268 unseen, in straylen at imap.cern.ch/INBOX.
> Subscribed mailbox straylen at imap.cern.ch/Mutt.
> 6270 messages, 0 recent, 6266 unseen, in straylen at imap.cern.ch/Mutt.
> 268 messages, 0 recent, 268 unseen, in straylen at imap.cern.ch/INBOX.
> imapfilter: /afs/cern.ch/user/s/straylen/.imapfilter/config.lua:29:
> attempt to index field '?' (a nil value)
>
> Which is the
>
>      header    = mbox[uid]:fetch_header()
>
> line.
>
> Lua 5.1.4
> IMAPFilter 2.2.2
> And against exchange :-(
>
> Many thanks for getting me going on this, ... looks very good.
>
> Steve.
>
>
>
>
>

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda



More information about the Imapfilter-devel mailing list