Mercurial > masqmail
view src/libident/support.c @ 276:1abc1faeb45d
for -t cmdline args are now added to the rcpt list instead of substracted
Please read the diff and the section about -t in man/masqmail.8.
Masqmail's behavior had been like the one of exim/smail, now it's
similar to postfix.
Masqmail does it now the most simple way, regarding the code.
Also, addr args are always recipients, -t does not change their meaning.
-t makes the addrs from rcpt hdrs, rcpt addrs too.
It would have been logical too, to ignore the cmdline args,
in the sense of ``headers *instead of* args'' but none of the
popular MTAs does it that way and it would have been a bit more
complicated in the code.
Anyway, this is a corner-case that should better be avoided completely.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Fri, 03 Dec 2010 21:05:34 -0300 |
parents | 26e34ae9a3e3 |
children |
line wrap: on
line source
/* ** support.c ** ** Author: Pr Emanuelsson <pell@lysator.liu.se> ** Hacked by: Peter Eriksson <pen@lysator.liu.se> */ #include <stdio.h> #include <ctype.h> #ifdef HAVE_ANSIHEADERS # include <stdlib.h> # include <string.h> #else # define strchr(str, c) index(str, c) #endif #define IN_LIBIDENT_SRC #include "ident.h" char* id_strdup __P1(char *, str) { char *cp; cp = (char *) malloc(strlen(str) + 1); if (cp == NULL) { #ifdef DEBUG perror("libident: malloc"); #endif return NULL; } strcpy(cp, str); return cp; } char* id_strtok __P3(char *, cp, char *, cs, char *, dc) { static char *bp = 0; if (cp) bp = cp; /* ** No delimitor cs - return whole buffer and point at end */ if (!cs) { while (*bp) bp++; return cs; } /* ** Skip leading spaces */ while (isspace(*bp)) bp++; /* ** No token found? */ if (!*bp) return 0; cp = bp; while (*bp && !strchr(cs, *bp)) bp++; /* ** Remove trailing spaces */ *dc = *bp; for (dc = bp - 1; dc > cp && isspace(*dc); dc--); *++dc = '\0'; bp++; return cp; }