Mercurial > masqmail
view src/libident/id_query.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
/* ** id_query.c Transmit a query to an IDENT server ** ** Author: Peter Eriksson <pen@lysator.liu.se> */ #ifdef NeXT3 # include <libc.h> #endif #include <stdio.h> #include <errno.h> #include <signal.h> #ifdef HAVE_ANSIHEADERS # include <stdlib.h> # include <string.h> # include <unistd.h> #endif #include <sys/types.h> #include <sys/wait.h> #include <sys/time.h> #ifdef _AIX # include <sys/select.h> #endif #ifdef _AIX # include <sys/select.h> #endif #ifdef VMS # include <sys/socket.h> /* for fd_set */ #endif #define IN_LIBIDENT_SRC #include "ident.h" /* int id_query __P4(ident_t *, id, int, lport, int, fport, struct timeval *, timeout) */ int id_query __P((ident_t * id, int lport, int fport, __STRUCT_TIMEVAL_P timeout)) { #ifdef SIGRETURNTYPE SIGRETURNTYPE(*old_sig) (); #else void (*old_sig) __P((int)); #endif int res; char buf[80]; fd_set ws; sprintf(buf, "%d , %d\r\n", lport, fport); if (timeout) { FD_ZERO(&ws); FD_SET(id->fd, &ws); #ifdef __hpux if ((res = select(FD_SETSIZE, (int *) 0, (int *) &ws, (int *) 0, timeout)) < 0) #else if ((res = select(FD_SETSIZE, (fd_set *) 0, &ws, (fd_set *) 0, timeout)) < 0) #endif return -1; if (res == 0) { errno = ETIMEDOUT; return -1; } } old_sig = signal(SIGPIPE, SIG_IGN); res = write(id->fd, buf, strlen(buf)); signal(SIGPIPE, old_sig); return res; }