[Dovecot] rc7 bug? [Was: deliver LDA and INBOX location]

David Lee t.d.lee at durham.ac.uk
Fri Sep 1 12:22:20 EEST 2006


On Thu, 31 Aug 2006, David Lee wrote:

> [...]
> We have a well-established different convention which subdivides this,
> based on the last two digits of the uid: "/var/spool/mail/12/fred" (for
> fred's uid as something ending "[...]12").  This is working nicely with
> dovecot, using the new rc7 functionality:
>   default_mail_env = mbox:%h:INBOX=/var/spool/mail/%-2.02i/%u:[...]
>
> I am now trying to get sendmail to use dovecot's "deliver" as the LDA,
> [...] The main problem is that, according to the log file, the delivery
> attempt is being made to an INBOX "/var/spool/mail//fred".  That is, it
> seems to be ignoring the "default_mail_env" setting.
>
> Have I missed something in the wiki, or is this a bug of some sort?

I have looked deeper at my problem (abov).  It seems to be a bug in rc7,
and probably an "always been there" bug.

I sprinked a few "i_info(...)" diagnostics into "deliver.c" where it does
'getenv("MAIL")' and 'getenv("DEFAULT_MAIL_ENV")'.  It shows that these
are being successfully read from the 'dovecot.conf' file (good).

But, crucially, it seems that the "%" variable substitution is incomplete:

   line 483: MAIL [null]
   line 486: MAIL mbox:%h:INBOX=/var/spool/mail/%-2.02i/%u:INDEX=/var/spool/mail/indexes/%d/%n
   line 492: MAIL mbox:/home/fred:INBOX=/var/spool/mail//fred:INDEX=/var/spool/mail/indexes//fred

(Aside: The act of inserting the 'i_info' will have knocked the line
numbers adrift by a couple.  But it shows what is (not) happening.)

Note in the "INBOX=..." clause that while "%u" and "%h" have been
successfully expanded (good), the "%i" variant (UNIX uid) has failed to
get expanded (bad).

I'm new to dovecot, so am on a steep learning curve and am unfamiliar with
the source code and dovecot's principles.  So it would probably take me
ages to work out a suitable patch, and even then it might be
inappropriate.

But hopefully the above information is sufficient and suitable for someone
(Timo?) to investigate more expertly and fully.

If someone can produce a patch (or hints of what to patch and where) I
would certainly intend to test it and work on it for you.

Hope that helps.  Many thanks in advance.

-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:                                           Durham University     :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :


More information about the dovecot mailing list