added -bv detection
parent
98a2e9aef0
commit
c4973961d8
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: kuvert_submit.c,v 1.9 2007/08/12 03:18:39 az Exp $
|
||||
* $Id: kuvert_submit.c,v 2.0 2008/06/01 05:15:35 az Exp az $
|
||||
*
|
||||
* this file is part of kuvert, a wrapper around your mta that
|
||||
* does pgp/gpg signing/signing+encrypting transparently, based
|
||||
|
@ -51,13 +51,25 @@ int main(int argc,char **argv)
|
|||
FILE *out;
|
||||
FILE *cf;
|
||||
struct stat statbuf;
|
||||
int direct=1,norecips=0;
|
||||
int direct=1,norecips=0,testmode=0,i;
|
||||
|
||||
/* determine whether to queue stuff or to call sendmail
|
||||
directly: if there is no proper config file for kuvert in $HOME
|
||||
go direct, otherwise we enqueue. */
|
||||
or if given -bv go direct, otherwise we enqueue. */
|
||||
openlog(argv[0],LOG_NDELAY|LOG_PID,LOG_MAIL);
|
||||
|
||||
for(i=1;i<argc;++i)
|
||||
{
|
||||
if (!strncmp(argv[i],"-bv",3))
|
||||
{
|
||||
testmode=1;
|
||||
syslog(LOG_INFO,"-bv argument present, running sendmail.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!testmode)
|
||||
{
|
||||
/* look for config file in $HOME */
|
||||
pwentry=getpwuid(getuid());
|
||||
if (!pwentry)
|
||||
|
@ -109,6 +121,7 @@ int main(int argc,char **argv)
|
|||
}
|
||||
fclose(cf);
|
||||
}
|
||||
}
|
||||
|
||||
/* direct to sendmail requested? */
|
||||
if (direct)
|
||||
|
|
|
@ -18,7 +18,8 @@ kuvert to intercept and process the outgoing mails. Please see your MUA's
|
|||
documentation about how to override the MTA to be used.
|
||||
|
||||
Kuvert_submit transparently invokes C</usr/sbin/sendmail> directly
|
||||
if it cannot find a ~/.kuvert configuration file. Otherwise, it enqueues
|
||||
if it cannot find a ~/.kuvert configuration file, or if the -bv option
|
||||
is given. Otherwise, it enqueues
|
||||
the email in the queue directory specified in the configuration file.
|
||||
If that fails or if the configuration file is invalid, kuvert_submit prints an
|
||||
error message to STDERR and terminates with exit code 1.
|
||||
|
@ -30,7 +31,7 @@ Kuvert_submit also logs messages to syslog with the facility "mail".
|
|||
|
||||
If it runs the MTA directly then kuvert_submit passes all options through
|
||||
to /usr/sbin/sendmail. Otherwise, it ignores all options except
|
||||
-f and -t.
|
||||
-f and -t (and -bv which triggers a direct sendmail pass-through).
|
||||
|
||||
=over
|
||||
|
||||
|
|
Loading…
Reference in New Issue