Fwd: Re: Wiki advice on running getmail on INBOX access - how does that work?

Gedalya gedalya at gedalya.net
Sat Oct 18 19:58:08 UTC 2014

On 10/18/2014 03:26 PM, c128 mail wrote:
> Just re-tried this, and it doesn't seem to fire getmail on access for me.
> My incrontab is as follows:
> /home/user/Maildir/cur/ IN_ALL_EVENTS,IN_ONESHOT /home/user/bin/mvmail.sh
> The incrontab rule does work, but only if I make a physical change in
> /home/user/Maildir/cur/ e.g. by moving a mail from another folder in
> there.  Just accessing the particular inbox doesn't seem to trigger
> anything.

In my testing I get 3 events every single time I list the test 
directory, if I remove the IN_ONESHOT.
With IN_ONESHOT, I get only one, for the first time.
The script on the wiki ends with:
incrontab --reload # Rearm the one-shot rule
So that makes sense.

Debian Jessie, Linux 3.16.5-1 amd64, incron 0.5.10-2

> On 18/10/14 19:54, c128 mail wrote:
>> Yeah, I see what you mean - it should trigger by IN_ACCESS (from
>> IN_ALL_EVENTS) shouldn't it.  I hadn't previously scanned over the full
>> set of events:
>> http://manpages.ubuntu.com/manpages/intrepid/man5/incrontab.5.html
>> I'll set this up again and report back one way or another.
>> Thanks.
>> On 18/10/14 19:50, Gedalya wrote:
>>> On 10/18/2014 02:38 PM, c128 mail wrote:
>>>> > What exactly did happen?
>>>> Oh, yeah, didn't make that clear ;-)
>>>> Nothing happened...not without coaxing.
>>>> If I forced a change to the directory, then it worked - but there
>>>> wouldn't be a change to the directory in normal operation, other than
>>>> by mail population?
>>> It's not supposed to require changes. Note the IN_ALL_EVENTS 
>>> definition.
>>> This would include any attempt to open the directory and take a peek.
>>> If you configured it according to the wiki and it's not working then we
>>> have troubleshooting to do, but that's the theory.
>>> I'm not familiar with incron but I've worked with Linux's inotify.
>>>> On 18/10/14 19:28, Gedalya wrote:
>>>>> On 10/18/2014 01:24 PM, c128 mail wrote:
>>>>>> Hi,
>>>>>> I'm currently running getmail in a cron job every 2 minutes, so I 
>>>>>> was
>>>>>> quite intrigued by this on the wiki:
>>>>>> http://wiki2.dovecot.org/HowTo/TriggerGetmailOnIMAPAccess
>>>>>> Thing is - I couldn't see how it would work and, when I tried it, it
>>>>>> didn't work (at least not for me).
>>>>> What exactly did happen?
>>>>>> It details using incrontab to monitor /home/username/.maildir/cur in
>>>>>> order to trigger getmail.
>>>>>> However, "cur" won't change unless populated with mail...as an 
>>>>>> initial
>>>>>> result of actually running getmail?  Seems like a chicken and egg
>>>>>> situation.
>>>>> access != change
>>>>>> I reckon I'm missing something fundamental :-), but what is it?
>>>>>> Ta.

More information about the dovecot mailing list