[Dovecot] dovecot/deliver ... Can't open log file /var/log/dovecot/error.log: Permission denied

Phil Howard ttiphil at gmail.com
Tue May 11 23:17:58 EEST 2010


On Tue, May 11, 2010 at 14:38, Bradley Giesbrecht <
bradley.giesbrecht at gmail.com> wrote:

>
> On May 11, 2010, at 11:26 AM, Phil Howard wrote:
>
>  On Tue, May 11, 2010 at 12:59, Gerard Seibert <dovecot.user at seibercom.net
>> >wrote:
>>
>>  Virtual documentaion: http://www.postfix.org/virtual.8.html
>>>
>>>
>> This seems to be a delivery agent of its own.  I don't want Postfix to do
>> the delivery.  I want Dovecot to do the delivery so it can create the
>> additional cache/index files (whatever they were ... Dovecot documentation
>> encourages this).  So that means handing it off to the
>> /usr/lib/dovecot/deliver program.
>>
>
> Basically postfix just needs to know that a username/email address is local
> and how to deliver.
>

And it did seem to do that already.  Mail was sent to dovecot/deliver.  It
included the domain name.  But deliver just didn't construct the
mail_location correctly due to %d being empty.  The resulting path with the
empty space where the domain name should have been was used to actually
deliver the mail.  I read that file and the domain name was also in the
headers.  The domain was there, but %d didn't get it.



> If you are using virtual users in main.cf this works for me.
> virtual_transport                    = dovecot


> In master.cf this works for me.
>
> dovecot          unix    -    n    n    -    -    pipe
>    flags=DRhu user=_vmail:_vmail argv=/opt/local/libexec/dovecot/deliver -d
> ${recipient}
>

I tried it, but effectively, nothing happened.  Maybe the other virtual_*
stuff also needs to be configured.  I've used that virtual_* stuff before
many years ago without success.  At the time, from what I remember, the
concept of "virtual" the way they were using it just wasn't the same as my
idea of "virtual".  The way I read the Dovecot docs, virtual for Dovecot
seemed to be the same.  Now I don't know.  I do know I have run across at
least 4 different concepts called "virtual email users".


Now dovecot needs to know where to deliver to. I use a database backend so
> postfix and dovecot can look the information up in the same place. They just
> need queries to return the values they require. In dovecot docs look for
> userdb and passworddb.
>

I'm using "passwd-file" to authenticate, and mail_location = to compose a
pattern of where each maildir will be found.  I won't be using a backend
database (that's the last thing I want to do).



> 777 you log file till you figure out which users need to write to it. I
> have _vmail as my user and group name and my dovecot-deliver.log has
> _vmail:_vmail for owner and group and dovecot.log has root:_vmail for owner
> and group.
>

I got the log file working.  I had to tell Postfix to run dovecot/deliver as
user:group vmail:vmail and that did it.  It WAS running dovecot/deliver as
some user whose name just happened to match (even though the mail didn't
belong to the person who had that system account).

I'm looking over the Postfix virtual_* stuff again.  Maybe there's new stuff
since I last did Postfix about 6 years ago or so.

Summary of what I want to accomplish:

There are many domains and many users in each domain.  Where the user part
of a domain happens to be the same as the user part of another domain, that
is NOT to be considered the same mainbox at all.  All mail to a set of
domains (currently all the domains) is to be delivered to maildir format
mailboxes via Dovecot.  IMAP users will login as "user at domain".  The
userdb/authdb is in passwd-file format, with different files for each
domain, and user names w/o domain being the index.  If necessary, I can
change the format of that to one big passwd-file format with
user at domainindex.  The mailboxes will be located in
/home/mail/XX/domain/YY/user/home/mail where XX will be 2 hex digits from
the MD5 of the domain, and YY will be 2 hex digits from the MD5 of the
username.  The part of the path before the final "mail" directory is the
"home" for the "user", and the last "mail" subdirectory is in maildir
format.  Domains and users are to be translated to lower case before
composing that path and before taking theur MD5 hash for XX and YY.  The
delivery into that path is to be done by Dovecot's deliver program so it
builds whatever indexes and stuff are needed to make IMAP access faster.
Also running POP3 is a plus, but not required.  The same userdb/passdb is to
also be used for submission of mail, via Dovecot's SASL support exported
back to Postfix.


More information about the dovecot mailing list