Had to make is_approved a global variable, because it is actually
tested in subroutines of listserv_main() and hermes_main(), like subscribe(), which's parameter list I don't want to change.
This commit is contained in:
parent
228e6c443c
commit
cce2222de3
2
hermes.c
2
hermes.c
@ -25,7 +25,7 @@
|
|||||||
#include "petidomo.h"
|
#include "petidomo.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
hermes_main(char * incoming_mail, const char * listname, char is_approved)
|
hermes_main(char * incoming_mail, const char * listname)
|
||||||
{
|
{
|
||||||
const struct PD_Config * MasterConfig;
|
const struct PD_Config * MasterConfig;
|
||||||
const struct List_Config * ListConfig;
|
const struct List_Config * ListConfig;
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
char * g_currLine; /* pointer to the line currently parsed */
|
char * g_currLine; /* pointer to the line currently parsed */
|
||||||
|
|
||||||
int
|
int
|
||||||
listserv_main(char * incoming_mail, char * default_list, char is_approved)
|
listserv_main(char * incoming_mail, char * default_list)
|
||||||
{
|
{
|
||||||
const struct List_Config * ListConfig;
|
const struct List_Config * ListConfig;
|
||||||
struct Mail * MailStruct;
|
struct Mail * MailStruct;
|
||||||
|
|||||||
8
main.c
8
main.c
@ -33,7 +33,7 @@
|
|||||||
static char* listname = NULL;
|
static char* listname = NULL;
|
||||||
static char* mode = NULL;
|
static char* mode = NULL;
|
||||||
static char* masterconfig_path = SYSCONFDIR "/petidomo.conf";
|
static char* masterconfig_path = SYSCONFDIR "/petidomo.conf";
|
||||||
static char is_approved = ARGV_FALSE;
|
char g_is_approved = ARGV_FALSE;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char * argv[])
|
main(int argc, char * argv[])
|
||||||
@ -45,7 +45,7 @@ main(int argc, char * argv[])
|
|||||||
{ARGV_MAND, "mode", ARGV_CHAR_P, &mode, "mode", "listserv, deliver, or approve."},
|
{ARGV_MAND, "mode", ARGV_CHAR_P, &mode, "mode", "listserv, deliver, or approve."},
|
||||||
{ARGV_MAYBE, "listname", ARGV_CHAR_P, &listname, "listname", "Default mailing list."},
|
{ARGV_MAYBE, "listname", ARGV_CHAR_P, &listname, "listname", "Default mailing list."},
|
||||||
{ARGV_MAYBE, "masterconf", ARGV_CHAR_P, &masterconfig_path, "masterconf", "Path to petidomo.conf."},
|
{ARGV_MAYBE, "masterconf", ARGV_CHAR_P, &masterconfig_path, "masterconf", "Path to petidomo.conf."},
|
||||||
{ARGV_MAYBE, "approved", ARGV_BOOL, &is_approved, "approved", "approved flag."},
|
{ARGV_MAYBE, "approved", ARGV_BOOL, &g_is_approved, "approved", "approved flag."},
|
||||||
{ARGV_LAST}
|
{ARGV_LAST}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -80,11 +80,11 @@ main(int argc, char * argv[])
|
|||||||
/* Now decide what we actually do with the mail. */
|
/* Now decide what we actually do with the mail. */
|
||||||
|
|
||||||
if (strcasecmp("listserv", mode) == 0)
|
if (strcasecmp("listserv", mode) == 0)
|
||||||
listserv_main(incoming_mail, listname, is_approved);
|
listserv_main(incoming_mail, listname);
|
||||||
else if (strcasecmp("deliver", mode) == 0)
|
else if (strcasecmp("deliver", mode) == 0)
|
||||||
{
|
{
|
||||||
if (listname != NULL)
|
if (listname != NULL)
|
||||||
hermes_main(incoming_mail, listname, is_approved);
|
hermes_main(incoming_mail, listname);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "Wrong command line syntax; deliver mode requires a parameter.");
|
syslog(LOG_ERR, "Wrong command line syntax; deliver mode requires a parameter.");
|
||||||
|
|||||||
@ -48,6 +48,10 @@
|
|||||||
# include <dmalloc.h>
|
# include <dmalloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/********** main.c **********/
|
||||||
|
|
||||||
|
extern char g_is_approved;
|
||||||
|
|
||||||
/********** config.c **********/
|
/********** config.c **********/
|
||||||
|
|
||||||
struct PD_Config
|
struct PD_Config
|
||||||
@ -185,7 +189,7 @@ int savefile(const char *filename, const char *buffer);
|
|||||||
|
|
||||||
/********** listserv.c **********/
|
/********** listserv.c **********/
|
||||||
|
|
||||||
int listserv_main(char *incoming_mail, char *default_list, char);
|
int listserv_main(char *incoming_mail, char *default_list);
|
||||||
|
|
||||||
/********** mailer.c **********/
|
/********** mailer.c **********/
|
||||||
|
|
||||||
@ -215,7 +219,7 @@ int DeleteAddress(struct Mail *MailStruct, const char *param1, const char *param
|
|||||||
|
|
||||||
/********** hermes.c **********/
|
/********** hermes.c **********/
|
||||||
|
|
||||||
int hermes_main(char *incoming_mail, const char *listname, char);
|
int hermes_main(char *incoming_mail, const char *listname);
|
||||||
|
|
||||||
/********** subscribe.c **********/
|
/********** subscribe.c **********/
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user