smartfilter=false;
memset(&globstat,0,sizeof(globstat));
- if (vrfydir(&period, addr, site, us)<0) {
- debuga(__FILE__,__LINE__,_("Cannot create the output directory name containing the period as part of the name\n"));
- exit(EXIT_FAILURE);
+ if (email[0]=='\0') {
+ if (vrfydir(&period, addr, site, us)<0) {
+ debuga(__FILE__,__LINE__,_("Cannot create the output directory name containing the period as part of the name\n"));
+ exit(EXIT_FAILURE);
+ }
+ } else {
+ if (snprintf(outdirname,sizeof(outdirname),"%s/emailrep",tmp)>=sizeof(outdirname)) {
+ debuga(__FILE__,__LINE__,_("Path too long: "));
+ debuga_more("%s/emailrep\n",tmp);
+ exit(EXIT_FAILURE);
+ }
+ my_mkdir(outdirname);
}
if(debugz>=LogLevel_Process){
debugaz(__FILE__,__LINE__,_("outdirname=%s\n"),outdirname);
}
- if (!FileList_IsEmpty(UserAgentLog) && email[0] == '\0') useragent();
+ if (email[0] == '\0' && !FileList_IsEmpty(UserAgentLog))
+ UserAgent_Readlog();
+
+ init_usertab(UserTabFile);
+ UserAgent();
snprintf(wdirname,sizeof(wdirname),"%s/sarg-general",outdirname);
if((fp_gen=MY_FOPEN(wdirname,"w"))==NULL){
if(SuccessfulMsg) debuga(__FILE__,__LINE__,_("Successful report generated on %s\n"),outdirname);
} else {
- geramail(outdirname, debug, email, tmp);
+ topuser();
if((strcmp(email,"stdout") != 0) && SuccessfulMsg)
debuga(__FILE__,__LINE__,_("Successful report generated and sent to %s\n"),email);