On Fri, Jun 15, 2012 at 03:28:42PM +0200, Joel Carnat wrote:
> Hi,
> 

Hi,

> I am playing with OpenSMTPD and am configuring a virtual domains and users
> configuration.
> 
> In smtpd.conf.local, I have set:
>   map "vdomains" { source db "/etc/mail/vdomains.db" }
>   accept for virtual "vdomains" deliver to maildir "/home/vmail/%d/%a/"

reads ok, except that you should remove '{' and '}', they were required but I
made them optional to ease transition as I will remove them next release.


> In /etc/mail/vdomains, I have set:
>   tumfatig.net:           true
>   carnat.net:             true
>   pt...@tumfatig.net      vmail
>   j...@carnat.net         vmail

reads ok


> So far, the mails are accepted but I face an error when the first mail is
> received ;
> when the full home directory does not exist yet:
>   Jun 15 15:12:36 openbsd smtpd[6293]: dcd4684048255931: to=<j...@carnat.net>,
> \
>   delay=0, stat=Error ("cannot mkdir maildir: No such file or directory")
> 
> When this error occurs, "/home/vmail" already exists and is own by
> vmail:vmail.
>
> Now, if I run:
>   # mkdir /home/vmail/carnat.net
>   # chown vmail:vmail /home/vmail/carnat.net
> And send the same mail (to j...@carnat.net), it is received correctly and
> the remaining "vmail/new" directory tree is created.
> 
> Is there some parameters to set so that smtpd creates the whole directory
> tree
> itself or is this an expected behaviour ?
>

OpenSMTPD only creates the Maildir itself so you need to make sure you
create a directory for each of the domains you plan to handle if you are
using the domain as part of the path.

Should we have an option to let it create all directories in the path ?
I dunno, it's pretty easy to pre-create them and let the code be as strict
as it is right now :-)

Gilles

-- 
Gilles Chehade

https://www.poolp.org | http://pool.ps                          @poolpOrg

Reply via email to