Now I remember! I continued fixing a bug or two in the 2.0rc2-fixes-snap1 tree
after I'd made the patches from it. But to start clean, I took a fresh 2.0rc2,
applied the patches, and then started working towards the next set of
patches... apparently without bringing this bugfix into the new tree :-\
I read over the rest of the diff to make sure that I didn't leave anything
else out, and this does seem to be the only thing I missed.
Apply the attached patch, *reversed* (because I really need sleep :-P)
Aaron
""Aaron Stone"" <[EMAIL PROTECTED]> said:
> Oh, weird. I really did fix that already; I'll see if maybe I fixed it in an
> older tree by accident. Will post a patch this afternoon.
>
> Aaron
>
>
> Ilja Booij <[EMAIL PROTECTED]> said:
>
> > I've applied the patch (have not updated CVS yet).
> >
> > I ran into the following problem:
> > When delivering a message, all message go into the mailbox of user_idnr
> > 0 (that is: zero).
> >
> > The problem seems to be, that the user_idnrs to deliver the messages to
> > are kept in delivery->userids (in a list), but that this list is never
> > used when attempting delivery. The delivery->userids field is not used
> > when calling sort_and_deliver(). In that call, only delivery->useridnr
> > is used, which defaults to zero.
> >
> > Ilja
> >
> > Aaron Stone wrote:
> >
> > > Here it goes... I'll also post to SourceForge.
> > >
> > > Aaron
> > >
> > >
> > > Ilja Booij <[EMAIL PROTECTED]> said:
> > >
> > >
> > >>HEAD is completely updated. I'm having some trouble updating
> > >>dbmail_2_0_branch, due to conflicts when applying patches. I guess I'll
> > >>wait with updating that branch. Or, like somebody suggested a while ago,
> > >>do the branching on release of 2.0 final (and abandon the current branch
> > >>for now).
> > >>
> > >>Good luck finishing your project :)
> > >>
> > >>Ilja
> > >>Aaron Stone wrote:
> > >>
> > >>
> > >>>If you have CVS updated to your latest working tree I'll patch against it
> in a
> > >>>few hours. This moment I have to finish up a project before daybreak.
> > >>>
> > >>>Aaron
> > >>>
> > >>>
> > >>>Ilja Booij <[EMAIL PROTECTED]> said:
> > >>>
> > >>>
> > >>>
> > >>>>Just tried this for myself. A lot of warnings..
> > >>>>
> > >>>>I guess the cleaned up statements are in the patches you'll send me
> > >>>>today? ;)
> > >>>>
> > >>>>I agree we should keep the __attribute__ thing in the source. It does
> > >>>>not cost us anything, and it helps preventing bugs. Sounds like free
> > >>>>lunch to me! :)
> > >>>>
> > >>>>Ilja
> > >>>>
> > >>>>Aaron Stone wrote:
> > >>>>
> > >>>>
> > >>>>
> > >>>>>Well that was fun! I also caught three or four more of the missing
> > >>>>>comma
> > >>>>>errors, and a handful of "%s, %s: ...." formats that were missing the
> > >>>>>__FILE__, __FUNCTION arguments.
> > >>>>>
> > >>>>>I cleaned up all of the warnings, though we should definitely keep
the GNU
> > >>>>>attribute in the source to warn against format bugs in the future.
> > >>>>>
> > >>>>>Aaron
> > >>>>>
> > >>>>>
> > >>>>>"Aaron Stone" <[EMAIL PROTECTED]> said:
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>>I found the GNU extension to turn on pritnf style format checking! In
> > >
> > > debug.h,
> > >
> > >>>>>>make this your declaration of trace():
> > >>>>>>
> > >>>>>>void trace(int level, char *formatstring, ...)
> > >>>>>> __attribute__((format(printf, 2, 3)));
> > >>>>>>
> > >>>>>>Voila, tons of errors next time you make.
> > >>>>>>
> > >>>>>>Aaron
> > >>>>>
> > >>>>>
> > >>>>_______________________________________________
> > >>>>Dbmail-dev mailing list
> > >>>>[email protected]
> > >>>>http://twister.fastxs.net/mailman/listinfo/dbmail-dev
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>_______________________________________________
> > >>Dbmail-dev mailing list
> > >>[email protected]
> > >>http://twister.fastxs.net/mailman/listinfo/dbmail-dev
> > >>
> > >
> > >
> > >
> > >
> > _______________________________________________
> > Dbmail-dev mailing list
> > [email protected]
> > http://twister.fastxs.net/mailman/listinfo/dbmail-dev
> >
>
>
>
> --
>
>
>
> _______________________________________________
> Dbmail-dev mailing list
> [email protected]
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>
--
diff -rau dbmail-2.0rc2-fixes/pipe.c dbmail-2.0rc2-fixes-snap2/pipe.c
--- dbmail-2.0rc2-fixes/pipe.c 2004-02-14 15:43:04.000000000 -0800
+++ dbmail-2.0rc2-fixes-snap2/pipe.c 2004-02-27 10:57:00.000000000 -0800
@@ -624,64 +647,62 @@
}
/* Get the user list resolved into fully deliverable form */
- if (resolve_deliveries(dsnusers) != 0)
- {
+ if (resolve_deliveries(dsnusers) != 0)
return -1;
- }
/* Loop through the users list */
- for (element = list_getstart(dsnusers); element != NULL; element = element->nextnode)
+ for (element = list_getstart(dsnusers); element != NULL; element = element->nextnode)
{
- struct element *userid_elem;
deliver_to_user_t *delivery = (deliver_to_user_t *)element->data;
- for (userid_elem = list_getstart(delivery->userids);
- userid_elem != NULL; userid_elem = userid_elem->nextnode)
- {
- u64_t useridnr = *(u64_t *)userid_elem->data;
- trace(TRACE_DEBUG, "%s, %s: calling sort_and_deliver for useridnr [%llu]",
- __FILE__, __FUNCTION__, useridnr);
+ trace(TRACE_ERROR, "%s, %s: calling sort_and_deliver for useridnr [%llu]",
+ __FILE__, __FUNCTION__, delivery->useridnr);
- switch (sort_and_deliver(tmpmsgidnr, header, headersize, msgsize, useridnr, delivery->mailbox))
- {
- case 1:
- /* Indicate success */
- trace(TRACE_DEBUG, "%s, %s: sort_and_delivery was successful for useridnr [%llu]",
- __FILE__, __FUNCTION__, useridnr);
- break;
- case 0:
- /* Indicate failure */
- trace(TRACE_ERROR, "%s, %s: out of memory",
- __FILE__, __FUNCTION__);
- break;
- default:
- /* Assume a failure */
- trace(TRACE_ERROR, "%s, %s: out of memory",
- __FILE__, __FUNCTION__);
- break;
- }
-
- /* Automatic reply and notification */
- execute_auto_ran(useridnr, headerfields);
- } /* from: the useridnr for loop */
+ /* The error reporting really needs to be more verbose
+ * and for goodness sake, no magic numbers! Define these!
+ * */
+ switch (sort_and_deliver(tmpmsgidnr,
+ header, headersize,
+ msgsize, rfcsize,
+ delivery->useridnr, delivery->mailbox))
+ {
+ case 1:
+ /* Indicate success */
+ trace(TRACE_DEBUG, "%s, %s: message successfully sorted and delivered",
+ __FILE__, __FUNCTION__);
+ break;
+ case 0:
+ /* Indicate failure */
+ trace(TRACE_ERROR, "%s, %s: out of memory",
+ __FILE__, __FUNCTION__);
+ break;
+ default:
+ /* Assume a failure */
+ trace(TRACE_ERROR, "%s, %s: out of memory",
+ __FILE__, __FUNCTION__);
+ break;
+ }
+
+ /* Automatic reply and notification */
+ execute_auto_ran(delivery->useridnr, headerfields);
trace(TRACE_DEBUG,"insert_messages(): we need to deliver [%ld] "
"messages to external addresses", list_totalnodes(delivery->forwards));
- /* Do we have any forwarding addresses? */
+ /* do we have forward addresses? */
if (list_totalnodes(delivery->forwards) > 0)
{
-
+ /* sending the message to forwards */
+
trace(TRACE_DEBUG, "insert_messages(): delivering to external addresses");
- /* Only the last step of the returnpath is used. */
ret_path = list_getstart(returnpath);
- /* Forward using the temporary stored message. */
+ /* deliver using database */
forward(tmpmsgidnr, delivery->forwards, (ret_path ? ret_path->data : "DBMAIL-MAILER"), header, headersize);
}
- } /* from: the delivery for loop */
+ } /* from: the main for loop */
db_delete_message(tmpmsgidnr);
trace(TRACE_DEBUG, "insert_messages(): temporary message deleted from database");