All of lore.kernel.org
 help / color / mirror / Atom feed
* Delivered-to is causing me some problems
@ 2006-08-07  0:56 Magnus Naeslund(k)
  2006-08-08 17:09 ` Magnus Naeslund(k)
  0 siblings, 1 reply; 2+ messages in thread
From: Magnus Naeslund(k) @ 2006-08-07  0:56 UTC (permalink / raw)
  To: mlmmj

mlmmj is scanning Delivered-to: headers and trying to match where there listname is by checking for the delimiter. 
This is causing me problems since I would like to be able to use one alias for all lists together with postfix.
I've patched mlmmj-make-ml to create /var/spool/mlmmj/list@domain directories, and i've created virtual aliases in postfix to send the list to one local user like this:

list@domain.com listmgr-list=domain.com

When a mail comes in i dispatch an mlmmj-recieve with the correct directory.
The problem then is that postfix adds a 

Delivered-to: listmgr-list=domain.com@mailserver.com

and this freaks mlmmj out since it can't establish that the mail was sent to the list or something like that.

I'm wondering if I'm going about this the wrong way, or if this is desired to be solved somehow.
I've created a proof of concept patch below that takes care of this problem, but I'm not sure if it is desirable.
One side effect of fixing this the "right" way would be that it could allow to have $delimiter characters in the listname.
For example I'm forced to use the - delimiter, and that might allow me to create a list that's called list-test@domain.

Well, guess I could always create lists that uses this alias system:

virtual_alias:
list@domain.com list_1

local_alias:
list_1: |mlmmj-recieve

but then i'd need two aliases for every list.

Regards,
Magnus

Un-optimal patch:

--- mlmmj-1.2.11-vanilla/src/mlmmj-process.c    2006-01-23 18:44:53.000000000 +0100
+++ mlmmj-1.2.11/src/mlmmj-process.c    2006-08-07 02:35:42.000000000 +0200
@@ -322,7 +322,7 @@
        char *randomstr = NULL, *mqueuename;
        char *mlmmjsend, *mlmmjsub, *mlmmjunsub, *mlmmjbounce;
        char *bindir, *subjectprefix, *discardname, *listaddr, *listdelim;
-       char *listfqdn, *listname, *fromaddr;
+       char *listfqdn, *listname, *listnameanddelim, *fromaddr;
        char *queuefilename, *recipextra, *owner = NULL;
        char *maildata[2] = { "posteraddr", NULL };
        struct stat st;
@@ -516,12 +516,20 @@
                whichto = NULL;

        listdelim = getlistdelim(listdir);
+       listaddr = getlistaddr(listdir);
+       listname = genlistname(listaddr);
+       listnameanddelim = concatstr(2, listname, listdelim);
+
        if(whichto && whichto->emaillist && whichto->emaillist[0]){
-               recipextra = strstr(whichto->emaillist[0], listdelim);
+               recipextra = strstr(whichto->emaillist[0], listnameanddelim);
                if (recipextra)
-                       recipextra += strlen(listdelim);
+                       recipextra += strlen(listnameanddelim);
        } else
                recipextra = NULL;
+
+       myfree(listnameanddelim);
+       myfree(listname);
+       myfree(listaddr);
        myfree(listdelim);

        if(recipextra) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-08 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07  0:56 Delivered-to is causing me some problems Magnus Naeslund(k)
2006-08-08 17:09 ` Magnus Naeslund(k)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.