mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 08:40:12 +01:00
skip storing rcpt address matching the cfg.hostid
This commit is contained in:
parent
20b6eb7143
commit
b8d10ea9e5
@ -185,6 +185,8 @@ struct __config read_config(char *configfile){
|
||||
|
||||
if(parse_config_file(configfile, &cfg, config_parse_rules) == -1) printf("error parsing the configfile: %s\n", configfile);
|
||||
|
||||
cfg.hostid_len = strlen(cfg.hostid);
|
||||
|
||||
return cfg;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ struct __config {
|
||||
char username[MAXVAL];
|
||||
|
||||
char hostid[MAXVAL];
|
||||
int hostid_len;
|
||||
|
||||
char pidfile[MAXVAL];
|
||||
char pilergetd_pidfile[MAXVAL];
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#define VERSION "0.1.25-master-branch"
|
||||
|
||||
#define BUILD 846
|
||||
#define BUILD 847
|
||||
|
||||
#define HOSTID "mailarchiver"
|
||||
|
||||
|
10
src/parser.c
10
src/parser.c
@ -636,12 +636,18 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
|
||||
if(state->message_state == MSG_RECIPIENT && findnode(state->journal_recipient, puf) == NULL){
|
||||
addnode(state->journal_recipient, puf);
|
||||
memcpy(&(state->b_journal_to[state->journaltolen]), puf, len);
|
||||
memcpy(&(state->b_journal_to[state->journaltolen]), puf, len);
|
||||
if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: journal rcpt: '%s'", sdata->ttmpfile, puf);
|
||||
}
|
||||
|
||||
|
||||
if(findnode(state->rcpt, puf) == NULL){
|
||||
|
||||
/* skip any address matching ...@cfg->hostid, 2013.10.29, SJ */
|
||||
q = strchr(puf, '@');
|
||||
if(q && strncmp(q+1, cfg->hostid, cfg->hostid_len) == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
addnode(state->rcpt, puf);
|
||||
memcpy(&(state->b_to[state->tolen]), puf, len);
|
||||
state->tolen += len;
|
||||
@ -650,7 +656,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
|
||||
if(is_email_address_on_my_domains(puf, data) == 1) sdata->internal_recipient = 1;
|
||||
else sdata->external_recipient = 1;
|
||||
|
||||
q = strchr(puf, '@');
|
||||
//q = strchr(puf, '@');
|
||||
if(q){
|
||||
if(findnode(state->rcpt_domain, q+1) == NULL){
|
||||
addnode(state->rcpt_domain, q+1);
|
||||
|
Loading…
Reference in New Issue
Block a user