Am Di, 23. Aug 16 - 20:37:01 schrieb Pietro:
> Reimar Döffinger <reimar.doeffin...@gmx.de> writes:
> 
> > On 10.08.2016, at 21:08, pulsarpie...@posteo.net (P. Paolini) wrote:
> >> Hi all,
> >> 
> >> I've recently set-up mbsync + mu4e to read my emails and everything
> >> worked fine, I am a bit new to the emails/news world as I have always
> >> used web based client or Outlook.
> >> 
> >> As far as I am aware the mu4e is the MUA and mbsync/isync is the MDA,
> >> and it should be up to the latter to process the incoming messages
> >> following some filtering rules I would like to have.
> >> 
> >> My goal is pretty simple, I want to move messages coming from a certain
> >> address in a specific folder, I have googled the problem but I haven't
> >> found a solution yet, any thoughts ?
> >
> > I would suggest a solution like imapfilter instead if the provider was too 
> > lazy/cheap to offer filter settings.
> > I used to run it on a OpenWRT based router and it worked very well
> > (though I suspect my email provider may have thought it mostly worked
> > very well for creating CPU and I/O load on their server, but unless
> > you have reason to be charitable towards them despite not offering
> > filter configuration, why care...)
> Thanks a lot, imapfilter it does the job very well, the only hassle so
> far is that I had to put my password in the config.lua file but for now
> that is not a problem as I run it on my personal laptop only.
> 
> P.

Hi P.,

imapfilter provides some functions for convenience, such as
'pipe_from(command)', which might help you - have a look at the
imapfilter_config man page [1].

I used imapfilter for quite a long time and had this function in
my config file:

function capture(cmd, raw)
    local f = assert(io.popen(cmd, 'r'))
    local s = assert(f:read('*a'))
    f:close()
    if raw then return s end
    s = string.gsub(s, '^%s+', '')
    s = string.gsub(s, '%s+$', '')
    s = string.gsub(s, '[\n\r]+', ' ')
    return s
end

It's a general purpose capture function for shell command output.
Unfortunately, I found it a long time ago in the deeps of the web, so I
can't give credit to the original author. Anyway, you use it like this:

     password = capture('pass email/account|head -n1'),

Of course, put your own password command between the quotes :)


HTH,
Markus


[1] http://linux.die.net/man/5/imapfilter_config

------------------------------------------------------------------------------
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to