Delivered-to is causing me some problems
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:
[email protected] 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: [email protected]
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:
[email protected] list_1
local_alias:list_1: |mlmmj-recieve
but then i'd need two aliases for every list.
Regards,
Magnus
Un-optimal patch:
src/mlmmj-process.c 2006-08-07 02:35:42.000000000 +0200 renamed from src/mlmmj-process.c 2006-01-23 18:44:53.000000000 +0100 +11 -3
@@ -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) {
Magnus Naeslund(k) wrote:
[snip]
Quoted 11 lines
Well, guess I could always create lists that uses this alias system:
virtual_alias:
[email protected]list_1
local_alias:list_1: |mlmmj-recievebut then i'd need two aliases for every list.
[snip]
I adopted this approach for the time beeing, since it's simples in some ways. My patch didn't work too well either :)
Magnus