I've been using dbmail 1.x for a while now, injecting mail into the database with dbmail-smtp -u USER -m MAILBOX via procmail. Well I just upgraded to 2.0.pre4 and found out that all mail unconditionally got delivered to INBOX no matter what I had for for -m.

The attached patch is my kludge to get "dbmail-smtp -u xxx -m yyy" to work once again.


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Shawn Michael                                   [EMAIL PROTECTED]
RightNow Technologies                           Hosting Administrator
                                 A Better Way to Serve your Customers
diff --unified -r dbmail-2.0rc4/pipe.c dbmail-2.0rc4.-m_works/pipe.c
--- dbmail-2.0rc4/pipe.c	Fri Mar 19 09:27:38 2004
+++ dbmail-2.0rc4.-m_works/pipe.c	Sat Mar 27 19:37:14 2004
@@ -62,6 +62,7 @@
 #define DBMAIL_DELIVERY_USERNAME "[EMAIL PROTECTED]@__"
 #define DBMAIL_TEMPMBOX "INBOX"
 
+extern char *deliver_to_mailbox;
 extern struct list smtpItems, sysItems;
 
 /* 
@@ -521,6 +522,8 @@
 {
 	struct element *element, *ret_path;
 	u64_t msgsize, rfcsize, tmpmsgidnr;
+	char *tmp_mailbox_to_use = NULL;
+	int len;
 
 	/* Read in the rest of the stream and store it into a temporary message */
 	switch (store_message_temp
@@ -554,6 +557,14 @@
 			trace(TRACE_DEBUG,
 			      "%s, %s: calling sort_and_deliver for useridnr [%llu]",
 			      __FILE__, __FUNCTION__, useridnr);
+            
+            if (deliver_to_mailbox) {
+                len = strlen(deliver_to_mailbox) + 1;
+                tmp_mailbox_to_use = (char *)malloc(len);
+                bzero(tmp_mailbox_to_use, len);
+                strncpy(tmp_mailbox_to_use, deliver_to_mailbox, len);
+                delivery->mailbox = tmp_mailbox_to_use;
+            }
 
 			switch (sort_and_deliver(tmpmsgidnr,
 						 header, headersize,
diff --unified -r dbmail-2.0rc4/server.c dbmail-2.0rc4.-m_works/server.c
--- dbmail-2.0rc4/server.c	Fri Mar 19 09:27:38 2004
+++ dbmail-2.0rc4.-m_works/server.c	Sat Mar 27 18:40:29 2004
@@ -53,6 +53,10 @@
 int Restart = 0;
 pid_t ParentPID = 0;
 
+
+/* Needed because we use common code for dbmail-smtpd and dbmail-lmtpd */
+char *deliver_to_mailbox = NULL;
+
 /* some extra prototypes (defintions are below) */
 static void ParentSigHandler(int sig, siginfo_t * info, void *data);
 static int SetParentSigHandler(void);

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to