[Dovecot] dovecot LDA w/virtual domains and postfix
Hi,
I've been trying to follow the documentation that I am finding, but am running into trouble getting things set up correctly for postfix + virtual domains (using ldap) with dovecot LDA. I can get it to work without LDA, but I'm running into permissions problems when I try to run with LDA. I am wondering if anyone has any good examples of configuring this.
I basically have a 'vmail' user (1015) that owns a /var/vmail/domains directory tree. I have set the following in postfix master.cf:
# Dovecot LDA dovecot unix - n n - - pipe flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/deliver -d ${recipient}
In main.cf
dovecot_destination_recipient_limit = 1 virtual_transport = dovecot virtual_mailbox_base = /var/vmail/domains virtual_mailbox_maps = ldap:/etc/postfix/ldap-mailbox.cf virtual_mailbox_domains = ldap:/etc/postfix/ldap-vdoms.cf virtual_uid_maps = static:1015 virtual_gid_maps = static:12 home_mailbox = Maildir/
and in dovecot.conf:
protocols = imap imaps pop3 pop3s ssl_disable = no ssl_cert_file = /etc/ssl/certs/sauerkraut.heinous.org.crt ssl_key_file = /etc/ssl/private/sauerkraut.heinous.org.key mail_extra_groups = mail valid_chroot_dirs = /var/vmail/domains default_mail_env = maildir:/var/vmail/domains/%d/%n/mail protocol lda { postmaster_address = postmaster@frauerpower.com } protocol imap { } protocol pop3 { } auth default { mechanisms = plain passdb ldap { args = /etc/dovecot/dovecot-ldap.conf } userdb ldap { args = /etc/dovecot/dovecot-ldap.conf } user = root } auth default_with_listener { mechanisms = plain userdb ldap { args = /etc/dovecot/dovecot-ldap.conf } passdb ldap { args = /etc/dovecot/dovecot-ldap.conf } socket listen { master { path = /var/run/dovecot-auth-master mode = 0600 user = vmail group = mail } } } plugin { }
However, I must be missing something. I get the following when trying to send the user a message:
setuid(1015) failed: Operation not permitted
Doing 'postmap -q leah@frauerpower.com ldap:/etc/postfix/ldap-mailbox.cf' returns 'frauerpower.com/leah/mail/' which, in the non LDA mode worked okay, plonking the mail under /var/vmail/domains/frauerpower.com/leah/mail
How is this sort of thing normally set up? Apologies in advance for my ignorance, I am pretty new to dovecot.
Leah
Hi Leah.
Leah Cunningham wrote:
However, I must be missing something. I get the following when trying to send the user a message:
setuid(1015) failed: Operation not permitted
Which one reports this error, Postfix or Dovecot?
Doing 'postmap -q leah@frauerpower.com ldap:/etc/postfix/ldap-mailbox.cf' returns 'frauerpower.com/leah/mail/' which, in the non LDA mode worked okay, plonking the mail under /var/vmail/domains/frauerpower.com/leah/mail
AFAIK Dovecot doesn't care about the return value of the Postfix LDAP-Query, so this is irrelevant for Dovecot.
Regards
Andreas
On Friday 05 May 2006 03:30, Andreas Martin wrote:
Hi Leah.
Leah Cunningham wrote:
However, I must be missing something. I get the following when trying to send the user a message:
setuid(1015) failed: Operation not permitted
Which one reports this error, Postfix or Dovecot?
It looks like the deliver command is generating the error, sorry for the incomplete log there:
May 5 11:33:30 sauerkraut deliver: setuid(1015) failed: Operation not permitted May 5 11:33:30 sauerkraut postfix/pipe[1598]: 37149F73: to=<leah@frauerpower.com>, orig_to=<root@oogabooga.heinous.org>, relay=dovecot, delay=0, status=bounced (Command died with status 89: "/usr/lib/dovecot/deliver")
-- Leah Cunningham : d416-585-9971x692 : d416-703-5977 : m416-559-6511 Frauerpower! Co. : www.frauerpower.com : Toronto, ON Canada
On Friday 05 May 2006 11:36, Leah Cunningham wrote:
On Friday 05 May 2006 03:30, Andreas Martin wrote:
Which one reports this error, Postfix or Dovecot?
It looks like the deliver command is generating the error, sorry for the incomplete log there:
May 5 11:33:30 sauerkraut deliver: setuid(1015) failed: Operation not permitted May 5 11:33:30 sauerkraut postfix/pipe[1598]: 37149F73: to=<leah@frauerpower.com>, orig_to=<root@oogabooga.heinous.org>, relay=dovecot, delay=0, status=bounced (Command died with status 89: "/usr/lib/dovecot/deliver")
Update, I think I may have finally figured it out. It would seem that the vmail user needed to have a valid home directory set. I set it to /var/vmail. Now I seem to just be having problems getting deliver to know where to deliver the messages:
May 5 12:00:50 sauerkraut deliver: Ambiguous mail location setting, don't know what to do with it: /var/mail/root (try prefixing it with mbox: or maildir:) May 5 12:00:50 sauerkraut deliver: Failed to create storage for 'leah@frauerpower.com' with mail '/var/mail/root'
I tried setting the following in dovecot.conf:
plugin { convert_mail = maildir:/var/vmail/%d/%u/mail }
But that didn't seem to make a difference. I also have:
default_mail_env = maildir:/var/vmail/domains/%d/%n/mail
Leah
On Friday 05 May 2006 12:02, Leah Cunningham wrote:
Update, I think I may have finally figured it out. It would seem that the vmail user needed to have a valid home directory set. I set it to /var/vmail. Now I seem to just be having problems getting deliver to know where to deliver the messages:
Well, I spoke too soon, I wasn't running the test that I thought I was. I am still having issues with the setuid error. What else can I check?
-- Leah Cunningham : d416-585-9971x692 : d416-703-5977 : m416-559-6511 Frauerpower! Co. : www.frauerpower.com : Toronto, ON Canada
On Friday 05 May 2006 13:50, Leah Cunningham wrote:
On Friday 05 May 2006 12:02, Leah Cunningham wrote:
Update, I think I may have finally figured it out. It would seem that the vmail user needed to have a valid home directory set. I set it to /var/vmail. Now I seem to just be having problems getting deliver to know where to deliver the messages:
Well, I spoke too soon, I wasn't running the test that I thought I was. I am still having issues with the setuid error. What else can I check?
Okay, now I really have it resolved. Sorry for the trouble. I had a typo in
the dovecot-ldap.conf file that was causing the wrong uid to be used, so of
course it was having problems. I have posted a little howto with my notes
and configuration examples at
http://heinous.org/wiki/Virtual_Domains%2C_Postfix%2C_Dovecot_LDA%2C_and_LDA...
Cheers, Leah
Leah Cunningham : d416-585-9971x692 : d416-703-5977 : m416-559-6511 Frauerpower! Co. : www.frauerpower.com : Toronto, ON Canada
participants (2)
-
Andreas Martin
-
Leah Cunningham