On 06 Dec 07, Hartmut Wernisch wrote:
> On 05 Dec 07, Tom Collins wrote:
> > On Dec 5, 2007, at 12:52 AM, Hartmut Wernisch wrote:
> > > 823 #ifdef QMAIL_EXT
> > > 824 /* format the file name */
> > > 825 if (strlen(TheExt)) {
> > > 826 strcpy(tmpbuf,".qmail-");
> > > 827 strcat(tmpbuf,TheExt);
> > > 828 if ( (fs = fopen(tmpbuf,"r")) == NULL ) {
> > > 829 for (i=strlen(TheExt);i>=0;--i) {
> > > 830 if (!i || TheExt[i-1]=='-') {
> > > 831 strcpy(tmpbuf,".qmail-");
> > > 832 strncat(tmpbuf,TheExt,i);
> > > 833 strcat(tmpbuf,"default");
> > > 834 if ( (fs = fopen(tmpbuf,"r")) != NULL) {
> > > 835 break;
> > > 836 }
> > > 837 }
> > > 838 }
> > > 839 }
> > > 840 } else {
> > > 841 fs = fopen(".qmail","r");
> > > 842 }
> > > 843 #else
> > > 844 fs = fopen(".qmail","r");
> > > 845 #endif
> >
> >
> > I think I know what the problem is, and it should be a simple fix.
> >
> > Before line 823, add:
> >
> > fs = NULL;
> >
> > Remove lines 840 - 845 and replace with the following:
>
> I removed the lines 840,841 and 843 - 845.
>
> >
> > 840 #endif
> > 841 if (fs == NULL) fs = fopen (".qmail", "r");
> >
> > Hartmut, can you test this fix? Rick, can you get this into the next
> > vpopmail release if Hartmut reports it as good?
>
> OK, this fix works at the first glance but I had a strange feeling
> about it, so I tested following:
>
>
>
> (I think in general there should be no ".qmail-something" files in
> mailboxes, only .qmail files?!)
>
Sorry, the mailbox of "hw" had also the same external forwarding email
address so the right test results are less confusing :)
So if we have following example:
--------------------------------
- A mailbox called "hw"
- A mailbox called "hw-foo" with following file in it:
.qmail
(It should be forwarded to an external address and delivered locally)
Tests:
1) Mail to "hw-foo": -> works
2) Mail to "hw-foo-bar": -> wrong!
- Mail is delivered to the mailbox of "hw" instead of "hw-de"!
Creating a ".qmail-bar" file in the mailbox of "hw-foo":
(It should be forwarded to an external address and delivered locally)
3) Mail to "hw-foo": -> works
4) Mail to "hw-foo-bar": -> wrong!
- Mail is delivered to the mailbox of "hw" instead of "hw-de"!
So it seems that the reverse qmail-ext parsing is not correct.
Regards,
Hartmut
!DSPAM:4757dbc332004177430474!