# HG changeset patch # User mortenp # Date 1083070316 -36000 # Node ID f818073d0926569ec0861cee68e04790e4c440d2 # Parent afd7356e8f2e6b0e28023a56d8f01a565c7c3732 changed bounce_from_adr() to match the bounce handling diff -r afd7356e8f2e -r f818073d0926 src/mlmmj-send.c --- a/src/mlmmj-send.c Tue Apr 27 22:37:58 2004 +1000 +++ b/src/mlmmj-send.c Tue Apr 27 22:51:56 2004 +1000 @@ -41,7 +41,11 @@ size_t len; indexstr = strrchr(mailfilename, '/'); - if (!indexstr) indexstr = mailfilename; + if (indexstr) { + indexstr++; /* skip the slash */ + } else { + indexstr = mailfilename; + } recipient = strdup(recipient); if (!recipient) { @@ -63,16 +67,17 @@ } *listdomain++ = '\0'; - /* 11 = "-bounces" + RECIPDELIM + "@" + NUL */ - len = strlen(listadr) + strlen(recipient) + strlen(listdomain) + 11; + /* 12 = RECIPDELIM + "bounces-" + "-" + "@" + NUL */ + len = strlen(listadr) + strlen(recipient) + strlen(indexstr) + + strlen(listdomain) + 12; bounce_adr = malloc(len); if (!bounce_adr) { free(recipient); free(listadr); return NULL; } - snprintf(bounce_adr, len, "%s-bounces%c%s@%s", listadr, RECIPDELIM, - recipient, listdomain); + snprintf(bounce_adr, len, "%s%cbounces-%s-%s@%s", listadr, RECIPDELIM, + recipient, indexstr, listdomain); free(recipient); free(listadr);