[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 828
  • Last Modified:

Courier IMAP and inotify

I have a python script that monitors a folder for changes, using inotify via the pyinotify library.

This works - any changes are refected as inotify events and reported by the script.  Mostly.  One of the folders I am monitoring is a Maildir folder with emails in it, and courier imap puts them there.

None of the file activities carried out by courier are notified by inotify.  This makes me think that courier is somehow putting the files there bypassing whatever mechanism the kernel is using inotify to monitor.

If I watch an email come into a maildir nothing appears in inotify.  If I rename that same file, an inotify event is generated.  If I copy it, an event happens.  If I delete it an event happens.  If courier does any of these things, no event is generated.

Does anyone know how I can get courier's file activities to show up as inotify events?   This is on ubuntu btw.
0
muff
Asked:
muff
  • 2
1 Solution
 
Duncan RoeSoftware DeveloperCommented:
Can you arrange to strace courier while it delivers a mail? It does seem very strange that it bypasses inotify. Does courier run as root or have any unusual privileges?
0
 
muffAuthor Commented:
Thanks, but I have realised it was simply me being stupid.

The filesystem was NFS - when courier was updating the files it was from another machine, and so the machine I am running inotify on had no idea.  When I was testing, I was updating from the machine inotify was running on, so of course it raised an event.

0
 
Duncan RoeSoftware DeveloperCommented:
Ok, I thought there must be a Linux IMAP servwer by now. No worries, give yourself the points.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now