[Dovecot] INBOX stored in AFS

Hans-Werner Paulsen hans at MPA-Garching.MPG.DE
Mon Oct 20 17:16:05 EEST 2008


Hello,
currently we are storing the incoming mail in the user's home directory,
which is within a distributed filesystem called AFS (OpenAFS).
Accessing the "mbox" file directly (using the distributed filesystem)
works fine with mutt, thunderbird, ...
To access the INBOX from a machine, which does not have access to this
distributed filesystem, we are using IMAP (UW-imap).
Now I wanted to check if dovecot can do the job (maybe faster than UW),
and I had the following problem:
This is my configuration:
-------------------------------------------------------------------------------
# 1.1.4: /opt/dovecot-1.1.4/etc/dovecot.conf
log_path: /var/log/dovecot
ssl_cert_file: /etc/ssl/certs/imapd.pem
ssl_key_file: /etc/ssl/keys/imapd.pem
login_dir: /var/run/dovecot/login
login_executable: /opt/dovecot-1.1.4/libexec/dovecot/imap-login
first_valid_uid: 100
mail_location: mbox:~/Mail:INBOX=~/.maildir/incoming
mail_debug: yes
mmap_disable: yes
mail_nfs_storage: yes
mail_nfs_index: yes
mbox_write_locks: fcntl
mbox_dirty_syncs: no
mbox_lazy_writes: no
mail_executable: /opt/dovecot-1.1.4/libexec/dovecot/afs-token /opt/dovecot-1.1.4/libexec/dovecot/imap
auth default:
  verbose: yes
  debug: yes
  passdb:
    driver: pam
    args: setcred=yes session=yes dovecot
  userdb:
    driver: passwd
-------------------------------------------------------------------------------
When I start my imap-client, I see the content of the INBOX, and I can
read, delete, ... the different entries. But when new mail arrives dovecot
(and my imap-client) will never notice this. And when I quit my imap-client
the dovecot imap server will write back its view of the INBOX, and delete
this new mail.
This seems to be a problem related to AFS. I poked in the dovecot code and
have the following theory: dovecot opens the INBOX R/W, dovecot calls "stat"
on the INBOX file periodically to look for modifications. But this does
not work, because this machine will stat the local copy (AFS cache) of the
INBOX as long as this file is still open R/W.
My questions:
Is it possible to have a configuration, that the INBOX file is not left open
when stat-ing this file?
Or is it possible to open the INBOX file R/W only when it us locked?
Or is it necessary to modify the code?

Thank you for any help,
HW 

-- 
Hans-Werner Paulsen		hans at MPA-Garching.MPG.DE
MPI für Astrophysik		Tel 089-30000-2602
Karl-Schwarzschild-Str. 1	Fax 089-30000-2235	
D-85741 Garching


More information about the dovecot mailing list