Sieve with Horde/Ingo not finding Mailbox

Adam Collyer adam at serpentdream.net
Wed Oct 10 10:39:39 EDT 2007


Hi,

I've been setting up a mail server for the school I work for, currently 
running Exim and Courier-IMAP, with Horde/IMP as a webmail frontend. 
I've configured both Exim and Courier-IMAP to authenticate first with 
LDAP (Active Directory - the authentication method most will use), then 
MySQL (for any additional domains I want to host).


I've got most things in place now, i.e. AV/spam scanning, but there is 
one more thing I want to set up - custom filters. I have installed the 
Ingo module for Horde, and have it working at its most basic level 
(storing filter rules in MySQL and applying them upon login to 
IMP/refresh of Inbox). However, I'm not really content with this as I 
personally prefer using Thunderbird - so obviously I need to filters to 
run at MTA level.


After checking out the options available to me, I've decided to use 
Sieve to configure custom filters, as Exim has full support for reading 
Sieve scripts. I have installed the Cyrus-IMAP package, and configured 
it only to run Timseived (in hindsight, I probably should have used the 
Cyrus IMAP daemon itself, but I want to get this server deployed ASAP 
and then look at moving over to Cyrus IMAP if it looks to be a better 
option).


The chain of events for authentication goes:
Ingo --> Sieve --> SASLAUTHD --> PAM --> (Mysql/LDAP)
USers authenticate by supplying their full email address (allows Exim to 
decide how to verify their identity). I have authentication working with 
accounts stored in MySQL (will do LDAP later), but I am now hitting a 
problem. Sieve is accepting authenticated connections from Ingo when I 
create/enable/disable a rule, but eventually Ingo times out with a 
"Failed to receive from the socket" error. I am getting this error from 
Sieve in the maillog while logged in as adam at serpentdream.net -

Oct 10 14:37:51 socrates sieve[12449]: executed
Oct 10 14:37:51 socrates sieve[12449]: accepted connection
Oct 10 14:37:51 socrates sieve[12449]: Mailbox does not exist


I'm slightly confused by this for two reasons:
1) I already have Maildirs set up in /data1/mail/<domain>/<username>/Maildir
2) I'm not 100% sure where I want to store the Sieve scripts. As I'm 
dealing with what are essentially virtual user accounts, they have no 
unix home dir on this system. I thought perhaps storing them in the root 
of each user's Maildir would be appropriate?
3) From what I can gather from googling, the default path for cyrus 
mailboxes is /var/spool/imap, and this is somehow tied in with "hashing" 
to produce /var/spool/imap/d/domain/n/name/u/username paths.... but 
again, I'm unclear on this and would rather keep scripts and mail in one 
place.


I have tried manually creating folders in the structure mentioned above 
(and made them world-writeable just for testing), but have so far been 
unsuccessful. It would be helpful if Sieve would reference the path it's 
looking for, so I could at least manually create the folder and get it 
writing scripts.... I haven't even tried getting Exim to pick up the 
scripts yet!



Hopefully I haven't made a complete hash of this, and someone can 
perhaps give me a pointer in the right direction? Is Sieve the right 
thing for me? I've heard about Courier Maildrop, but I don't know about 
compatibility with Exim.... Of everything, I want to keep Exim in place.



Here are the relevant parts of my config files (white space and comments 
removed) - if anyone can help or offer any advice, it would be greatly 
appreciated :)

Cheers,
Adam










************** /etc/imapd.conf

configdirectory: /var/lib/imap
partition-default: /var/spool/imap
allowplaintext: yes
sievedir: /var/lib/imap/sieve
sendmail: /usr/sbin/sendmail
hashimapspool: true
sasl_pwcheck_method: saslauthd
sasl_mech_list: LOGIN
tls_cert_file: /etc/pki/cyrus-imapd/cyrus-imapd.pem
tls_key_file: /etc/pki/cyrus-imapd/cyrus-imapd.pem
tls_ca_file: /etc/pki/tls/certs/ca-bundle.crt
loginrealms: serpentdream.net spps.org.uk
virtdomains: on
unixhierarchysep: 1



************** /etc/cyrus.conf

START {
  recover       cmd="ctl_cyrusdb -r"
  idled         cmd="idled"
}

SERVICES {
  sieve         cmd="timsieved" listen="sieve" prefork=0
  lmtpunix      cmd="lmtpd" listen="/var/lib/imap/socket/lmtp" prefork=1
}

EVENTS {
  checkpoint    cmd="ctl_cyrusdb -c" period=30
  delprune      cmd="cyr_expire -E 3" at=0400
  tlsprune      cmd="tls_prune" at=0400
}



************** /etc/sysconfig/saslauthd

SOCKETDIR=/var/run/saslauthd
MECH=pam
FLAGS=-r



************** /etc/pam.d/sieve

#%PAM-1.0
auth     optional       pam_mysql.so    host=localhost user=exim 
passwd=mypassword db=exim table=accounts usercolumn=address 
passwdcolumn=passwd crypt=1
account  required       pam_mysql.so    host=localhost user=exim 
passwd=mypassword db=exim table=accounts usercolumn=address 
passwdcolumn=passwd crypt=1



************** horde/ingo/config/backends.php

$backends['sieve'] = array(
    'driver' => 'timsieved',
    'preferred' => 'localhost',
    'hordeauth' => 'full',
    'params' => array(
        'hostspec' => 'localhost',
        'logintype' => 'LOGIN',
        'usetls' => false,
        'port' => 2000,
        'scriptname' => 'ingo',
    ),
    'script' => 'sieve',
    'scriptparams' => array()
);


More information about the Info-cyrus mailing list