isoqlog-devel/0040755000175000000000000000000010055616055012640 5ustar muratwheelisoqlog-devel/isoqlog/0040755000175000000000000000000010055616055014315 5ustar muratwheelisoqlog-devel/isoqlog/Global.h0100644000175000000000000000036210044133601015651 0ustar muratwheel #ifndef GLOBAL_H #define GLOBAL_H #include #define VERSION_STRING "EnderUNIX Isoqlog 2.2-BETA" enum { BUFSIZE = 1024, KEYSIZE = 64, VALSIZE = 256 }; time_t secs; time_t today ; struct tm *t2; #endif isoqlog-devel/isoqlog/Data.c0100644000175000000000000003321710035733656015342 0ustar muratwheel#include #include #include #include #include #include "Data.h" unsigned int hash(char *str) { unsigned int h; unsigned char *p; h = 0; for (p = (unsigned char *)str; *p != '\0'; p++) h = MULTIPLIER * h + *p; return h % MAXUSERS; } int addDomain(char *d) { domain *dm; int i; /* Check whether this domain was added before */ for (i = 0; i < DomainsTab.nval; i++) if (strncmp(DomainsTab.alldomains[i].domain, d, DOMAINSIZ) == 0) return -1; if (DomainsTab.alldomains == NULL) { dm = (domain *)malloc(NVINIT * sizeof(domain)); if (dm == NULL) return -1; DomainsTab.max = NVINIT; DomainsTab.nval = 0; DomainsTab.alldomains = dm; } else if (DomainsTab.nval >= DomainsTab.max) { dm = (domain *)realloc(DomainsTab.alldomains, (NVGROW * DomainsTab.max) * sizeof(domain)); if (dm == NULL) return -1; DomainsTab.max *= NVGROW; DomainsTab.alldomains = dm; } strncpy(DomainsTab.alldomains[DomainsTab.nval].domain, d, DOMAINSIZ); /* Initializing domain users hash array to NULL, initializing domain stats */ for (i = 0; i < MAXUSERS; i++) DomainsTab.alldomains[DomainsTab.nval].users[i] = NULL; DomainsTab.alldomains[DomainsTab.nval].from_cnt = 0; DomainsTab.alldomains[DomainsTab.nval].from_byte = 0; DomainsTab.alldomains[DomainsTab.nval].to_cnt = 0; return DomainsTab.nval++; } void checkUserInGeneral(char *m, int d, double b) { int h; user *p; globuser *gl; h = hash(m); for (gl = globusers[h]; gl != NULL; gl = gl->next) { if (strncmp(gl->u->user, m, USERSIZ) == 0) { if (d == FROM_MAIL) { gl->u->from_cnt++; gl->u->from_byte += b; } else gl->u->to_cnt++; } return; } gl = (globuser *)malloc(sizeof(globuser)); p = (user *)malloc(sizeof(user)); strncpy(p->user, m, USERSIZ); if (d == FROM_MAIL) { p->from_cnt = 1; p->to_cnt = 0; p->from_byte = b; } else { p->from_cnt = 0; p->to_cnt = 1; p->from_byte = 0; } gl->u = p; gl->next = globusers[h]; globusers[h] = gl; return; } void checkUserPtrInGeneral(user *p) { int h; globuser *gl; gl = (globuser *)malloc(sizeof(globuser)); gl->u = p; h = hash(p->user); gl->next = globusers[h]; globusers[h] = gl; return; } void checkUser(char *dmn, char *m, int d, double byte) { int tmpnval; int h, i; user *sym = NULL; tmpnval = -1; for (i = 0; i < DomainsTab.nval; i++) if (strncmp(DomainsTab.alldomains[i].domain, dmn, DOMAINSIZ) == 0) { tmpnval = i; break; } /* If user's domain is not in our domains list, * we only add it to general users tab */ if (tmpnval == -1) { checkUserInGeneral(m, d, byte); return; } h = hash(m); for (sym = DomainsTab.alldomains[tmpnval].users[h]; sym != NULL; sym = sym->next) { if (strncmp(sym->user, m, USERSIZ) == 0) { if (d == FROM_MAIL) { sym->from_cnt++; sym->from_byte += byte; DomainsTab.alldomains[tmpnval].from_cnt++; DomainsTab.alldomains[tmpnval].from_byte += byte; } else { sym->to_cnt++; DomainsTab.alldomains[tmpnval].to_cnt++; } return; } } sym = (user *)malloc(sizeof(user)); strncpy(sym->user, m, USERSIZ); if (d == FROM_MAIL) { sym->from_cnt = 1; sym->from_byte = byte; sym->to_cnt = 0; DomainsTab.alldomains[tmpnval].from_cnt++; DomainsTab.alldomains[tmpnval].from_byte += byte; } else { sym->from_cnt = 0; sym->from_byte = 0; sym->to_cnt = 1; DomainsTab.alldomains[tmpnval].to_cnt++; } sym->next = DomainsTab.alldomains[tmpnval].users[h]; DomainsTab.alldomains[tmpnval].users[h] = sym; checkUserPtrInGeneral(sym); return; } void freeSortDomainTab() { free(SortDomain.allusers); SortDomain.nval = 0; SortDomain.max = 0; SortDomain.allusers = 0x0; } int addUserToSortTab(user *usr) { int *u; if (SortDomain.allusers == NULL) { /* first time */ SortDomain.allusers = (int *)malloc(NVINIT * sizeof(int *)); if (SortDomain.allusers == NULL) return -1; SortDomain.max = NVINIT; SortDomain.nval = 0; } else if (SortDomain.nval >= SortDomain.max) { /* growing....*/ u = (int *)realloc(SortDomain.allusers, (NVGROW * SortDomain.max) * sizeof(int *)); if (u == NULL) return -1; SortDomain.max *= NVGROW; SortDomain.allusers = u; } SortDomain.allusers[SortDomain.nval] = (int)usr; return SortDomain.nval++; } void sortDomainUsersFrom(char *domain) { int tmpnval, i, j, max, tmp; struct domain *domainptr; struct user *sym; struct user *tmp1, *tmp2; tmpnval = -1; for (i = 0; i < DomainsTab.nval; i++) if (strncmp(DomainsTab.alldomains[i].domain, domain, DOMAINSIZ) == 0) { tmpnval = i; break; } domainptr = (struct domain *)&DomainsTab.alldomains[i]; for (i = 0; i < MAXUSERS; i++) { for (sym = domainptr->users[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym); } for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if (tmp1->from_cnt > tmp2->from_cnt) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sortDomainUsersTo(char *domain) { int tmpnval, i, j, max, tmp; struct domain *domainptr; struct user *sym; struct user *tmp1, *tmp2; tmpnval = -1; for (i = 0; i < DomainsTab.nval; i++) if (strcasecmp(DomainsTab.alldomains[i].domain, domain) == 0) { tmpnval = i; break; } domainptr = (struct domain *)&DomainsTab.alldomains[i]; for (i = 0; i < MAXUSERS; i++) { for (sym = domainptr->users[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym); } for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if (tmp1->to_cnt > tmp2->to_cnt) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sortDomainUsersTotal(char *domain) { int tmpnval, i, j, max, tmp; struct domain *domainptr; struct user *sym; struct user *tmp1, *tmp2; tmpnval = -1; for (i = 0; i < DomainsTab.nval; i++) if (strcasecmp(DomainsTab.alldomains[i].domain, domain) == 0) { tmpnval = i; break; } domainptr = (struct domain *)&DomainsTab.alldomains[i]; for (i = 0; i < MAXUSERS; i++) { for (sym = domainptr->users[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym); } for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if ((tmp1->from_cnt + tmp1->to_cnt) > (tmp2->from_cnt + tmp2->to_cnt)) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sortDomainUsersByte(char *domain) { int tmpnval, i, j, max, tmp; struct domain *domainptr; struct user *sym; struct user *tmp1, *tmp2; tmpnval = -1; for (i = 0; i < DomainsTab.nval; i++) if (strncmp(DomainsTab.alldomains[i].domain, domain, DOMAINSIZ) == 0) { tmpnval = i; break; } domainptr = (struct domain *)&DomainsTab.alldomains[i]; for (i = 0; i < MAXUSERS; i++) { for (sym = domainptr->users[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym); } for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if (tmp1->from_byte > tmp2->from_byte) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sortUsersFrom() { int i, j, max; globuser *sym; int tmp; user *tmp1; user *tmp2; for (i = 0; i < MAXUSERS; i++) for (sym = globusers[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym->u); for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if (tmp1->from_cnt > tmp2->from_cnt) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sortUsersTo() { int i, j, max; globuser *sym; int tmp; user *tmp1; user *tmp2; for (i = 0; i < MAXUSERS; i++) for (sym = globusers[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym->u); for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if (tmp1->to_cnt > tmp2->to_cnt) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sortUsersTotal() { int i, j, max; globuser *sym; int tmp; user *tmp1; user *tmp2; for (i = 0; i < MAXUSERS; i++) for (sym = globusers[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym->u); for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if ((tmp1->to_cnt + tmp1->from_cnt) > (tmp2->to_cnt + tmp2->from_cnt)) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sortUsersByte() { int i, j, max; globuser *sym; int tmp; user *tmp1; user *tmp2; for (i = 0; i < MAXUSERS; i++) for (sym = globusers[i]; sym != NULL; sym = sym->next) addUserToSortTab(sym->u); for (i = 0; i < SortDomain.nval; i++) { max = i; for (j = i+1; j <= SortDomain.nval - 1; j++) { tmp1 = (user *)(SortDomain.allusers[j]); tmp2 = (user *)(SortDomain.allusers[max]); if (tmp1 != NULL && tmp2 != NULL) if (tmp1->from_byte > tmp2->from_byte) max = j; } tmp = SortDomain.allusers[i]; SortDomain.allusers[i] = SortDomain.allusers[max]; SortDomain.allusers[max] = tmp; } } void sumTotalStats() { globuser *s; int i; general.from_cnt = 0; general.to_cnt = 0; general.from_byte = 0; for (i = 0 ; i < MAXUSERS; i++) for (s = globusers[i]; s != NULL; s = s->next) { general.from_cnt += s->u->from_cnt; general.to_cnt += s->u->to_cnt; general.from_byte += s->u->from_byte; } } void sortDomainsFrom() { domain tmp; int i, j, max; for (i = 0; i < DomainsTab.nval; i++) { max = i; for (j = i+1; j <= DomainsTab.nval - 1; j++) { if (DomainsTab.alldomains[j].from_cnt > DomainsTab.alldomains[max].from_cnt) max = j; } tmp = DomainsTab.alldomains[i]; DomainsTab.alldomains[i] = DomainsTab.alldomains[max]; DomainsTab.alldomains[max] = tmp; } } void sortDomainsTo() { domain tmp; int i, j, max; for (i = 0; i < DomainsTab.nval; i++) { max = i; for (j = i+1; j <= DomainsTab.nval - 1; j++) { if (DomainsTab.alldomains[j].to_cnt > DomainsTab.alldomains[max].to_cnt) max = j; } tmp = DomainsTab.alldomains[i]; DomainsTab.alldomains[i] = DomainsTab.alldomains[max]; DomainsTab.alldomains[max] = tmp; } } void sortDomainsTotal() { domain tmp; int i, j, max; for (i = 0; i < DomainsTab.nval; i++) { max = i; for (j = i+1; j <= DomainsTab.nval - 1; j++) { if ((DomainsTab.alldomains[j].from_cnt + DomainsTab.alldomains[j].to_cnt) > (DomainsTab.alldomains[max].from_cnt + DomainsTab.alldomains[max].to_cnt)) max = j; } tmp = DomainsTab.alldomains[i]; DomainsTab.alldomains[i] = DomainsTab.alldomains[max]; DomainsTab.alldomains[max] = tmp; } } void sortDomainsByte() { domain tmp; int i, j, max; for (i = 0; i < DomainsTab.nval; i++) { max = i; for (j = i+1; j <= DomainsTab.nval - 1; j++) { if (DomainsTab.alldomains[j].from_byte > DomainsTab.alldomains[max].from_byte) max = j; } tmp = DomainsTab.alldomains[i]; DomainsTab.alldomains[i] = DomainsTab.alldomains[max]; DomainsTab.alldomains[max] = tmp; } } void printDomains() { int i; if (DomainsTab.alldomains[0].domain == NULL) return; for (i = 0; i < DomainsTab.nval; i++) printf("Domain: %s, From: %d, To: %d, Byte: %ld\n", DomainsTab.alldomains[i].domain, DomainsTab.alldomains[i].from_cnt, DomainsTab.alldomains[i].to_cnt, DomainsTab.alldomains[i].from_byte); } void printAllUsers() { /* int i; if (UsersTab.allusers == NULL) return; for (i = 0; i < UsersTab.nval; i++) printf("User: %s, From: %d, To: %d, Byte: %ld\n", ((user *)UsersTab.allusers[i])->user, ((user *)UsersTab.allusers[i])->from_cnt, ((user *)UsersTab.allusers[i])->to_cnt, ((user *)UsersTab.allusers[i])->from_byte); */ } void printDomainUsers(char *domain) { int tmpnval; int i; user *p; tmpnval = -1; for (i = 0; i < DomainsTab.nval; i++) if (strncmp(DomainsTab.alldomains[i].domain, domain, DOMAINSIZ) == 0) { tmpnval = i; break; } if (tmpnval == -1) return; printf("Domain Index: %d\n", tmpnval); for (i = 0; i < MAXUSERS; i++) { for (p = DomainsTab.alldomains[tmpnval].users[i]; p != NULL; p = p->next) printf("User: %s, From: %d, To: %d, Bytes: %ld\n", p->user, p->from_cnt, p->to_cnt, p->from_byte); } } void printSortDomain() { int i; for (i = 0; i < SortDomain.nval; i++) printf("User: %s, From: %d, To: %d, Byte: %ld\n", ((user *)SortDomain.allusers[i])->user, ((user *)SortDomain.allusers[i])->from_cnt, ((user *)SortDomain.allusers[i])->to_cnt, ((user *)SortDomain.allusers[i])->from_byte); } isoqlog-devel/isoqlog/Data.h0100644000175000000000000000360507617675536015363 0ustar muratwheel#ifndef DATA_H #define DATA_H enum { DOMAINSIZ = 128, USERSIZ = 256, MAXUSERS = 5000, MAXDOMAIN = 50, NVINIT = 1, NVGROW = 2, MULTIPLIER = 31, FROM_MAIL = 100, TO_MAIL = 101 }; enum { ERR_OVER_QUOTA = 0, ERR_NO_MAILBOX = 1, ERR_UNABLETO_CHDIR = 2, ERR_SMTPCONN_FAILED = 3 }; /* Common Errors */ int errors[10]; typedef struct domain { char domain[DOMAINSIZ]; int from_cnt; int to_cnt; double from_byte; struct user *users[MAXUSERS]; } domain; typedef struct user { char user[USERSIZ]; int from_cnt; int to_cnt; double from_byte; struct user *next; } user; typedef struct globuser { user * u; struct globuser * next; } globuser; domain *domains[MAXDOMAIN]; globuser * globusers[MAXUSERS]; /* Total Stats - Mail Server Stats */ domain general; int addDomain(char *); int addUserToSortTab(user *); void checkUser(char *, char *, int, double); void checkUserInGeneral(char *, int, double); void checkUserPtrInGeneral(user *); void processIncomingMail(char *, char *, int, double); void processOutgoingMail(char *, char *, int); void freeSortDomainTab(); /* After all, calculate total sent, received mails and total * sent mail size */ void sumTotalStats(); /* "Selection" Sorts */ void sortDomainUsersFrom(char *); void sortDomainUsersTo(char *); void sortDomainUsersByte(char *); void sortDomainUsersTotal(char *); void sortDomainsFrom(); void sortDomainsTo(); void sortDomainsByte(); void sortDomainsTotal(); void sortUsersFrom(); void sortUsersTo(); void sortUsersByte(); void sortUsersTotal(); /* Output */ void printDomains(); void printAllUsers(); void printDomainUsers(char *); void printSortDomain(); /* hash function */ unsigned int hash(char *); struct DomainsTab { int nval; int max; domain *alldomains; } DomainsTab; struct UsersTab { int nval; int max; int *allusers; } UsersTab; struct SortDomain { int nval; int max; int *allusers; } SortDomain; #endif isoqlog-devel/isoqlog/Dir.c0100644000175000000000000001050110035570025015163 0ustar muratwheel#include #include #include #include #include #include #include #include #include "Dir.h" #include "Parser.h" extern int debug; extern int cur_year, cur_month, cur_day; extern char logstore[128]; /*open qmail-send log directory for qmail multilog format */ void openlogdir(char *logdir) { DIR *dp = NULL; struct dirent *dirp = NULL; int fdate, ffirst = 0, state = 0; char fname[128]; char *current = NULL; if ((dp = opendir(logdir)) == NULL) { printf("Can't open %s dir\n", logdir); exit(-1); } printf("Current %d-%d-%d\n", cur_year, cur_month, cur_day); /* we will call readdir twice, first is to find today's "first created file" * Second is to find all other files that belong to today excep first created file * we must find today's first created files, because this file may contains last day's log info and today * so we should not process last day's log */ while((dirp = readdir(dp)) != NULL) { /* we are opening directory to find today's first created file */ if ((dirp->d_name[0] == '@')) { if ((timeconvert(dirp->d_name, 128, cur_year, cur_month, cur_day, &fdate)) > 0 ) { printf("today file: %.128s ", dirp->d_name); printf("date %d : \n", fdate); if(state == 0) { ffirst = fdate; strncpy(fname, dirp->d_name, 128); state = 1; } else if(fdate < ffirst) { ffirst = fdate; strncpy(fname, dirp->d_name, 128); } } } } if ((chdir(logdir)) == -1) { fprintf(stderr, "chdir %s\n", strerror(errno)); exit(-1); } rewinddir(dp); /* rewind directory to read again all files */ while((dirp = readdir(dp)) != NULL) { if (dirp->d_name[0] == '@'){ if ((timeconvert(dirp->d_name, 128, cur_year, cur_month, cur_day, &fdate)) > 0 ) { if ((strncmp(fname, dirp->d_name, 128)) != 0) /* if this file is not our firts created file*/ readQmailLogFile(dirp->d_name); /* these files are between first create file and current */ } } } closedir(dp); if (ffirst != 0) /* if we have an file today*/ readSpecialLogFile(fname, cur_year, cur_month, cur_day); current = (char *)malloc((strlen(logstore) + 10) * sizeof(char)); sprintf(current, "%s/current", logstore); readSpecialLogFile(current, cur_year, cur_month, cur_day); } /*to convert multilog log format to human readable format */ int timeconvert(char *p, int plen, int year, int month, int day, int *fdate) { int c; unsigned long nanosecs; unsigned long u; time_t secs = 0; struct tm *t; p++; while (((c = *p++) != ' ') && (c != '.') && (--plen > 0)) { u = c - '0'; if (u >= 10) { u = c - 'a'; if (u >= 6) break; u += 10; } secs <<= 4; secs += nanosecs >> 28; nanosecs &= 0xfffffff; nanosecs <<= 4; nanosecs += u; } secs -= 4611686018427387914ULL; t = localtime(&secs); if ((year == (t->tm_year +1900)) && (month == (t->tm_mon + 1)) && (day == t->tm_mday )) { /* if this file belongs to today, convert to it's created hour, * minute to second and sum all of them */ /* therefore we can find the first created file in today */ *fdate = t->tm_hour * 3600 + t->tm_min * 60 + t->tm_sec; return 1; } else return -1; } void readSpecialLogFile(char *fn, int year, int month, int day) { FILE *fp = NULL; char buf[1024]; int i = 0; if ((fp = fopen(fn, "r")) == NULL) { fprintf(stderr, "open file: %s %s\n", fn, strerror(errno)); exit(-1); } while ((fgets(buf, 1024, fp)) != NULL) if ((timeconvert(buf, 1024, year, month, day, &i)) > 0) { if ((strstr(buf, " from ")) != NULL) parseQmailFromBytesLine(buf, strlen(buf)); else if ((strstr(buf, " to remote")) != NULL) parseQmailToRemoteLine(buf, strlen(buf)); else if ((strstr(buf, " to local")) != NULL) parseQmailToLocalLine(buf, strlen(buf)); } fclose(fp); } void createdir(char *dir) { struct stat statbuf; if ((stat(dir, &statbuf)) == 0) { if (S_ISDIR(statbuf.st_mode) == 0) { /* if it is not a directory */ printf("dir: %s must be a directory\n", dir); exit(-1); } } else { if (errno == ENOENT) { /* if dir is not exists */ if((mkdir(dir, DIR_MODE)) != 0){ /* try to create it */ fprintf(stderr, "Can't create directory : %s : %s\n", dir, strerror(errno)); exit(-1); } printf ("The Created directory : %s\n", dir); } } } isoqlog-devel/isoqlog/Dir.h0100644000175000000000000000047010035342555015201 0ustar muratwheel#ifndef DIR_H #define DIR_H #include "Global.h" #define DIR_MODE 0755 int cur_year, cur_month, cur_day, cur_hour, cur_min, cur_sec; void openlogdir(char *); int timeconvert(char *, int, int, int, int, int *); void readSpecialLogFile(char *fn, int year, int month, int day); void createdir(char *); #endif isoqlog-devel/isoqlog/LangCfg.c0100644000175000000000000000633610055577733016000 0ustar muratwheel#include "LangCfg.h" #include #include #include #include #include #include #include #include void loadLang(char *langfile) { FILE *fd; char buf[BUFSIZE]; char keyword[KEYSIZE]; char value[VALSIZE]; char *cp1, *cp2; int lenbuf = 0; char *variables[] = { "Invalid", "L_Average", "L_Creationtime", "L_Daily", "L_Day", "L_Domain", "L_Encoding", "L_Mail", "L_Main_Page", "L_Month", "L_Monthly", "L_Number", "L_Received", "L_Receiver", "L_Sender", "L_Sent", "L_Size", "L_Stats", "L_Top", "L_Total", "L_Year", "L_Yearly" }; int i, j, key, line, keyword_nums = sizeof(variables)/sizeof(char *); if ((fd = fopen(langfile, "r")) == NULL) { fprintf(stderr, "loadLang: cannot open language configuration file %s, exiting...\n", langfile); exit(-1); } line = 0; while ((fgets(buf, BUFSIZE, fd)) != NULL) { line++; if (buf[0] == '#') continue; if ((lenbuf = strlen(buf)) <= 1) continue; cp1 = buf; cp2 = keyword; j = 0; while (isspace((int)*cp1) && (cp1 - buf) < lenbuf) cp1++; while (isgraph((int)*cp1) && (*cp1 != '=') && (j++ < KEYSIZE - 1) && (cp1 - buf) < lenbuf) *cp2++ = *cp1++; *cp2 = '\0'; cp2 = value; while ((*cp1 != '\0') && (*cp1 !='\n') && (*cp1 !='=') && (cp1 - buf) < lenbuf) cp1++; cp1++; while (isspace((int)*cp1) && (cp1 - buf) < lenbuf) cp1++; if (*cp1 == '"') cp1++; j = 0; while ((*cp1 != '\0') && (*cp1 !='\n') && (*cp1 !='"') && (j++ < VALSIZE - 1) && (cp1 - buf) < lenbuf) *cp2++ = *cp1++; *cp2-- = '\0'; if (keyword[0] =='\0' || value[0] =='\0') continue; key = 0; for (i = 0; i < keyword_nums; i++) { if ((strcmp(keyword, variables[i])) == 0) { key = i; break; } } switch(key) { case 0: fprintf(stderr, "Illegal Keyword: %s\n", keyword); break; case 1: strncpy(L_Average, value, VALSIZE); break; case 2: strncpy(L_Creationtime, value, VALSIZE); break; case 3: strncpy(L_Daily, value, VALSIZE); break; case 4: strncpy(L_Day, value, VALSIZE); break; case 5: strncpy(L_Domain, value, VALSIZE); break; case 6: strncpy(L_Encoding, value, VALSIZE); break; case 7: strncpy(L_Mail, value, VALSIZE); break; case 8: strncpy(L_Main_Page, value, VALSIZE); break; case 9: strncpy(L_Month, value, VALSIZE); break; case 10: strncpy(L_Monthly, value, VALSIZE); break; case 11: strncpy(L_Number, value, VALSIZE); break; case 12: strncpy(L_Received, value, VALSIZE); break; case 13: strncpy(L_Receiver, value, VALSIZE); break; case 14: strncpy(L_Sender, value, VALSIZE); break; case 15: strncpy(L_Sent, value, VALSIZE); break; case 16: strncpy(L_Size, value, VALSIZE); break; case 17: strncpy(L_Stats, value, VALSIZE); break; case 18: strncpy(L_Top, value, VALSIZE); break; case 19: strncpy(L_Total, value, VALSIZE); break; case 20: strncpy(L_Year, value, VALSIZE); break; case 21: strncpy(L_Yearly, value, VALSIZE); break; } } fclose(fd); /* If Encoding is left blank, default it to iso-8859-1 */ if (strlen(L_Encoding) == 0) strcpy(L_Encoding, "iso-8859-1"); } isoqlog-devel/isoqlog/Html.c0100644000175000000000000020017510055602004015354 0ustar muratwheel#include #include #include #include #include #include #include "Html.h" #include "Data.h" #include "Store.h" #include "LangCfg.h" #include "Dir.h" #include "Global.h" extern char outputdir [VALSIZE]; extern char htmldir [VALSIZE]; extern char language [VALSIZE]; extern int maxsender; extern int maxreceiver; extern int maxtotal; extern int maxbyte; extern char *months[12]; /* language file variables */ extern char L_Average[VALSIZE]; extern char L_Creationtime[VALSIZE]; extern char L_Daily[VALSIZE]; extern char L_Day[VALSIZE]; extern char L_Domain[VALSIZE]; extern char L_Encoding[VALSIZE]; extern char L_Mail[VALSIZE]; extern char L_Main_Page[VALSIZE]; extern char L_Month[VALSIZE]; extern char L_Monthly[VALSIZE]; extern char L_Number[VALSIZE]; extern char L_Receiver[VALSIZE]; extern char L_Received[VALSIZE]; extern char L_Sender[VALSIZE]; extern char L_Sent[VALSIZE]; extern char L_Size[VALSIZE]; extern char L_Stats[VALSIZE]; extern char L_Top[VALSIZE]; extern char L_Total[VALSIZE]; extern char L_Yearly[VALSIZE]; extern char L_Year[VALSIZE]; extern char L_Encoding[VALSIZE]; void addFooter(FILE *fp) { fprintf(fp, "

" "Generated by %s" ", EnderUNIX software development team @Istanbul/Turkey

\n" "

\n" "Valid HTML 4.01!\n" "

\n", VERSION_STRING); } void putMetaTags(FILE *fp) { fprintf(fp, "\n", L_Encoding); } void createHtml() { char *fname; domain *d; int i; fname = (char *)calloc(1024, sizeof(char)); for (i = 0; i < DomainsTab.nval; i++) { d = &DomainsTab.alldomains[i]; snprintf(fname, 1024, "%s/%s/%d/%d/%d.html", outputdir, d->domain, cur_year, cur_month, cur_day); createDailyHtml(fname, d); snprintf(fname, 1024, "%s/%s/%d/%d/", outputdir, d->domain, cur_year, cur_month); createMonthlyHtml(fname, d->domain); snprintf(fname, 1024, "%s/%s/%d/", outputdir, d->domain, cur_year); createYearlyHtml(fname, d->domain); snprintf(fname, 1024, "%s/%s/", outputdir, d->domain); createDomainHtml(fname, d->domain); } /* Generals */ snprintf(fname, 1024, "%s/general/%d/%d/%d.html", outputdir, cur_year, cur_month, cur_day); createGeneralDailyHtml(fname); snprintf(fname, 1024, "%s/general/%d/%d/", outputdir, cur_year, cur_month); createGeneralMonthlyHtml(fname); snprintf(fname, 1024, "%s/%s/%d/", outputdir, "general", cur_year); createGeneralYearlyHtml(fname); snprintf(fname, 1024, "%s/general/", outputdir); createGeneralHtml(fname); snprintf(fname, 1024, "%s/index.html",outputdir); createIndexHtml(fname); free(fname); } void createDailyHtml(char *f, domain *d) { FILE *fp; FILE *tp; int i; user *u; int max; double byte = 0.0; char *tmpstr, *substr, *newstr; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmpstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(512, sizeof(char)); newstr = (char *)calloc(512, sizeof(char)); if ((fp = fopen(f, "w")) == NULL) { fprintf(stderr, "createDailyHtml: cannot create daily html output %s: %s\n", f, strerror(errno)); exit(-1); } snprintf(tmpstr, 1024, "%s/daily.html", htmldir); if ((tp = fopen(tmpstr, "r")) == NULL) { fprintf(stderr, "createDailyHtml: cannot open daily template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 512, "%s", d->domain); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 512, "%s %d, %d %s", months[cur_month - 1], cur_day, cur_year, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 512, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Sender, L_Mail, L_Number); sortDomainUsersFrom(d->domain); max = (SortDomain.nval < maxsender ? SortDomain.nval : maxsender); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if (u->from_cnt == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, u->from_cnt); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%d
\n"); freeSortDomainTab(); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Receiver, L_Mail, L_Number); sortDomainUsersTo(d->domain); max = (SortDomain.nval < maxreceiver ? SortDomain.nval : maxreceiver); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if (u->to_cnt == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, u->to_cnt); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%d
\n"); freeSortDomainTab(); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Size, L_Mail, L_Size); sortDomainUsersByte(d->domain); max = (SortDomain.nval < maxbyte ? SortDomain.nval : maxbyte); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if (u->from_byte == 0) break; getSizeStr(u->from_byte, tmpstr, &byte); fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, byte, tmpstr); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%.2f %s
\n"); freeSortDomainTab(); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxtotal, L_Total, L_Mail, L_Number); sortDomainUsersTotal(d->domain); max = (SortDomain.nval < maxtotal ? SortDomain.nval : maxtotal); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if ((u->to_cnt + u->from_cnt) == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, (u->from_cnt + u->to_cnt)); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%d
\n"); freeSortDomainTab(); }else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } snprintf(tmpstr, 1024, "%s/%s/%d/%d/AllDays", outputdir, d->domain, cur_year, cur_month); storeCurrentDayHistory(tmpstr, d); free(tmpstr); free(substr); free(newstr); fclose(fp); } /* Listed Days */ void createMonthlyHtml(char *d, char *dmn) { FILE *fp, *tp; char *tmp, *tmpstr, *newstr, *substr; int i; double byte = 0.0, t_b = 0.0; int t_s, t_r; int c = 0; /* counter for days to calculate average*/ hist h[MAXDAYS]; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmp = (char *)calloc(1024, sizeof(char)); tmpstr = (char *)calloc(1024, sizeof(char)); newstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(1024, sizeof(char)); t_s = t_r = 0; snprintf(tmp, 1024, "%s/index.html", d); if ((fp = fopen(tmp, "w")) == NULL) { fprintf(stderr, "createMonthlyHtml: cannot create months file %s: %s\n", tmp, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/monthly.html", htmldir); if ((tp = fopen(tmp, "r")) == NULL) { fprintf(stderr, "createDailyHtml: cannot open days template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/AllDays", d); getHistData(tmp, h, sizeof(h)); while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s", dmn); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s, %d %s", months[cur_month - 1], cur_year, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, ""); fprintf(fp, "" "" "" "" "" "" "\n", L_Day, L_Sent, L_Received, L_Total, L_Size ); for (i = 0; i < MAXDAYS; i++) { if ((h[i].sent + h[i].received) == 0) continue; getSizeStr(h[i].bytes_sent, tmpstr, &byte); t_s += h[i].sent; t_r += h[i].received; t_b += h[i].bytes_sent; c++; fprintf(fp, "" "" "" "" "" "" "\n", i + 1, i + 1, h[i].sent, h[i].received, (h[i].sent + h[i].received), byte, tmpstr); } memset(tmpstr, 0, 1024); getSizeStr(t_b, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n", L_Total, t_s, t_r, t_s + t_r, byte, tmpstr); if (c == 0) c = 1; getSizeStr(t_b/c, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n", L_Average, t_s/c, t_r/c, (t_s + t_r)/c, byte, tmpstr); fprintf(fp, "
%s%s%s%s%s
" "%d%d%d%d%.2f %s
%d%d%d%.2f %s
%d%d%d%.2f %s
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); }else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } snprintf(tmpstr, 1024, "%s/%s/%d/AllMonths", outputdir, dmn, cur_year); /* storeCurrentMonthHistory(tmpstr, t_s, t_r, byte); */ storeCurrentMonthHistory(tmpstr, t_s, t_r, t_b); free(tmp); free(tmpstr); free(substr); free(newstr); fclose(fp); fclose(tp); } /* Listed Months */ void createYearlyHtml(char *d, char *dmn) { FILE *fp, *tp; char *tmp, *tmpstr, *newstr, *substr; int i; int t_s, t_r; int c = 0; /* average counter */ double byte = 0.0, t_b = 0.0; hist h[MAXMONTHS]; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmp = (char *)calloc(1024, sizeof(char)); tmpstr = (char *)calloc(1024, sizeof(char)); newstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(1024, sizeof(char)); t_s = t_r = 0; snprintf(tmp, 1024, "%s/index.html", d); if ((fp = fopen(tmp, "w")) == NULL) { fprintf(stderr, "createYearlyHtml: cannot create months file %s: %s\n", tmp, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/yearly.html", htmldir); if ((tp = fopen(tmp, "r")) == NULL) { fprintf(stderr, "createYearHtml: cannot open daily template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/AllMonths", d); getHistData(tmp, h, sizeof(h)); while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s", dmn); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%d %s", cur_year, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, ""); fprintf(fp, "" "" "" "" "" "" "\n", L_Month, L_Sent, L_Received, L_Total, L_Size ); for (i = 0; i < MAXMONTHS; i++) { if ((h[i].sent + h[i].received) == 0) continue; getSizeStr(h[i].bytes_sent, tmpstr, &byte); t_s += h[i].sent; t_r += h[i].received; t_b += h[i].bytes_sent; c++; fprintf(fp, "" "" "" "" "" "" "\n", i + 1, i + 1, h[i].sent, h[i].received, (h[i].sent + h[i].received), byte, tmpstr); } memset(tmpstr, 0, 1024); getSizeStr(t_b, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n", L_Total, t_s, t_r, t_s + t_r, byte, tmpstr); if (c == 0) /* do not divide zero */ c = 1; getSizeStr(t_b/c, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n", L_Average, t_s/c, t_r/c, (t_s + t_r)/c, byte, tmpstr); fprintf(fp, "
%s%s%s%s%s
" "%d" "%d%d%d%.2f %s
%d%d%d%.2f %s
%d%d%d%.2f %s
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } snprintf(tmpstr, 1024, "%s/%s/AllYears", outputdir, dmn); storeCurrentYearHistory(tmpstr, t_s, t_r, t_b); free(tmp); free(tmpstr); free(substr); free(newstr); fclose(fp); fclose(tp); } /* Listed Years */ void createDomainHtml(char *d, char *dmn) { FILE *fp, *tp; char *tmp, *tmpstr, *newstr, *substr; int i; int t_s, t_r; double byte = 0.0, t_b = 0.0; int c = 0; /* average counter */ hist h[MAXYEARS]; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmp = (char *)calloc(1024, sizeof(char)); tmpstr = (char *)calloc(1024, sizeof(char)); newstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(1024, sizeof(char)); t_s = t_r = 0; snprintf(tmp, 1024, "%s/index.html", d); if ((fp = fopen(tmp, "w")) == NULL) { fprintf(stderr, "createDomainHtml: cannot create months file %s: %s\n", tmp, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/domain.html", htmldir); if ((tp = fopen(tmp, "r")) == NULL) { fprintf(stderr, "createDomainHtml: cannot open daily template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/AllYears", d); getHistData(tmp, h, sizeof(h)); while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s", dmn); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s %s", L_Yearly, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "%d -> %d -> %d ", cur_year, cur_month, cur_day, cur_year, cur_month, cur_day); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, ""); fprintf(fp, "" "" "" "" "" "" "\n", L_Year, L_Sent, L_Received, L_Total, L_Size); for (i = 0; i < MAXYEARS; i++) { if ((h[i].sent + h[i].received) == 0) continue; getSizeStr(h[i].bytes_sent, tmpstr, &byte); t_s += h[i].sent; t_r += h[i].received; t_b += h[i].bytes_sent; c++; fprintf(fp, "" "" "" "" "" "" "\n", i + 2002, i + 2002, h[i].sent, h[i].received, (h[i].sent + h[i].received), byte, tmpstr); } memset(tmpstr, 0, 1024); getSizeStr(t_b, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n", L_Total, t_s, t_r, t_s + t_r, byte, tmpstr); if (c == 0) c = 1; getSizeStr(t_b/c, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n", L_Average, t_s/c, t_r/c, (t_s + t_r)/c, byte, tmpstr); fprintf(fp, "
%s%s%s%s%s
" "%d" "%d%d%d%.2f %s
%d%d%d%.2f %s
%d%d%d%.2f %s
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } free(tmp); free(tmpstr); free(substr); free(newstr); fclose(fp); fclose(tp); } /* creates daily statics generaly, /isolog/general/year/month/day.html */ void createGeneralDailyHtml(char *f) { FILE *fp; FILE *tp; double byte = 0.0 ; int i; user *u; domain *d; int max; char *tmpstr, *substr, *newstr; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmpstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(512, sizeof(char)); newstr = (char *)calloc(512, sizeof(char)); if ((fp = fopen(f, "w")) == NULL) { fprintf(stderr, "createGeneralDailyHtml: cannot create daily html output %s: %s\n", f, strerror(errno)); exit(-1); } snprintf(tmpstr, 1024, "%s/generaldaily.html", htmldir); if ((tp = fopen(tmpstr, "r")) == NULL) { fprintf(stderr, "createGeneralDailyHtml: cannot open daily template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 512, "%s", "General"); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 512, "%s %d, %d %s", months[cur_month - 1], cur_day, cur_year, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 512, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Sender, L_Domain, L_Mail, L_Number); sortDomainsFrom(); max = (DomainsTab.nval < maxsender ? DomainsTab.nval : maxsender); for (i = 0; i < max; i++) { d = &(DomainsTab.alldomains[i]); if (d->from_cnt == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, d->domain, d->from_cnt); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s %s
 %s%s
%d%s%d
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "",L_Top, maxsender, L_Receiver, L_Domain, L_Mail, L_Number); sortDomainsTo(); max = (DomainsTab.nval < maxreceiver ? DomainsTab.nval : maxreceiver); for (i = 0; i < max; i++) { d = &(DomainsTab.alldomains[i]); if (d->to_cnt == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, d->domain, d->to_cnt); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s %s
 %s%s
%d%s%d
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Domain, L_Size, L_Mail, L_Size); sortDomainsByte(); max = (DomainsTab.nval < maxbyte ? DomainsTab.nval : maxbyte); for (i = 0; i < max; i++) { d = &(DomainsTab.alldomains[i]); if (d->from_byte == 0) break; getSizeStr(d->from_byte, tmpstr, &byte); fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, d->domain, byte, tmpstr); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s (%s)
 %s%s
%d%s%.2f %s
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxtotal, L_Domain, L_Total, L_Mail, L_Number); sortDomainsTotal(); max = (DomainsTab.nval < maxtotal ? DomainsTab.nval : maxtotal); for (i = 0; i < max; i++) { d = &(DomainsTab.alldomains[i]); if ((d->to_cnt + d->from_cnt) == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, d->domain, (d->from_cnt + d->to_cnt)); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s (%s)
 %s%s
%d%s%d
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Sender, L_Mail, L_Number); sortUsersFrom(); max = (SortDomain.nval < maxsender ? SortDomain.nval : maxsender); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if (u->from_cnt == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, u->from_cnt); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%d
\n"); freeSortDomainTab(); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Receiver, L_Mail, L_Number); sortUsersTo(); max = (SortDomain.nval < maxreceiver ? SortDomain.nval : maxreceiver); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if (u->to_cnt == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, u->to_cnt); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%d
\n"); freeSortDomainTab(); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxsender, L_Size, L_Mail, L_Size); sortUsersByte(); max = (SortDomain.nval < maxbyte ? SortDomain.nval : maxbyte); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if (u->from_byte == 0) break; getSizeStr(u->from_byte, tmpstr, &byte); fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, byte, tmpstr); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%.2f %s
\n"); freeSortDomainTab(); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "" "" "\n" "" "\n" "\n" "\n" "\n" "", L_Top, maxtotal, L_Total, L_Mail, L_Number); sortUsersTotal(); max = (SortDomain.nval < maxtotal ? SortDomain.nval : maxtotal); for (i = 0; i < max; i++) { u = (user *)SortDomain.allusers[i]; if ((u->to_cnt + u->from_cnt) == 0) break; fprintf(fp, ""); fprintf(fp, "\n" "\n" "\n", i + 1, u->user, (u->from_cnt + u->to_cnt)); fprintf(fp, "\n"); } fprintf(fp, "
%s %d %s
 %s%s
%d%s%d
\n"); freeSortDomainTab(); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } snprintf(tmpstr, 1024, "%s/general/%d/%d/AllDays", outputdir, cur_year, cur_month); /*sumTotalStats(); */ storeCurrentDayHistory(tmpstr, &general); free(tmpstr); free(substr); free(newstr); fclose(fp); } void createGeneralMonthlyHtml(char *d) { FILE *fp, *tp; char *tmp, *tmpstr, *newstr, *substr; int i; int t_s = 0, t_r = 0; int c = 0; /* average counter */ double byte = 0.0, t_b = 0.0; hist h[MAXDAYS]; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmp = (char *)calloc(1024, sizeof(char)); tmpstr = (char *)calloc(1024, sizeof(char)); newstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(1024, sizeof(char)); snprintf(tmp, 1024, "%s/index.html", d); if ((fp = fopen(tmp, "w")) == NULL) { fprintf(stderr, "createGeneralMonthlyHtml: cannot create months file %s: %s\n", tmp, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/generalmonthly.html", htmldir); if ((tp = fopen(tmp, "r")) == NULL) { fprintf(stderr, "createGeneralMonthlyHtml: cannot open monthly template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/AllDays", d); getHistData(tmp, h, sizeof(h)); while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); sprintf(newstr, "%s", "general"); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s, %d %s", months[cur_month - 1], cur_year, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, ""); fprintf(fp, "" "" "" "" "" "" "\n", L_Day, L_Sent, L_Received, L_Total, L_Size); for (i = 0; i < MAXDAYS; i++) { if ((h[i].sent + h[i].received) == 0) continue; getSizeStr(h[i].bytes_sent, tmpstr, &byte); t_s += h[i].sent; t_r += h[i].received; t_b += h[i].bytes_sent; c++; fprintf(fp, "" "" "" "" "" "" "\n", i + 1, i + 1, h[i].sent, h[i].received, (h[i].sent + h[i].received), byte, tmpstr); } memset(tmpstr, 0, 1024); getSizeStr(t_b, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n",L_Total, t_s, t_r, t_s + t_r, byte, tmpstr); if (c == 0) /* Do not divide to zero! */ c = 1; getSizeStr(t_b/c, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n",L_Average, t_s/c, t_r/c, (t_s + t_r)/c, byte, tmpstr); fprintf(fp, "
%s%s%s%s%s
" "%d%d%d%d%.2f %s
%d%d%d%.2f %s
%d%d%d%.2f %s
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } snprintf(tmpstr, 1024, "%s/general/%d/AllMonths", outputdir, cur_year); /* storeCurrentMonthHistory(tmpstr, t_s, t_r, t_b); */ storeCurrentMonthHistory(tmpstr, t_s, t_r, t_b); free(tmp); free(tmpstr); free(substr); free(newstr); fclose(fp); fclose(tp); } void createGeneralYearlyHtml(char *d) { FILE *fp, *tp; char *tmp, *tmpstr, *newstr, *substr; int i, c = 0; int t_s, t_r; double byte = 0.0, t_b = 0.0; hist h[MAXMONTHS]; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmp = (char *)calloc(1024, sizeof(char)); tmpstr = (char *)calloc(1024, sizeof(char)); newstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(1024, sizeof(char)); t_s = t_r = 0; snprintf(tmp, 1024, "%s/index.html", d); if ((fp = fopen(tmp, "w")) == NULL) { fprintf(stderr, "createGeneralYearlyHtml: cannot create months file %s: %s\n", tmp, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/generalyearly.html", htmldir); if ((tp = fopen(tmp, "r")) == NULL) { fprintf(stderr, "createGeneralYearlyHtml: cannot open monthly template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/AllMonths", d); getHistData(tmp, h, sizeof(h)); while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); sprintf(newstr, "%s", "general"); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s, %d %s", months[cur_month - 1], cur_year, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, ""); fprintf(fp, "" "" "" "" "" "" "\n", L_Month, L_Sent, L_Received, L_Total, L_Size); for (i = 0; i < MAXMONTHS; i++) { if ((h[i].sent + h[i].received) == 0) continue; getSizeStr(h[i].bytes_sent, tmpstr, &byte); t_s += h[i].sent; t_r += h[i].received; t_b += h[i].bytes_sent; c++; fprintf(fp, "" "" "" "" "" "" "\n", i + 1, i + 1, h[i].sent, h[i].received, (h[i].sent + h[i].received), byte, tmpstr); } memset(tmpstr, 0, 1024); getSizeStr(t_b, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n",L_Total, t_s, t_r, t_s + t_r, byte, tmpstr); if (c == 0) /* Do not divide to zero! */ c = 1; getSizeStr(t_b/c, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n", L_Average, t_s/c, t_r/c, (t_s + t_r)/c, byte, tmpstr); fprintf(fp, "
%s%s%s %s%s
" "%d%d%d%d%.2f %s
%d%d%d%.2f %s
%d%d%d%.2f %s
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } snprintf(tmpstr, 1024, "%s/general/AllYears", outputdir); storeCurrentYearHistory(tmpstr, t_s, t_r, t_b); free(tmp); free(tmpstr); free(substr); free(newstr); fclose(fp); fclose(tp); } void createGeneralHtml(char *d) { FILE *fp, *tp; char *tmp, *tmpstr, *newstr, *substr; int i, c = 0; int t_s = 0, t_r = 0; double byte = 0.0, t_b = 0.0; hist h[MAXYEARS]; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmp = (char *)calloc(1024, sizeof(char)); tmpstr = (char *)calloc(1024, sizeof(char)); newstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(1024, sizeof(char)); snprintf(tmp, 1024, "%s/index.html", d); if ((fp = fopen(tmp, "w")) == NULL) { fprintf(stderr, "createGeneralHtml: cannot create general output file %s: %s\n", tmp, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/generaldomain.html", htmldir); if ((tp = fopen(tmp, "r")) == NULL) { fprintf(stderr, "createGeneralHtml: cannot open general template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } snprintf(tmp, 1024, "%s/AllYears", d); getHistData(tmp, h, sizeof(h)); while(fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, "%d -> %d -> %d ", cur_year, cur_month, cur_day, cur_year, cur_month, cur_day); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); sprintf(newstr, "%s", "general"); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, "%s %s", L_Yearly, L_Stats); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 1024, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fprintf(fp, ""); fprintf(fp, "" "" "" "" "" "" "\n",L_Year, L_Sent, L_Received, L_Total, L_Size); for (i = 0; i < MAXYEARS; i++) { if ((h[i].sent + h[i].received) == 0) continue; getSizeStr(h[i].bytes_sent, tmpstr, &byte); t_s += h[i].sent; t_r += h[i].received; t_b += h[i].bytes_sent; c++; fprintf(fp, "" "" "" "" "" "" "\n", i + 2002, i + 2002, h[i].sent, h[i].received, (h[i].sent + h[i].received), byte, tmpstr); } memset(tmpstr, 0, 1024); getSizeStr(t_b, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n",L_Total, t_s, t_r, t_s + t_r, byte, tmpstr); if (c == 0) c = 1; getSizeStr(t_b/c, tmpstr, &byte); fprintf(fp, "" "" "" "" "" "\n",L_Average, t_s/c, t_r/c, (t_s + t_r)/c, byte, tmpstr); fprintf(fp, "
%s%s%s%s%s
" "%d%d%d%d%.2f %s
%d%d%d%.2f %s
%d%d%d%.2f %s
\n"); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); memset(tmpstr, 0, 1024); } free(tmp); free(tmpstr); free(substr); free(newstr); fclose(fp); fclose(tp); } void getSizeStr(double b, char *s, double *v) { char *bytestrs[] = { "bytes", "KBytes", "MBytes", "GBytes"}; if (b > 1073741824) { strcpy(s, bytestrs[3]); *v = b / 1073741824; } else if (b > 1048576) { strcpy(s, bytestrs[2]); *v = b / 1048576; } else if (b > 1024) { strcpy(s, bytestrs[1]); *v = b / 1024; } else { strcpy(s, bytestrs[0]); *v = b; } } void createIndexHtml(char *f) { FILE *tp; FILE *fp; int i; char *tmpstr, *substr, *newstr; char *tfmt[2] = { "%s: %s %d, %d / %d:0%d", "%s: %s %d, %d / %d:%d" }; tmpstr = (char *)calloc(1024, sizeof(char)); substr = (char *)calloc(512, sizeof(char)); newstr = (char *)calloc(512, sizeof(char)); if ((fp = fopen(f, "w")) == NULL) { fprintf(stderr, "createIndexHtml: cannot create index html output %s: %s\n", f, strerror(errno)); exit(-1); } snprintf(tmpstr, 1024, "%s/index.html", htmldir); if ((tp = fopen(tmpstr, "r")) == NULL) { fprintf(stderr, "createIndexHtml: cannot open index template file %s: %s\n", tmpstr, strerror(errno)); exit(-1); } while (fgets(tmpstr, 1024, tp) != NULL) { if((substr = strstr(tmpstr, "")) != NULL) { putMetaTags(fp); } else if ((substr = strstr(tmpstr, "")) != NULL) { /* First write the first part of the string */ fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); /* Then write what we want */ sprintf(newstr, "\n", "isoqlog Team and codepoets.org"); fwrite(newstr, sizeof(char), strlen(newstr), fp); /* Skip the comment and continue from the "tmpstr" */ fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); sprintf(newstr, "\n
\n
\n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, "\n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); snprintf(newstr, 512, " \n", L_Domain); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, "
 %s
 
\n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr,"\n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); for (i = 0; i < DomainsTab.nval; i++) { sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); snprintf(newstr, 512, " \n", DomainsTab.alldomains[i].domain, DomainsTab.alldomains[i].domain); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); } /* for general */ sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, " \n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); sprintf(newstr, "
 %s
  General
\n"); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); sprintf(newstr, "Log Analysis for All MTA. (For the present Qmail, Postfix, Sendmail, Exim.)"); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { fwrite(tmpstr, sizeof(char), (strlen(tmpstr) - strlen(substr)), fp); snprintf(newstr, 512, tfmt[(cur_min > 9 ? 1 : 0)], L_Creationtime, months[cur_month - 1], cur_day, cur_year, cur_hour, cur_min); fwrite(newstr, sizeof(char), strlen(newstr), fp); fwrite(substr + 9, sizeof(char), strlen(substr) - 9, fp); memset(substr, 0, 512); memset(newstr, 0, 512); } else if ((substr = strstr(tmpstr, "")) != NULL) { addFooter(fp); } else fwrite(tmpstr, sizeof(char), strlen(tmpstr), fp); } memset(tmpstr, 0, 1024); free(tmpstr); free(substr); free(newstr); } isoqlog-devel/isoqlog/Html.h0100644000175000000000000000100307746231405015366 0ustar muratwheel#ifndef HTML_H #define HTML_H #include "Data.h" void addFooter(FILE *fp); void putMetaTags(FILE *fp); void createHtml(); void createIndexHtml(char *); void createDailyHtml(char *, domain *); void createMonthlyHtml(char *, char *); void createYearlyHtml(char *, char *); void createDomainHtml(char *, char *); void createGeneralDailyHtml(char *); void createGeneralMonthlyHtml(char *); void createGeneralYearlyHtml(char *); void createGeneralHtml(char *); void getSizeStr(double, char *, double *); #endif isoqlog-devel/isoqlog/htmltemp/0040755000175000000000000000000010055616055016147 5ustar muratwheelisoqlog-devel/isoqlog/htmltemp/images/0040755000175000000000000000000010055616055017414 5ustar muratwheelisoqlog-devel/isoqlog/htmltemp/images/Makefile.am0100644000175000000000000000213107742730631021450 0ustar muratwheel EXTRA_DIST = dot.gif home.gif isoqlog.gif pk.gif up.gif install-data-local: $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/images/ $(INSTALL_DATA) $(srcdir)/dot.gif /usr/local/share/isoqlog/htmltemp/images/dot.gif $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/images/ $(INSTALL_DATA) $(srcdir)/home.gif /usr/local/share/isoqlog/htmltemp/images/home.gif $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/images/ $(INSTALL_DATA) $(srcdir)/isoqlog.gif /usr/local/share/isoqlog/htmltemp/images/isoqlog.gif $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/images/ $(INSTALL_DATA) $(srcdir)/pk.gif /usr/local/share/isoqlog/htmltemp/images/pk.gif $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/images/ $(INSTALL_DATA) $(srcdir)/up.gif /usr/local/share/isoqlog/htmltemp/images/up.gif uninstall-local: -rm -f /usr/local/share/isoqlog/htmltemp/images/dot.gif -rm -f /usr/local/share/isoqlog/htmltemp/images/home.gif -rm -f /usr/local/share/isoqlog/htmltemp/images/isoqlog.gif -rm -f /usr/local/share/isoqlog/htmltemp/images/pk.gif -rm -f /usr/local/share/isoqlog/htmltemp/images/up.gif isoqlog-devel/isoqlog/htmltemp/images/dot.gif0100644000175000000000000000006507617675536020712 0ustar muratwheelGIF89a¢ÿÿÿÿÿÿÿÿÿÿÿÿÿ,x ;isoqlog-devel/isoqlog/htmltemp/images/home.gif0100644000175000000000000000140207617675536021050 0ustar muratwheelGIF89aæÿÿÏšÿÍ™ÿÒŸýÇ”ÿÔœÿØœÿÔ¡ÿÍšÿ˘ÿ×¢ÿÚ¡ÿÖœÊ\(Ë`,þÉ–ÿÒ›ÿÕœÿКýþþÿÑ›ý̘ã¼ýÑ—ÿ̘ÿÏœÿØþÊ—Ê])ÉY%Íd0ÿלÎe1ÈX$ÿØ£Ìa-ǨˆÿØ¡ÿÓŸÿÚ¢ÿØžôÅ”ÿÓ ùΘÿÐϬ‰°š…ýÖ™Õ±ŒÿÖ¡É\(ôÅ•ëÀ’ìÁ”ÿÑšÿË™ÿÖ¢2[„Ï®ŒÿÔžÆU!ÇV"ÿÑœÿΛË])>nÀÀÀÿÌ™!ùA,@å€A‚ƒ„…†‡@/$?ŒBBŒ?ŽB@‡A@B Œ1B •‚˜Ÿ– BB9£ˆB“²B ®„˜B%)•˜.»¤@,•@ÎɆ@45““”ʘ7Œ ŽÜŽÎ8ѰçBâϘЗB!?<;B&£¡î¤úû—üÊd8S1"/¬M˜ÐÂà¥:ðáh…ÄØU€ð­‘o@8J “¦ ¼ý‘Rˆw˜˜)ÄrÐe Œ:tº'DTÏLŒ6 „ïh5!'ˆfŒ¶®ªUB;: iÌu1¥U@VÏJT3Y8+T 4_ô0À“§îÌk…Y“N¹tíêÁûU¯Ð¾.×Ís7oÔ™:è¬Q£‡H`ƃï%'íÈ噿 ?–†bH’ ènØ0Ó‰f™hcË»¨Á¸s«pÀƒmnfÄ´;isoqlog-devel/isoqlog/htmltemp/images/isoqlog.gif0100644000175000000000000000520207637631350021563 0ustar muratwheelGIF89a=æÿÿÿÿÿïïÿæÅÿâ½ÿßßÿݰÿÙ¨ÿÏÏÿÀnÿ»»ÿªªÿ¤/ÿššÿŠŠÿvvÿffÿUUÿEEÿ11ÿ!!ÿÿú ôóùïóï!#î #é/1çôàç-1ä:<ÞFHÜîÐÛu¥ÛBHÙQTÕMTÓ^bÎZbÍç½ÍimÈtyÀ…Àᬽz…¼“¸Q†·˜ž·Q†µÜ²£ª°‘ž­®µ­­·«œª©Ö¥¦µšÏzŽÊj‚ÄZv¾Jq‹úg·7aOÔ[²'R@ÆP¬MhÛMgÛC¦3Yø->è,=@ÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜ˆ››™žŸ ¡(=‚¤88=(F„A2?2­¨8;x,i‚ †$,ä°qÅ@š%Oür¥Å2‚X¡ófÉ£_(]Š´)R"DŽ.eZªÓ¦Q¯Ö€jõªÕ©J‘>œ¸(ÂÀƒˆ4P°‚„ƒÿ"+àX †;0™s密€h!(réEŸICJ±YCmÛ¢ ЀBl h x\Ýf Rà-¯ ½Æ íîý»‘Ä­£KŸN½ºõëØ³[z­½»÷Af=ÂÁJŠò‡dt „C¼#õáÉ`ÖGýTöì’Îý»ÿÿ¦ðÐ ”è°€ü•ƒà‚ 6È`‡WAn"çà…§aØ„†HH¡  ô@#xòÜ\‚xxXqAw×`…œ( tÀŠ{)¢˜b¬ÒcbâØeª ÂXe‰ÈÿF6é£e—A&Yk¢"! $!DˆQÐ\¶ 4¢ dX_,²™ã—aŽYfgÐe˜  [.*¤ RöYfƒ>Y¡‡ºÙj…&ȉ†‰Xˆ`@°–pÍAªé¦œvêé§ †**‚UŽê4Úô ë°ÃÏÿÅg¬ñÆwì1'þ2q>/ðñÉ(§¬òÊ,o2(¥‚+óÌÓÅœâYJJóÎÙ À•†ÔÖd:H`¶õ€Ñ‚ ¡@ù¨³rI´ô! Ì 5qovh$•¶$_åmY82Ð…)]ƒT=œ"’æ@k "crS 7ÝfÂg×z÷iÈd–ÍÙ’Ÿ™¶¸âc Ùèâ‡"Z¢ŽvÂÐG> äíf`°Á@‰nò-µ—¥¿ `†ô½Øi‰O¨e‹‚{îƒ\Ž;åN2Žùb‘ß><•grFi¤UE3h0¤BI*tQF%Ù$Ny_ÿøY½ö‰$ÝuTV –Tóo•Õ ò3Õýõo„þ/ØTÀÀ’ðyìßFÌö¨Í¥mYZ[Ѐ $O„àZ¥‚$Ô 5Õµ)ƒ=hˆªdpLDíŽ'(ÎwÆÃa uø'Å5Äg ’'ô7ÁÕgà2€•*!z‚ÐÚÚ€Ä*ZñŠXÌ¢·ØxÑ‹\ £5‘¼1.UŒè€¤ˆk¦B°!‚õÀëÑγƒ Ø£D3^g®d°„ÀƒÈÖÖc„4r>ÁXvÀ  ÿ·H˜)J± L? t€‚G>ËŽ:àA/°AqèX,pO·hÈ3¾ ?€6iH²Ê£E*x@ŒUŒëÀ@P  8ê «úÁ21q Z(ài)\à!¸EÁv©¹^"ça<×#„a‚0—)ôêõ„àŸÒìx žiž€‚eÐ~Ó@:ÚŒhŠ#å§C[ɪ9¬Œî iƒF†’µì¤(M©JSú2Bô&]©LgJÓšÖ£¥ž(¤HwÚ)òô§ªRl ò¡ÿ8¨W¬R–ZÁ…0µˆ:*R«¡ÔÀªVÿõÀ@NpÕ®bÕ«`ýªXÃJÖ±šµ¬5hÁ@<€Ö³ºµ­dE \çJ׺Úõ®%a`;Á¹¶Q© `Z!À¦2@t‡PËR¶E'äRa‹XC(À°}ìÎvä8Pù¬¯‚ÐàÐÏä-m3m[LH¸¦©ösF“ÑP[+CÛ-r>lDñ$S<ÔØ¶g Ðh£uÐuƒ¸SàBk££ÍÉ8€!d[«\: Bƒ7D+€A๎Èí":+¹C™†G¿ ^#ŽÐ[ΊW"ÁíÐp_T¶5‚p@!ävÝÏስį~á$ûžî‚ÿÕâl ¹ åð2…8ÿ Õ«;Ûml»MÍ‚;V­ „«bmÉ@.` U­Xa@\• )«ø8ðUW€­X_LüUŒ$:«qÜÕ¡"GŽ’—|”%3¹)G®A”-¢d!<Ù"Epr „0e#;EË1@Ê‘»Le-‹Å!ŸoÓŽ«´LÁ®u€ꎳºÈ¾Ym0ºsêÑ ó.2Qº¡|<øNÖ’jÂÖÛ":¼éEs|­¤f. 툯k.!ª+gOÀÓ­@v“["‚PñÓˆ[ Eƒ(Ç7ä™ zix9AgèÐE*¯};a½"  MDu 1¸Çmmýl¦íçܧbïÙ‚¨F6ÇPx<œ -ˆ#èúÑ€BÂñü î–›×»ö5°ç« ‚Í["5¦5XD·ÒÝó¦ R'zci¶†Ãv¹o8p܆‘x®‘ÇKBXàNkPf ‚±Þ@zCÕÀ ÀzqˆÓ¸«Ckôf«˜Õ%à€80”¯0¹Ìg~æNš©8Ï9T½«sFÖ°•-„bÀØ©9v±Âž,у®ˆ^{ªØñ)€¤j ½LÛné.Ô»#u£<5‚¸Ö·NöGèùëSËÎö¶»ýípN ;isoqlog-devel/isoqlog/htmltemp/images/pk.gif0100644000175000000000000000036607617675536020542 0ustar muratwheelGIF89a ÄÿÿÿÿùóóôççîÜÜèÍÍâÀÀܵµ×©©ÐššÊŽŽÄ‚‚¿vv¸gg²[[­PP§CC, @{ ŽäHÊ‘€Ðœ04pãÂ$ÈB"±Q#P |¤Ê±À•„„bÐR(ˆ"•ãñØ>È@.8 éú|àµH°`‹C5ø\ * %72 _   l“8 \` | ”"' )l d¦¤%!;isoqlog-devel/isoqlog/htmltemp/images/up.gif0100644000175000000000000000024707617675536020552 0ustar muratwheelGIF89a¢ÿ>nÿÌ™Ë])øéâÀÀÀ!ù,@lHºÜÞ„I‡¸ƒÒȤþ`8QrÝg]¬i#yÛütó7Çdh½º”ªå:-J“SƒÐLÔmJ}ìlU*ÅàOñLþ€¡Ì É*%-:®åmô˜îûÝu^P:cGebYZW… ;isoqlog-devel/isoqlog/htmltemp/Makefile.am0100644000175000000000000000374710040207231020175 0ustar muratwheel SUBDIRS = images library EXTRA_DIST = daily.html domain.html generaldaily.html generaldomain.html generalmonthly.html generalyearly.html index.html monthly.html yearly.html install-data-local: $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/daily.html /usr/local/share/isoqlog/htmltemp/daily.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/domain.html /usr/local/share/isoqlog/htmltemp/domain.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/generaldaily.html /usr/local/share/isoqlog/htmltemp/generaldaily.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/yearly.html /usr/local/share/isoqlog/htmltemp/yearly.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/generaldomain.html /usr/local/share/isoqlog/htmltemp/generaldomain.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/generalmonthly.html /usr/local/share/isoqlog/htmltemp/generalmonthly.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/generalyearly.html /usr/local/share/isoqlog/htmltemp/generalyearly.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/index.html /usr/local/share/isoqlog/htmltemp/index.html $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/ $(INSTALL_DATA) $(srcdir)/monthly.html /usr/local/share/isoqlog/htmltemp/monthly.html uninstall-local: -rm -f /usr/local/share/isoqlog/htmltemp/daily.html -rm -f /usr/local/share/isoqlog/htmltemp/days.html -rm -f /usr/local/share/isoqlog/htmltemp/domain.html -rm -f /usr/local/share/isoqlog/htmltemp/generaldaily.html -rm -f /usr/local/share/isoqlog/htmltemp/generaldomain.html -rm -f /usr/local/share/isoqlog/htmltemp/generalmonthly.html -rm -f /usr/local/share/isoqlog/htmltemp/generalyearly.html -rm -f /usr/local/share/isoqlog/htmltemp/index.html -rm -f /usr/local/share/isoqlog/htmltemp/monthly.html isoqlog-devel/isoqlog/htmltemp/daily.html0100644000175000000000000000224510035547257020144 0ustar muratwheel <!--%s--> <--

dot.gif








home.gif up.gif

isoqlog-devel/isoqlog/htmltemp/domain.html0100644000175000000000000000217607754237332020320 0ustar muratwheel <!--%s-->








isoqlog-devel/isoqlog/htmltemp/generaldaily.html0100644000175000000000000000236710035547257021507 0ustar muratwheel <!--%s--> <--

dot.gif

















home.gif up.gif

isoqlog-devel/isoqlog/htmltemp/generaldomain.html0100644000175000000000000000217607754237332021656 0ustar muratwheel <!--%s-->








isoqlog-devel/isoqlog/htmltemp/generalmonthly.html0100644000175000000000000000221710035547257022071 0ustar muratwheel <!--%s--> <--

dot.gif




home.gif up.gif

isoqlog-devel/isoqlog/htmltemp/generalyearly.html0100644000175000000000000000217510035547257021707 0ustar muratwheel <!--%s-->






isoqlog-devel/isoqlog/htmltemp/index.html0100644000175000000000000000062010035547257020144 0ustar muratwheel Isoqlog MTA Log Analyzer





isoqlog-devel/isoqlog/htmltemp/monthly.html0100644000175000000000000000222010035547257020525 0ustar muratwheel <!--%s--> <--

dot.gif




home.gif up.gif

isoqlog-devel/isoqlog/htmltemp/yearly.html0100644000175000000000000000217510040060165020331 0ustar muratwheel <!--%s-->






isoqlog-devel/isoqlog/htmltemp/library/0040755000175000000000000000000010055616055017613 5ustar muratwheelisoqlog-devel/isoqlog/htmltemp/library/Makefile.am0100644000175000000000000000043407742730631021653 0ustar muratwheel EXTRA_DIST = isoqlog.css install-data-local: $(mkinstalldirs) /usr/local/share/isoqlog/htmltemp/library/ $(INSTALL_DATA) $(srcdir)/isoqlog.css /usr/local/share/isoqlog/htmltemp/library/isoqlog.css uninstall-local: -rm -f /usr/local/share/isoqlog/htmltemp/library/isoqlog.css isoqlog-devel/isoqlog/htmltemp/library/isoqlog.css0100644000175000000000000000252207617675536022023 0ustar muratwheel .table_header { font-family: "Courier New", Courier, mono; font-size: 12pt; font-weight: bold; color: #CC3333; text-decoration: none; background-color: #E9E9E9} .header { font-family: "Times New Roman", Times, serif; font-size: 15pt; color: #336633} .table_data { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000; text-decoration: none} .table_data_mon { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; color: #339966; text-decoration: underline} .table_data_day { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; color: #339966; text-decoration: underline } .table_data_total { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000; text-decoration: none ; font-weight: bold} .table_foother { font-family: "Courier New", Courier, mono; font-size: 12pt; font-weight: bold; color: #CC3333; text-decoration: none; background-color: #E9E9E9 } .table_top_header { font-family: "Courier New", Courier, mono; font-size: 14pt; font-weight: bold; color: #0000CC; text-decoration: none; background-color: #E9E9E9 } .created_date { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: italic; color: #999999} .domains { font-family: Georgia, "Times New Roman", Times, serif; font-size: 15pt; color: #990000; text-decoration: none } isoqlog-devel/isoqlog/LangCfg.h0100644000175000000000000000116607617675536016013 0ustar muratwheel#ifndef LANGCFG_H #define LANGCFG_H #include "Global.h" /* Language - Specific Strings */ char L_Average[VALSIZE]; char L_Creationtime[VALSIZE]; char L_Daily[VALSIZE]; char L_Day[VALSIZE]; char L_Domain[VALSIZE]; char L_Encoding[VALSIZE]; char L_Mail[VALSIZE]; char L_Main_Page[VALSIZE]; char L_Month[VALSIZE]; char L_Monthly[VALSIZE]; char L_Number[VALSIZE]; char L_Receiver[VALSIZE]; char L_Received[VALSIZE]; char L_Sender[VALSIZE]; char L_Sent[VALSIZE]; char L_Size[VALSIZE]; char L_Stats[VALSIZE]; char L_Top[VALSIZE]; char L_Total[VALSIZE]; char L_Yearly[VALSIZE]; char L_Year[VALSIZE]; void loadLang(char *); #endif isoqlog-devel/isoqlog/Makefile.am0100644000175000000000000000172107742730631016355 0ustar muratwheelbin_PROGRAMS = isoqlog isoqlog_SOURCES = Store.c Parser.c main.c loadconfig.c LangCfg.c Html.c Dir.c Data.c isoqlog_LDADD = SUBDIRS = lang htmltemp EXTRA_DIST = Data.c Dir.c Html.c LangCfg.c loadconfig.c main.c Parser.c Store.c Data.h Dir.h Html.h Global.h LangCfg.h loadconfig.h Parser.h Store.h isoqlog.conf-dist isoqlog.conf.sample1 isoqlog.conf.sample2 isoqlog.conf.sample3 isoqlog.domains-dist install-data-local: $(mkinstalldirs) /usr/local/etc/ $(INSTALL_DATA) $(srcdir)/isoqlog.conf-dist /usr/local/etc/isoqlog.conf-dist $(mkinstalldirs) /usr/local/etc/ $(INSTALL_DATA) $(srcdir)/isoqlog.domains-dist /usr/local/etc/isoqlog.domains-dist uninstall-local: -rm -f /usr/local/etc/isoqlog.conf-dist -rm -f /usr/local/etc/isoqlog.domains-dist # set the include path found by configure INCLUDES= $(all_includes) # the library search path. isoqlog_LDFLAGS = $(all_libraries) isoqlog-devel/isoqlog/Parser.c0100644000175000000000000003132210055602410015701 0ustar muratwheel#include #include #include #include #include #include #include #include #include "Data.h" #include "loadconfig.h" #include "Parser.h" extern char hostname[VALSIZE]; extern char outputdir[VALSIZE]; extern int cur_year, cur_month, cur_day; char *months[13] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL}; void lowercase(char *s, int size) { int i = 0; while ((*s != '\0') && (i++ < size)) { *s = tolower(*s); s++; } } /* These three functions read the logfile and fill the data structure */ void readQmailLogFile(char *fn) { FILE *fp = NULL; char buf[1024]; if ((fp = fopen(fn, "r")) == NULL) { fprintf(stderr, "fopen: %s: %s\n", fn, strerror(errno)); exit(-1); } while ((fgets(buf, 1024, fp)) != NULL) { if ((strstr(buf, " from ")) != NULL) /* if this is from line */ parseQmailFromBytesLine(buf, strlen(buf)); else if ((strstr(buf, " to remote ")) != NULL) parseQmailToRemoteLine(buf, strlen(buf)); else if ((strstr(buf, " to local ")) != NULL) parseQmailToLocalLine(buf, strlen(buf)); } fclose(fp); } void readSendmailLogFile(char *fn) { FILE *fp; char buf[1024]; if ((fp = fopen(fn, "r")) == NULL) { fprintf(stderr, "fopen: %s: %s\n", fn, strerror(errno)); exit(-1); } /* Get the historical values of last read log file's inode number If both inode numbers are the same, we assume that log file has not been changed (i.e rotated, removed), so we can go past offset bytes and continue to read new logs */ while ((fgets(buf, 1024, fp)) != NULL) { if ((check_syslog_date(buf, strlen(buf))) > 0) { if ((strstr(buf, " from=")) != NULL) /* if this is from line */ parseSendmailFromBytesLine(buf, strlen(buf)); else if ((strstr(buf, " to=")) != NULL) parseSendmailToLine(buf, strlen(buf)); } } /* close */ fclose(fp); } int check_syslog_date(char *buf, int buflen) { unsigned char m[4]= {0}; int day = 0, i = 0, j; for (i = 0; buf[i] != ' ' && buf[i] != '\n' && buf[i] != EOF && i < 4; i++) m[i] = buf[i]; m[3] = '\0'; while(buf[i] ==' ' && i < buflen) i++; for (j = i++; buf[j] != ' ' && buf[j] != '\n' && buf[j] != EOF && j < buflen; j++) day = 10 * day + (buf[j] - '0'); if ((strncmp(months[cur_month -1], m, 3) == 0) && (day == cur_day )) return 1; return -1; } /* This function parses one line from log file, checks if any " from " * is matched. If so, returns the mail address */ void parseQmailFromBytesLine(char *str, int lenstr) { char *p = str; char tmpbytes[128]; char domain[128]; char user[128]; char email[300]; int i = 0; char *tmp = NULL; if (((strstr(str, " from <>")) != NULL) || ((strstr(str, " bytes ")) == NULL)) { (general.from_cnt)++; return; /* null sender */ } /* get bytes */ if ((p = strstr(p, " bytes ")) == NULL) return; if ((p - str) > lenstr) return; p += 7; if (strstr(p, "@") == NULL) { (general.from_cnt)++; return; /*null sender, ignore it */ } lowercase(p, strlen(p)); for (i = 0; (*p != ' ') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) tmpbytes[i] = *p; tmpbytes[i] = 0x0; if (strlen(tmpbytes) == 0) return; if ((p = strstr(p, "from ")) == NULL) return; if ((p - str) > lenstr) return; p += 6; for (i = 0; (*p != '@') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) user[i] = *p; user[i] = 0x0; if (strlen(user) == 0) return; p++; /* skip pass @ */ for (i = 0; (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) domain[i] = *p; domain[i] = 0x0; if (strlen(domain) == 0) return; sprintf(email, "%.128s@%.128s", user, domain); checkUser(domain, email, FROM_MAIL, atol(tmpbytes)); (general.from_cnt)++; general.from_byte += atol(tmpbytes); } void parseQmailToRemoteLine(char *str, int lenstr) { char *p = str; char domain[128]; char user[128]; char email[300]; int i = 0; char *tmp = NULL; if ((p = strstr(p, " to remote ")) == NULL) return; if ((p - str) > lenstr) return; p += 11; if (strstr(p, "@") == NULL) { (general.to_cnt)++; return; /*null receiver, ignore it */ } lowercase(p, strlen(p)); if ((p - str) > lenstr) return; for (i = 0; (*p != '@') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) user[i] = *p; user[i] = 0x0; if (strlen(user) == 0) return; p++; /* skip pass @ */ for (i = 0; (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) domain[i] = *p; domain[i] = 0x0; if (strlen(domain) == 0) return; sprintf(email, "%.128s@%.128s", user, domain); checkUser(domain, email, TO_MAIL, 0); (general.to_cnt)++; } void parseQmailToLocalLine(char *str, int lenstr) { char *p = str; char domain[128]; char user[512]; char email[1024]; int i = 0; char *tmp = NULL; char vdomain[150]; if ((p = strstr(p, " to local ")) == NULL) return; if ((p - str) > lenstr) return; p += 10; if (strstr(p, "@") == NULL) { (general.to_cnt)++; return; /*null receiver, ignore it */ } lowercase(p, strlen(p)); if ((p - str) > lenstr) return; for (i = 0; (*p != '@') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 511) && ((p - str) < lenstr); i++, p++) user[i] = *p; user[i] = 0x0; if (strlen(user) == 0) return; p++; /* skip pass @ */ for (i = 0; (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) domain[i] = *p; domain[i] = 0x0; if (strlen(domain) == 0) return; sprintf(vdomain, "%.128s-", domain); /* If virtual domains enabled */ if (strstr(user, vdomain) != NULL) sprintf(email, "%.512s@%.128s", (user + strlen(vdomain)), domain); else sprintf(email, "%.512s@%.128s", user, domain); checkUser(domain, email, TO_MAIL, 0); (general.to_cnt)++; } /* This function parses one line from log file, checks if any " from " * is matched. If so, returns the mail address */ void parseSendmailFromBytesLine(char *str, int lenstr) { char *p = str; char domain[128]; char user[128]; char email[300]; int i = 0; char *tmp = NULL; int domainflg = 0; char tmpbytes[128]; if (((strstr(str, " from=<>")) != NULL) || ((strstr(str, " from=,")) != NULL)) { (general.from_cnt)++; return; /* null sender */ } if ((p = strstr(p, "from=")) == NULL) return; if ((p - str) > lenstr) return; p += 5; if (*p == '<') p++; lowercase(p, strlen(p)); if ((p - str) > lenstr) return; for (i = 0; (*p != ',') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) { if (*p == '@') { domainflg = 1; break; } user[i] = *p; } user[i] = 0x0; if (strlen(user) == 0) return; if (domainflg) { p++; /* skip pass @ */ for (i = 0; (*p != ',') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) domain[i] = *p; domain[i] = 0x0; if (strlen(domain) == 0) return; } else strncpy(domain, hostname, 127); if ((p = strstr(p, " size=")) == NULL) return; p += 6; if ((p - str) > lenstr) return; for (i = 0; (*p != ',') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) tmpbytes[i] = *p; tmpbytes[i] = 0x0; sprintf(email, "%.128s@%.128s", user, domain); checkUser(domain, email, FROM_MAIL, atol(tmpbytes)); (general.to_cnt)++; } void parseSendmailToLine(char *str, int lenstr) /* ft = from or to */ { char *p = str; char domain[128]; char user[128]; char email[300]; int i = 0; char *tmp = NULL; int domainflg = 0; char tmpbytes[128]; int vdomainflg = 0; if ((strstr(str, " to=<>")) != NULL) { (general.to_cnt)++; return; } if ((p = strstr(p, " to=")) == NULL) return; if ((p - str) > lenstr) return; /* For Postfix Virtual Domains */ if (strstr(p, " orig_to=") != NULL) { p = strstr(p, " orig_to="); p += 9; } else p += 4; if (*p == '<') p++; lowercase(p, strlen(p)); if ((p - str) > lenstr) return; for (i = 0; (*p != ',') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) { if (*p == '@') { domainflg = 1; break; } user[i] = *p; } user[i] = 0x0; if (strlen(user) == 0) return; if (domainflg) { p++; /* skip pass @ */ for (i = 0; (*p != ',') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) domain[i] = *p; domain[i] = 0x0; if (strlen(domain) == 0) return; } else strncpy(domain, hostname, 128); sprintf(email, "%.128s@%.128s", user, domain); checkUser(domain, email, TO_MAIL, 0); (general.to_cnt)++; } /* This function parses one line from log file, checks if any " from " * is matched. If so, returns the mail address * * * EXIM SUPPORT CODE by Marco Erra */ void parseEximFromBytesLine(char *str, int lenstr) { char *p = str; char domain[128]; char user[128]; char email[300]; int i = 0; char *tmp = NULL; int domainflg = 0; char tmpbytes[128]; if (((strstr(str, " <= <>")) != NULL) || ((strstr(str, " <=,")) != NULL) ) { (general.from_cnt)++; return; /* null sender */ } if ((p = strstr(p, " <= ")) == NULL) return; if ((p - str) > lenstr) return; p += 4; if (*p == '<') p++; lowercase(p, strlen(p)); if ((p - str) > lenstr) return; for (i = 0; (*p != ' ') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) { if (*p == '@') { domainflg = 1; break; } user[i] = *p; } user[i] = 0x0; if (strlen(user) == 0) return; if (domainflg) { p++; /* skip pass @ */ for (i = 0; (*p != ' ') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) domain[i] = *p; domain[i] = 0x0; if (strlen(domain) == 0) return; } else strncpy(domain, hostname, 128); if ((p = strstr(p, " s=")) == NULL) return; p += 3; if ((p - str) > lenstr) return; for (i = 0; (*p != ' ') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) tmpbytes[i] = *p; tmpbytes[i] = 0x0; sprintf(email, "%.128s@%.128s", user, domain); checkUser(domain, email, FROM_MAIL, atol(tmpbytes)); (general.to_cnt)++; } void parseEximToLine(char *str, int lenstr) /* ft = from or to */ { char *p = str; char domain[128]; char user[128]; char email[300]; int i = 0; char *tmp = NULL; int domainflg = 0; char tmpbytes[128]; if ((strstr(str, " => <>")) != NULL) { (general.to_cnt)++; return; } if ((p = strstr(p, " => ")) == NULL) return; if ((p - str) > lenstr) return; p += 4; if (*p == '<') p++; lowercase(p, strlen(p)); if ((p - str) > lenstr) return; for (i = 0; (*p != ' ') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) { if (*p == '@') { domainflg = 1; break; } user[i] = *p; } user[i] = 0x0; if (strlen(user) == 0) return; if (domainflg) { p++; /* skip pass @ */ for (i = 0; (*p != ' ') && (*p != '>') && (*p != '\0') && (*p != '\r') && (*p != '\n') && (i < 127) && ((p - str) < lenstr); i++, p++) domain[i] = *p; domain[i] = 0x0; if (strlen(domain) == 0) return; } else strncpy(domain, hostname, 128); sprintf(email, "%.128s@%.128s", user, domain); checkUser(domain, email, TO_MAIL, 0); (general.to_cnt)++; } void readEximLogFile(char *fn) { FILE *fp = NULL; char buf[1024]; if ((fp = fopen(fn, "r")) == NULL) { fprintf(stderr, "fopen: %s: %s\n", fn, strerror(errno)); exit(-1); } /* Get the historical values of last read log file's inode number If both inode numbers are the same, we assume that log file has not been changed (i.e rotated, removed), so we can go past offset bytes and continue to read new logs */ while ((fgets(buf, 1024, fp)) != NULL) { if ((check_syslog_date_exim(buf, strlen(buf))) > 0) { if ((strstr(buf, " <= ")) != NULL){ /* if this is from line */ parseEximFromBytesLine(buf, strlen(buf)); }else if ((strstr(buf, " => ")) != NULL) parseEximToLine(buf, strlen(buf)); } } fclose(fp); } int check_syslog_date_exim(char *buf, int buflen) { int ano = 0, mes = 0, day = 0, i = 0, j, k; for (k = 0; buf[k] != '-' && buf[k] != '\n' && buf[k] != EOF && k < buflen; k++) ano = 10 * ano + (buf[k] - '0'); k++; for (i = k++; buf[i] != '-' && buf[i] != '\n' && buf[i] != EOF && i < buflen; i++) mes = 10 * mes + (buf[i] - '0'); i++; for (j = i++; buf[j] != ' ' && buf[j] != '\n' && buf[j] != EOF && j < buflen; j++) day = 10 * day + (buf[j] - '0'); if ((cur_month == mes) && (day == cur_day )){ return 1; } return -1; } isoqlog-devel/isoqlog/Parser.h0100644000175000000000000000151310035342555015716 0ustar muratwheel#ifndef PARSER_H #define PARSER_H #include #include #include #include #include typedef struct hist_stat { unsigned inode; int saved_pos; } hist_stat; void lowercase(char *, int); /* Parser routines for Qmail */ void readQmailLogFile(char *); void parseQmailFromBytesLine(char *, int len); void parseQmailToRemoteLine(char *, int len); void parseQmailToLocalLine(char *, int len); /* Parser routines for Sendmail and Postfix*/ void readSendmailLogFile(char *); void parseSendmailFromBytesLine(char *, int); void parseSendmailToLine(char *, int); int check_syslog_date(char *, int); /* Parser routines for Exim */ void readEximLogFile(char *); void parseEximFromBytesLine(char *, int); void parseEximToLine(char *, int); int check_syslog_date_exim(char *, int); #endif isoqlog-devel/isoqlog/Store.c0100644000175000000000000000403010035733656015554 0ustar muratwheel #include #include #include #include #include #include "Store.h" #include "Data.h" #include "Dir.h" extern char logtype[128]; /* write hist[] array to the specified file */ void storeHistData(char *f, hist *h, size_t size) { FILE *fp; if (f == NULL || h == NULL) return; if ((fp = fopen(f, "w")) == NULL) { fprintf(stderr, "storeHistData: cannot create history file %s: %s\n", f, strerror(errno)); exit(-1); } fwrite(h, size, 1, fp); fclose(fp); } /* read hist[] array from the specified array */ void getHistData(char *f, hist *h, size_t size) { FILE *fp; if (f == NULL || h == NULL) return; if ((fp = fopen(f, "r")) == NULL) return; fread(h, size, 1, fp); fclose(fp); } /* Store domain's current day statistics to the history file(monthly) */ void storeCurrentDayHistory(char *f, domain *d) { hist h[MAXDAYS]; int i; if (f == NULL || d == NULL) return; for (i = 0; i < MAXDAYS; i++) { h[i].sent = 0; h[i].received = 0; h[i].bytes_sent = 0; } getHistData(f, h, sizeof(h)); h[cur_day - 1].sent = d->from_cnt; h[cur_day - 1].received = d->to_cnt; h[cur_day - 1].bytes_sent = d->from_byte; storeHistData(f, h, sizeof(h)); } /* Store domain's current month statistics to the history file(yearly) */ void storeCurrentMonthHistory(char *f, int s, int r, double b) { hist h[MAXMONTHS]; int i; if (f == NULL) return; for (i = 0; i < MAXMONTHS; i++) { h[i].sent = 0; h[i].received = 0; h[i].bytes_sent = 0; } getHistData(f, h, sizeof(h)); h[cur_month - 1].sent = s; h[cur_month - 1].received = r; h[cur_month - 1].bytes_sent = b; storeHistData(f, h, sizeof(h)); } void storeCurrentYearHistory(char *f, int s, int r, double b) { hist h[MAXYEARS]; int i; if (f == NULL) return; for (i = 0; i < MAXYEARS; i++) { h[i].sent = 0; h[i].received = 0; h[i].bytes_sent = 0; } getHistData(f, h, sizeof(h)); h[cur_year - 2002].sent = s; h[cur_year - 2002].received = r; h[cur_year - 2002].bytes_sent = b; storeHistData(f, h, sizeof(h)); } isoqlog-devel/isoqlog/Store.h0100644000175000000000000000105007617675536015576 0ustar muratwheel#ifndef STORE_H #define STORE_H #include "Data.h" enum { MAXMONTHS = 12, MAXDAYS = 31, MAXYEARS = 250 /* should be enough, huh? ;) */ }; typedef struct hist { int sent; int received; double bytes_sent; } hist; struct hist mhist[MAXMONTHS]; struct hist dhist[MAXDAYS]; /* Functions */ void storeHistData(char *, hist *, size_t); void getHistData(char *, hist *, size_t); void storeCurrentDayHistory(char *, domain *); void storeCurrentMonthHistory(char *, int, int, double); void storeCurrentYearHistory(char *, int, int, double); #endif isoqlog-devel/isoqlog/config.h.in0100644000175000000000000000554707742745635016370 0ustar muratwheel/* isoqlog/config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if your system has a working `malloc' function. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to `unsigned' if does not define. */ #undef size_t isoqlog-devel/isoqlog/isoqlog.conf-dist0100644000175000000000000000075407745702554017621 0ustar muratwheel#isoqlog Configuration file logtype = "qmail-multilog" # log type qmai-multilog, qmail-syslog, sendmail, postfix logstore = "/var/log/qmail" # domainsfile = "/usr/local/etc/isoqlog.domains" # outputdir = "/var/www/html/isoqlog" # html output directory htmldir = "/usr/local/share/isoqlog/htmltemp" langfile = "/usr/local/share/isoqlog/lang/english" hostname = "enderunix.org" maxsender = 100 maxreceiver = 100 maxtotal = 100 maxbyte = 100 isoqlog-devel/isoqlog/isoqlog.conf.sample10100644000175000000000000000071110040206076020166 0ustar muratwheel#isoqlog Configuration file logtype = "qmail-syslog" #log type qmai-multilog, qmail-syslog, sendmail, postfix logstore = "/var/log/maillog" domainsfile = "/usr/local/etc/isoqlog.domains" outputdir = "/var/www/html/isoqlog" #html output directory htmldir = "/usr/local/share/isoqlog/htmltemp" langfile = "/usr/local/share/isoqlog/lang/english" hostname = "enderunix.net" maxsender = 100 maxreceiver = 100 maxtotal = 100 maxbyte = 100 isoqlog-devel/isoqlog/isoqlog.conf.sample20100644000175000000000000000071010040206076020166 0ustar muratwheel#isoqlog Configuration file logtype = "postfix" #log type qmai-multilog, qmail-syslog, sendmail, postfix logstore = "/var/log/mailllog" domainsfile = "/usr/local/etc/isoqlog.domains" outputdir = "/usr/local/www/data/isoqlog" # html output directory htmldir = "/usr/local/share/isoqlog/htmltemp" langfile = "/usr/local/share/isoqlog/lang/turkish" hostname = "enderunix.org" maxsender = 100 maxreceiver = 100 maxtotal = 100 maxbyte = 100 isoqlog-devel/isoqlog/isoqlog.conf.sample30100644000175000000000000000072310040206076020173 0ustar muratwheel#isoqlog Configuration file logtype = "sendmail" #log type qmai-multilog, qmail-syslog, sendmail, postfix logstore = "/var/log/syslog" domainsfile = "/usr/local/etc/isoqlog.domains" outputdir = "/usr/local/www/data/isoqlog" #html output directory htmldir = "/usr/local/share/isoqlog/htmltemp" langfile = "/usr/local/share/isoqlog/lang/turkish" hostname = "delidumrul.enderunix.org" maxsender = 100 maxreceiver = 100 maxtotal = 100 maxbyte = 100 isoqlog-devel/isoqlog/isoqlog.domains-dist0100644000175000000000000000003007617675536020320 0ustar muratwheeldomain1.com domain2.com isoqlog-devel/isoqlog/loadconfig.c0100644000175000000000000001450710055577734016604 0ustar muratwheel #include #include #include #include #include #include #include #include #include #include "loadconfig.h" #include "Data.h" #include "Dir.h" #include "Parser.h" void loadconfig(char *cfgfile) /* load isoqlog configuration file */ { FILE *fd = NULL; char buf[BUFSIZE]; char keyword[KEYSIZE]; char value[VALSIZE]; int lenbuf = 0; char *cp1 = NULL, *cp2 = NULL; char *variables[] = { "Invalid", "outputdir", "logtype", "logstore", "domainsfile", "langfile", "htmldir", "hostname", "maxsender", "maxreceiver", "maxtotal", "maxbyte" }; int i, j, key, line, keyword_nums = sizeof(variables)/sizeof(char *); if ((fd = fopen(cfgfile, "r")) == NULL) { fprintf(stderr, "loadconfig: cannot open isoqlog configuration file %s, exiting...\n", cfgfile); exit(-1); } line = 0; while ((fgets(buf, BUFSIZE, fd)) != NULL) { line++; if (buf[0] == '#') continue; if ((lenbuf = strlen(buf)) <= 1) continue; cp1 = buf; cp2 = keyword; j = 0; while (isspace((int)*cp1) && ((cp1 - buf) < lenbuf)) cp1++; while(isgraph((int)*cp1) && *cp1 != '=' && (j++ < KEYSIZE - 1) && (cp1 - buf) < lenbuf) *cp2++ = *cp1++; *cp2 = '\0'; cp2 = value; while ((*cp1 != '\0') && (*cp1 !='\n') && (*cp1 !='=') && ((cp1 - buf) < lenbuf)) cp1++; cp1++; while (isspace((int)*cp1) && ((cp1 - buf) < lenbuf)) cp1++; if (*cp1 == '"') cp1++; j = 0; while ((*cp1 != '\0') && (*cp1 !='\n') && (*cp1 !='"') && (j++ < VALSIZE - 1) && ((cp1 - buf) < lenbuf)) *cp2++ = *cp1++; *cp2-- = '\0'; if (keyword[0] =='\0' || value[0] =='\0') continue; key = 0; for (i = 0; i < keyword_nums; i++) { if ((strncmp(keyword, variables[i], KEYSIZE)) == 0) { key = i; break; } } switch(key) { case 0: fprintf(stderr, "Illegal Keyword: %s\n", keyword); break; case 1: strncpy(outputdir, value, VALSIZE); break; case 2: strncpy(logtype, value, VALSIZE); break; case 3: strncpy(logstore, value, VALSIZE); break; case 4: strncpy(domainsfile, value, VALSIZE); break; case 5: strncpy(langfile, value, VALSIZE); break; case 6: strncpy(htmldir, value, VALSIZE); break; case 7: strncpy(hostname, value, VALSIZE); break; case 8: maxsender = atoi(value); break; case 9: maxreceiver = atoi(value); break; case 10: maxtotal = atoi(value); break; case 11: maxbyte = atoi(value); break; } } fclose(fd); } void readconfig(char *cfgfile) { FILE *fd = NULL; char buf[1024]; int count = 0; /*counter for domains */ struct stat statbuf; char *dir; struct tm *t; time(&today); t = localtime(&today); cur_year = t->tm_year + 1900; cur_month = t->tm_mon + 1; cur_day = t->tm_mday ; cur_hour = t->tm_hour; cur_min = t->tm_min; cur_sec = t->tm_sec; printf("Year: %d Month: %d\n", cur_year, cur_month); loadconfig(cfgfile); printf("outputdir:%s\n", outputdir); printf("htmldir:%s\n", htmldir); printf("logtype:%s\n", logtype); printf("logstore:%s\n", logstore); printf("langfile:%s\n", langfile); printf("maxsender:%d\n", maxsender); printf("maxreceiver:%d\n", maxreceiver); printf("maxtotal:%d\n", maxtotal); printf("maxbyte:%d\n", maxbyte); if ((strlen(hostname)) == 0 ) gethostname(hostname, VALSIZE); printf("hostname: %s\n", hostname); if ((strncasecmp(logtype, "qmail-multilog", VALSIZE) != 0) && (strncasecmp(logtype, "qmail-syslog", VALSIZE) != 0) && (strncasecmp(logtype, "sendmail", VALSIZE) != 0) && (strncasecmp(logtype, "postfix", VALSIZE) != 0) && (strcasecmp(logtype, "exim") != 0)) { printf("Invalid logtype: %.128s\naccepted logytpes are: " "qmail-multilog, qmail-syslog, sendmail, postfix or exim\n", logtype); exit(-1); } if ((strncasecmp(logtype, "qmail-multilog", VALSIZE)) == 0) { if ((stat(logstore, &statbuf)) == 0) { if((S_ISDIR(statbuf.st_mode)) == 0) { fprintf(stderr, "You are using: %s log type " "logstore: %s must be a directory\n", logtype, logstore); exit(-1); } } else { fprintf(stderr, "You are using: %s log type " "logstore: %s directory does not exist!\n", logtype, logstore); exit(-1); } } else { if ((stat(logstore, &statbuf)) == 0) { if((S_ISREG(statbuf.st_mode)) == 0) { fprintf(stderr, "You are using: %s log type " "logstore: %s must be a regular file\n", logtype, logstore); exit(-1); } } else { fprintf(stderr, "You are using: %s log type " "logstore: %s file does not exist!\n", logtype, logstore); exit(-1); } } if ((strlen(outputdir)) == 0 ) { fprintf(stderr, "You must define output directory"); exit(-1); } if ((strlen(domainsfile)) == 0 ) { fprintf(stderr, "You must define domainsfile"); exit(-1); } createdir(outputdir); if ((fd = fopen(domainsfile, "r")) == NULL) { fprintf(stderr, "domainsfile: %s could not be opened\n", domainsfile); exit(-1); } while ((fgets(buf, 1024, fd)) != NULL) { printf("Domains %s", buf); removespaces(buf, strlen(buf)); if (strlen(buf) == 0) ; else { lowercase(buf, strlen(buf)); /* lowercase domains */ addDomain(buf); dir = malloc((strlen(outputdir) + strlen(buf) + 100) * sizeof(char)); sprintf(dir, "%s/%s", outputdir, buf); createdir(dir); /* create domain directory */ sprintf(dir, "%s/%s/%d", outputdir, buf, cur_year); createdir(dir); /* create year dir under domain directory */ sprintf(dir, "%s/%s/%d/%d", outputdir, buf, cur_year, cur_month); createdir(dir); /* create month directory */ count++; } } if (count == 0) { fprintf(stderr, "Empty domains file. you must add at least one domain\n"); exit(-1); } sprintf(dir, "%s/%s", outputdir, "general"); createdir(dir); /* create domain directory */ sprintf(dir, "%s/%s/%d", outputdir, "general" , cur_year); createdir(dir); /* create year dir under domain directory */ sprintf(dir, "%s/%s/%d/%d", outputdir, "general", cur_year, cur_month); createdir(dir); /* create month directory */ free(dir); /* close domains file */ fclose(fd); } int removespaces(char *buf, int len) { char *cp = buf; char *sv = buf; for (; *buf != '\0' && *buf != '\r' && *buf != '\n' && ((buf - sv) < len); buf++) if (*buf == ' ') continue; else *cp++ = *buf; *cp = 0x0; return cp - sv; } isoqlog-devel/isoqlog/main.c0100644000175000000000000000264310035733656015414 0ustar muratwheel#include #include #include #include "Data.h" #include "Parser.h" #include "Dir.h" #include "Html.h" #include "LangCfg.h" #include "loadconfig.h" #include "Store.h" extern char langfile[VALSIZE]; extern char logtype[VALSIZE]; extern char logstore[VALSIZE]; int main(int argc, char **argv) { int c, f = 0, error = 0; extern char *optarg; extern int optind; char isoqlogconf[256]; while (!error && (c = getopt(argc,argv,"f:hv")) != -1) { switch (c) { case 'v': puts(VERSION_STRING); exit(0); break; case 'h': puts("Usage: isoqlog [-f isoqlog.conf]"); exit(0); break; case 'f': strncpy(isoqlogconf, optarg, 256); f = 1; break; default: error = 1; puts("Usage: isoqlog [-f isoqlog.conf]"); exit(-1); break; } } general.from_cnt = 0; general.to_cnt = 0; general.from_byte = 0; if (f == 0) readconfig("/usr/local/etc/isoqlog.conf"); else readconfig(isoqlogconf); loadLang(langfile); if (strcmp(logtype, "qmail-multilog") == 0) openlogdir(logstore); else if (strcmp(logtype, "qmail-syslog") == 0) readQmailLogFile(logstore); else if (strcmp(logtype, "sendmail") == 0) readSendmailLogFile(logstore); else if (strcmp(logtype, "postfix") == 0) readSendmailLogFile(logstore); else if (strcmp(logtype, "exim") == 0) readEximLogFile(logstore); createHtml(); return 0; } isoqlog-devel/isoqlog/loadconfig.h0100644000175000000000000000065410035342556016575 0ustar muratwheel#ifndef LOADCONFIG_H #define LOADCONFIG_H #include "Global.h" /* Configuration File - Specific Strings */ char outputdir[VALSIZE]; char logtype[VALSIZE]; char logstore[VALSIZE]; char domainsfile[VALSIZE]; char htmldir[VALSIZE]; char langfile[VALSIZE]; char hostname[VALSIZE]; int maxsender; int maxreceiver; int maxtotal; int maxbyte; int removespaces(char *, int); void loadconfig(char *); void readconfig(char *); #endif isoqlog-devel/isoqlog/lang/0040755000175000000000000000000010055616055015236 5ustar muratwheelisoqlog-devel/isoqlog/lang/Makefile.am0100644000175000000000000000573507742730631017307 0ustar muratwheel EXTRA_DIST = turkish swedish spanish russian portuguese polish dutch english finnish french german italian norwegian czech romana bulgarian danish install-data-local: $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/turkish /usr/local/share/isoqlog/lang/turkish $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/swedish /usr/local/share/isoqlog/lang/swedish $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/spanish /usr/local/share/isoqlog/lang/spanish $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/russian /usr/local/share/isoqlog/lang/russian $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/portuguese /usr/local/share/isoqlog/lang/portuguese $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/polish /usr/local/share/isoqlog/lang/polish $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/dutch /usr/local/share/isoqlog/lang/dutch $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/english /usr/local/share/isoqlog/lang/english $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/finnish /usr/local/share/isoqlog/lang/finnish $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/french /usr/local/share/isoqlog/lang/french $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/german /usr/local/share/isoqlog/lang/german $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/italian /usr/local/share/isoqlog/lang/italian $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/norwegian /usr/local/share/isoqlog/lang/norwegian $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/czech /usr/local/share/isoqlog/lang/czech $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/czech /usr/local/share/isoqlog/lang/romana $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/czech /usr/local/share/isoqlog/lang/bulgarian $(mkinstalldirs) /usr/local/share/isoqlog/lang/ $(INSTALL_DATA) $(srcdir)/czech /usr/local/share/isoqlog/lang/danish uninstall-local: -rm -f /usr/local/share/isoqlog/lang/turkish -rm -f /usr/local/share/isoqlog/lang/swedish -rm -f /usr/local/share/isoqlog/lang/spanish -rm -f /usr/local/share/isoqlog/lang/russian -rm -f /usr/local/share/isoqlog/lang/portuguese -rm -f /usr/local/share/isoqlog/lang/polish -rm -f /usr/local/share/isoqlog/lang/dutch -rm -f /usr/local/share/isoqlog/lang/english -rm -f /usr/local/share/isoqlog/lang/finnish -rm -f /usr/local/share/isoqlog/lang/french -rm -f /usr/local/share/isoqlog/lang/german -rm -f /usr/local/share/isoqlog/lang/italian -rm -f /usr/local/share/isoqlog/lang/norwegian -rm -f /usr/local/share/isoqlog/lang/czech -rm -f /usr/local/share/isoqlog/lang/romana -rm -f /usr/local/share/isoqlog/lang/bulgarian -rm -f /usr/local/share/isoqlog/lang/danish isoqlog-devel/isoqlog/lang/bulgarian0100644000175000000000000000066107646442753017143 0ustar muratwheelL_Average = "Ñðåäíî" L_Creationtime = "Äàòà íà ñúçäàâàíå" L_Daily = "Äíåâíî" L_Day = "Äåí" L_Domain = "Äîìåéí" L_Encoding = " " L_Mail = "Ïîùà" L_Main_Page = "Íà÷àëî" L_Month = "Ìåñåö" L_Monthly = "Ìåñå÷íî" L_Number = "Íîìåð" L_Received = "Ïîëó÷åíè" L_Receiver = "Ïîëó÷àòåë" L_Sender = "Ïîäàòåë" L_Sent = "Èçïðàòåíè" L_Size = "Ãîëåìèíà" L_Stats = "Ñòàòèñòèêè" L_Top = "Ïúðâèòå" L_Total = "Îáùî" L_Year = "Ãîäèíà" L_Yearly = "Ãîäèøíî"isoqlog-devel/isoqlog/lang/czech0100644000175000000000000000066207746300432016260 0ustar muratwheelL_Average = "Prùmìr" L_Creationtime = "Èas vytvoøení" L_Daily = "Dennì" L_Day = "Den" L_Domain = "Doména" L_Encoding = "iso-8859-2" L_Mail = "Mail" L_Main_Page = "Hlavní" L_Month = "Mìsíc" L_Monthly = "Mìsíènì" L_Number = "Èíslo" L_Received = "Pøijato" L_Receiver = "Pøíjemce" L_Sender = "Odesílatel" L_Sent = "Posláno" L_Size = "Velikost" L_Stats = "Statistika" L_Top = "Horních" L_Total = "Celkem" L_Year = "Rok" L_Yearly = "Roèní" isoqlog-devel/isoqlog/lang/danish0100644000175000000000000000113607746300432016427 0ustar muratwheel# Danish translation by "Christian Kurek" # $Id: danish,v 1.3 2003/10/24 19:44:26 aboy Exp $ L_Average = "Gennemsnit" L_Creationtime = "Fremstillingstidspunkt" L_Daily = "Daglig" L_Day = "Dag" L_Domain = "Domæne" L_Encoding = "iso-8859-1" L_Mail = "Post" L_Main_Page = "Forside" L_Month = "Måned" L_Monthly = "Månedlig" L_Number = "Antal" L_Received = "Modtaget" L_Receiver = "Modtager" L_Sender = "Afsender" L_Sent = "Afsendt" L_Size = "Størrelse" L_Stats = "Statistik" L_Top = "Top" L_Total = "Totalt" L_Year = "År" L_Yearly = "Årligt" isoqlog-devel/isoqlog/lang/dutch0100644000175000000000000000076107746300432016273 0ustar muratwheel#Contributed by Kobe Lenjou" L_Average = "Average" L_Creationtime = "Creation Time" L_Daily = "Dagelijks" L_Day = "Dag" L_Domain = "Domein" L_Encoding = "iso-8859-1" L_Mail = "Mail" L_Main_Page = "Hoofdpagina" L_Month = "Maand" L_Monthly = "Maandelijks" L_Number = "Nummer" L_Received = "ontvangen" L_Receiver = "Ontvanger" L_Sender = "Afzender" L_Sent = "Verstuurd" L_Size = "Size" L_Stats = "Statistieken" L_Top = "Top" L_Total = "Total" L_Yearly = "Yearly" L_Year = "Year" isoqlog-devel/isoqlog/lang/english0100644000175000000000000000064507746300432016616 0ustar muratwheelL_Average = "Average" L_Creationtime = "Creation Time" L_Daily = "Daily" L_Day = "Day" L_Domain = "Domain" L_Encoding = "iso-8859-1" L_Mail = "Mail" L_Main_Page = "Main" L_Month = "Month" L_Monthly = "Monthly" L_Number = "Number" L_Received = "Received" L_Receiver = "Receiver" L_Sender = "Sender" L_Sent = "Sent" L_Size = "Size" L_Stats = "Statistics" L_Top = "Top" L_Total = "Total" L_Year = "Year" L_Yearly = "Yearly" isoqlog-devel/isoqlog/lang/finnish0100644000175000000000000000073407746300432016622 0ustar muratwheelL_Average = "keskimäärin" L_Creationtime = "luotu" L_Daily = "päivittäinen" L_Day = "päivä" L_Domain = "domain" L_Encoding = "iso-8859-4" L_Mail = "sähköposti" L_Main_Page = "pääsivu" L_Month = "kuukausi" L_Monthly = "kuukausittainen" L_Number = "kpl" L_Received = "vastaanotettu" L_Receiver = "vastaanottaja" L_Sender = "lähettäjä" L_Sent = "lähetetty" L_Size = "viestin koko" L_Stats = "tilasto" L_Top = "Top" L_Total = "yhteensä" L_Year = "vuosi" L_Yearly = "vuosittainen" isoqlog-devel/isoqlog/lang/french0100644000175000000000000000075707617675536016457 0ustar muratwheel#Submitted by "Olivier Fredj" L_Average = "Moyenne" L_Creationtime = "Date de création" L_Daily = "Par jour" L_Day = "Jour" L_Domain = "Domaine" L_Encoding = " " L_Mail = "Courrier" L_Main_Page = "Page principale" L_Month = "Mois" L_Monthly = "Mensuel" L_Number = "Nombre" L_Received = "Reçus" L_Receiver = "Destinataire" L_Sender = "Envoyeur" L_Sent = "Envoyé" L_Size = "Taille" L_Stats = "Statistiques" L_Top = "Top" L_Total = "Total" L_Yearly = "Annuel" L_Year = "Année" isoqlog-devel/isoqlog/lang/german0100644000175000000000000000112107746300432016424 0ustar muratwheel##Thanks to #Clemens Hermann # Edson Lima Monteiro # fixes by Andreas Rust L_Average = "Durchschnitt" L_Creationtime = "Erstellungsdatum" L_Daily = "Täglich" L_Day = "Tag" L_Domain = "Domain" L_Encoding = "iso-8859-1" L_Mail = "Mail" L_Main_Page = "Startseite" L_Month = "Monat" L_Monthly = "Monatlich" L_Number = "Number" L_Received = "empfangen" L_Receiver = "Empfänger" L_Sender = "Absender" L_Sent = "versandt" L_Size = "Grösse" L_Stats = "Statistiken" L_Top = "Top" L_Total = "Gesamt" L_Yearly = "Jahres" L_Year = "Jahr" isoqlog-devel/isoqlog/lang/italian0100644000175000000000000000102107746300432016573 0ustar muratwheel#Provided by Antonio L_Average = "Media" L_Creationtime = "Data di Creazione" L_Daily = "Giornaliero" L_Day = "Giorno" L_Domain = "Dominio" L_Encoding = "iso-8859-1" L_Mail = "Mail" L_Main_Page = "Pagina principale" L_Monthly = "Mensile" L_Month = "Mese" L_Number = "Numero" L_Received = "Ricevuti" L_Receiver = "Destinatario" L_Sender = "Mittente" L_Sent = "Spediti" L_Size = "Dimensione" L_Stats = "Statistiche" L_Top = "Top" L_Total = "Totale" L_Year = "Anno" L_Yearly = "Annuale" isoqlog-devel/isoqlog/lang/norwegian0100644000175000000000000000071207746300432017151 0ustar muratwheel# by JAN STEINAR HANSEN L_Average = "Average" L_Creationtime = "Creation Time" L_Daily = "Daglig" L_Day = "Dag" L_Domain = "Domene" L_Encoding = "iso-8859-1" L_Mail = "E-post" L_Main_Page = "Hovedside" L_Month = "Måned" L_Monthly = "Månedlig" L_Number = "Number" L_Received = "Received" L_Receiver = "Receiver" L_Sender = "Sender" L_Sent = "Sent" L_Size = "Size" L_Stats = "Statistikk" L_Top = "Topp" L_Total = "Totalt" L_Yearly = "Yearly" L_Year = "Year" isoqlog-devel/isoqlog/lang/polish0100644000175000000000000000105707746300432016461 0ustar muratwheel# Thanks to Maciej Gruszczynski # Komputerowa Siec Osiedlowa L_Average = "Average" L_Creationtime = "Creation Time" L_Daily = "Daily" L_Day = "Dzieñ" L_Domain = "Domena" L_Encoding = "iso-8859-2" L_Mail = "poczta" L_Main_Page = "G³ówna" L_Month = "Month" L_Monthly = "Miesiêcznie" L_Number = "Number" L_Received = "Received" L_Receiver = "Receiver" L_Sender = "Sender" L_Sent = "Sent" L_Size = "Size" L_Stats = "Statystyki" L_Top = = "Najwiêcej" L_Total = "W sumie" L_Yearly = "Yearly" L_Year = "Year" isoqlog-devel/isoqlog/lang/portuguese0100644000175000000000000000105107746300432017357 0ustar muratwheel#Translation by Alexei Znamensky L_Average = "Média" L_Creationtime = "Gerado em" L_Daily = "Diário" L_Day = "Dia" L_Domain = "Domínio" L_Encoding = "iso-8859-2" L_Mail = "Mensagem" L_Main_Page = "Página Principal" L_Monthly = "Mensal" L_Month = "Mês" L_Number = "Número" L_Received = "Recebido" L_Receiver = "Destinatário" L_Sender = "Remetente" L_Sent = "Enviado" L_Size = "Tamanho" L_Stats = "Estatísticas" L_Top = "Mais" L_Total = "Total" L_Yearly = "Anual" L_Year = "Ano" isoqlog-devel/isoqlog/lang/romana0100644000175000000000000000065207746300432016440 0ustar muratwheelL_Average = "Media" L_Creationtime = "Ora generarii" L_Daily = "Zilnic" L_Day = "Ziua" L_Domain = "Domeniul" L_Encoding = "iso-8859-2" L_Mail = "Mail" L_Main_Page = "Meniu" L_Month = "Luna" L_Monthly = "Lunar" L_Number = "Numar" L_Received = "Primite" L_Receiver = "Destinatar" L_Sender = "Expeditor" L_Sent = "Trimise" L_Size = "Marime" L_Stats = "Statistici" L_Top = "Top" L_Total = "Total" L_Year = "An" L_Yearly = "Anual" isoqlog-devel/isoqlog/lang/russian0100644000175000000000000000075707637631350016662 0ustar muratwheel# Translated by Yuri A. Nosyrev aka Nua L_Average = "÷ ÓÒÅÄÎÅÍ" L_Creationtime = "äÁÔÁ ÓÏÚÄÁÎÉÑ" L_Daily = "úÁ ÄÅÎØ" L_Day = "äÅÎØ" L_Domain = "äÏÍÅÎ" L_Encoding = "koi8-r" L_Mail = "áÄÒÅÓ" L_Main_Page = "çÌÁ×ÎÁÑ" L_Month = "íÅÓÑÃ" L_Monthly = "úÁ ÍÅÓÑÃ" L_Number = "îÏÍÅÒ" L_Received = "ðÒÉÎÑÔÏ" L_Receiver = "ðÏÌÕÞÁÔÅÌØ" L_Sender = "ïÔÐÒÁ×ÉÔÅÌØ" L_Sent = "ïÔÐÒÁ×ÌÅÎÏ" L_Size = "òÁÚÍÅÒ" L_Stats = "óÔÁÔÉÓÔÉËÁ" L_Top = "ôÏÐ" L_Total = "÷ÓÅÇÏ" L_Year = "çÏÄ" L_Yearly = "úÁ ÇÏÄ" isoqlog-devel/isoqlog/lang/spanish0100644000175000000000000000075707617675536016657 0ustar muratwheel#Submitted by Pedro Capiscol L_Average = "Promedio" L_Creationtime = "Momento de la creación" L_Daily = "Diario" L_Day = "Dia" L_Domain = "Dominio" L_Encoding = "ISO-8859-1" L_Mail = "Correo" L_Main_Page = "Página" L_Month = "Mes" L_Monthly = "Mensual" L_Number = "Número" L_Received = "Recibido" L_Receiver = "Receptor" L_Sender = "Remitente" L_Sent = "Enviado" L_Size = "Tamaño" L_Stats = "Estadísticas" L_Top = "Top" L_Total = "Total" L_Yearly = "Anual" L_Year = "Año" isoqlog-devel/isoqlog/lang/swedish0100644000175000000000000000076607746300432016637 0ustar muratwheel# Thanks to Oden Eriksson L_Average = "Average" L_Creationtime = "Creation Time" L_Daily = "Daily" L_Day = "Dag" L_Domain = "Domän" L_Encoding = "iso-8859-1" L_Mail = "Epost" L_Main_Page = "Huvudsidan" L_Month = "Month" L_Monthly = "Månatlig" L_Number = "Number" L_Received = "Mottaget" L_Receiver = "Mottagare" L_Sender = "Avsändare" L_Sent = "Skickade" L_Size = "Size" L_Stats = "Statistik" L_Top = "Topp" L_Total = "Total" L_Yearly = "Yearly" L_Year = "Year" isoqlog-devel/isoqlog/lang/turkish0100644000175000000000000000066507746300432016660 0ustar muratwheelL_Average = "Ortalama" L_Creationtime = "Oluþturma Tarihi" L_Daily = "Günlük" L_Day = "Gün" L_Domain = "Domain" L_Encoding = "iso-8859-9" L_Mail = "E-Posta" L_Main_Page = "Ana Sayfa" L_Month = "Ay" L_Monthly = "Aylýk" L_Number = "Adet" L_Received = "Alýnan" L_Receiver = "Alýcý" L_Sender = "Gönderen" L_Sent = "Gönderilen" L_Size = "Boyut" L_Stats = "Ýstatistikler" L_Top = "Top" L_Total = "Toplam" L_Year = "Yýl" L_Yearly = "Yýllýk" isoqlog-devel/.cvsignore0100644000175000000000000000022007620152167014632 0ustar muratwheelisoqlog/isoqlog isoqlog/.deps isoqlog/.libs *.o *.c~ configure Makefile config.h.in autom4te.cache aclocal.m4 acinclude.m4 configure.in subdirs isoqlog-devel/AUTHORS0100644000175000000000000000036007742707144013715 0ustar muratwheelIsoqLog AUTHORS ---------------------- (In Alphabetical Order) Atilim Boy (aboy@trunix.org) Baris Simsek (simsek@acikkod.org) Ismail Yenigul (ismail@enderunix.org) Murat Balaban (murat@enderunix.org) Omer Faruk Sen (ofsen@enderunix.org) isoqlog-devel/COPYING0100644000175000000000000000354510044133601013664 0ustar muratwheel Copyright (c) 2002,2004 , EnderUNIX SDT All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the EnderUNIX Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EnderUNIX Software Development Team @ Turkiye Thu Apr 29 10:58:31 EEST 2004 isoqlog-devel/ChangeLog0100644000175000000000000001042310044133601014374 0ustar muratwheel Isoqlog Version History - Development - Version 2.2-BETA April 29, 2004 * Postfix virtual domain handling support * Parser module re-written, many functionality and security fixes. * The quick link added in Domain's and General's homepages that is about last day statistics. * Some html's name has been changed. * Incorporated Steve Crowder's [steve at crowders dot org] tarball (about validated HTML). All Html files should be valid HTML 4.01 now!. * L_Encoding is processed, and has a meaning now. It's processed according to the lang file. Deafult encoding is iso-8859-1. * Some cosmetic fixes on HTML template files, and isoqlog.conf by Dan Langille [dan at langille dot org] - Version 2.1.1 October 14, 2003 * Exim MTA support by Marco Erra * Czech language support by Lukas Maly im at lukasmaly.net * Romanian language translation by Gelu.Constantin at anofm.ro * missing fclose()'s added. Thanks manu - manu at asp.be * Danish translation by "Christian Kurek" * a parser bug was patched by "Koh Swee Meng" Parser.c:44 * Autotool scripts written from scratch - Version 2.1 January 03, 2003 * Some more lang files * bugfixes and patches from 2.0-current are merged into release branch. - Version 2.0-current July 17, 2002 * Postfix bug fix * Html.c:1322 "%d" -> "%d/" - Version 2.0 July 16, 2002 * lowercase function bug is fixed * Language support is activated * Configuration script is corrected * Up and home buttons is added end of htmls - Version 2.0beta June 15, 2002 * New Isoqlog has been re * written from scratch in C. * Faster log analysis and reporting * Multi * MTA support (Isoqlog can read and analyze qmail(multilog/syslog) sendmail and postfix mail server logs. * HTML Templates. By changing the html templates, and the .css file you can completely customize the way your stats look. * - Version 1.7 May 17 2001 * changes made by R. Hutchinson hutch@midwales.com * I have tidied up the html, added some more MBorKBs and created a var called $Debug, which if set to 0 no more screen output * Also more errors displayed * Formatted the code with tabs for ease of reading * The reason for using the perl qq function is that it is easy to drop html into the code from elsewhere. * Created some more subs: &makehtmlheader &makemenu &display_time * modified existing sub EnderUnixTeam to work in the same way, content unchanged - Version 1.5 Stable 12 April 2001 * Spanish language support has been added (Thanks to cad_vga ) (18 April 2001) * Portuguese language support has been added (Thanks to Edson Lima Monteiro ) (16 April 2001) * 0 MB problem corrected . if your domains total byte is less than 1MB , it will be printed as a KB * * Full Language Support has been added * Strange "<" characters has been removed :) - Version 1.5 6 Mar 2001 * All codes are rewritten , now isoqlog is more functional * multilog support has been given * User based incoming mail top scores has been added for every your domain that you define * User based outgoing mail top scores has been added for every your domain that you define * User based total mail top scores has been added for every your domain that you define * User based byte top scores has been added for every your domain that you define * Domain based byte top scores has been added * minus( * ) mail values at top scores part is corrected * Giving Full Langugaga support (15 Mar 2001) * 0 MB values changed to KB when total byte values less than 1 MB (15 Mar 2001) * More clear Documentation (16 Mar 2001 Thanks to Murat Balaban ) - Version 1.4 15 Feb 2001 * Multi Domains Support added * Displaying Top Domains is corrected * Wrong Date Info is corrected - Version 1.3.1 1 October 2000 * Year bug is fixed .for example if time is 1 February 2001 and your log file is October 2000 it will be included in 2001 year output file * Version 1.2 28 November 2000 * Domains bug is fixed . if your domain is qmail.org ,IsoQlog count qmail.org.tr qmail.org.us ,... http://www.enderunix.org Tue Oct 14 08:44:21 EEST 2003 isoqlog-devel/EnderUNIX0100644000175000000000000000704707742707144014342 0ustar muratwheelWhat is EnderUNIX? =-=-=-=-=-=-=-=-=- EnderUNIX SDT (Open Source Software Development Team), is a bunch of people who gathered to develop free software for Open Source community from Turkey. They are some people who realized the importance of "sharing" in their hearts, and distributing software for public use. Topic Interested =-=-=-=-=-=-=-=- As a team, our main goal is to develop useful programs, that will run platform-independetly on any *NIX flavor. Besides you are going to see some Turkish HELP/HOWTO for *BSD systems. They may be either translations to Turkish, or written from scratch. Softwares =-=-=-=-= 1)Hafiye Hafiye is a POSIX-compliant, customizable TCP/IP packet sniffer. Instead of interpreting protocols according to the data structures supplied by the operating system, it interprets Layer II, III, and IV as well as the payload, according to the knowledge base that it constructs from the user-supplied protocol configuration files. www.EnderUNIX.ORG/hafiye/ 2)Aget EnderUNIX Aget is a multi-threaded application that can accelarate your downloads. For the time being, the program supports HTTP downloads and can be run from the console. The future plans for the program include developing a GUI and supporting FTP protocol as well as intelligently managing multiple downloads. www.EnderUNIX.ORG/aget/ 3)spamGuard Nearly all of today's mail system administrators face spam as their first threat. Because of this, EnderUNIX team has written a small application to automagically monitor malicious spammer activity in your mail server logs. spamGuard is written purely in C, to stop spammers hanging around.The program supports qmail (multilog/syslog) Sendmail and Postfix. www.EnderUNIX.ORG/spamguard/ 4) QLdapAdmin QLDAPAdmin is a series of tools that controls the LDAP databases which are used to store account information for Qmail users. It is written in C . With the help of QLDAPAdmin tools, you can: create/delete/modify virtual domains create/delete/modify virtual domain users change users' password, mailhost (for qmail clusters), mailquota, mail directory create alternate/forwarding addresses for one maibox List all qmail domains/domain users .... www.EnderUNIX.ORG/qldapadmin/ 5)Vpwd2SQL EnderUNIX Vpwd2SQL is a tool, written in PERL that is used to convert '/etc/shadow or /etc/master.passwd' accounts to vpopmail accounts. www.EnderUNIX.ORG/vpw2sql/ 6)IsoQlog Isoqlog is qmail log analysis program written in C. It designed to scan qmail logfiles and produce usage statistics in HTML format for viewing through a browser. It produces Top domains output according to Incoming , Outgoing , total mails and bytes, it keeps your main domain mail statistics for per day, per month and per year. This tool is used by many *large* scale organizations. www.EnderUNIX.ORG/isoqlog 7) Knowlan Knowlan is ARP protocol based Local Area Network IP and MAC Adress Extractor. Knowlan uses libpcap and libnet libraries for to be simple to handle and to have a simple code for any interestor to deal with the code. To describe knowlan overally, Knowlan, sends ARP REQUEST packets to the LAN, and at the same time, It recieves ARP REPLY packets from the up machines. So, It prints out IP and MAC addresses of online machines. www.EnderUNIX.ORG/knowlan More to come check http://www.enderunix.org/index.php?lang=en&tab=soft for updates.. Documents =-=-=-=-= Since there are lots of documents that can not be mentioned here. You can see list of documents that is written in Turkish and/or English from http://www.enderunix.org/index.php?lang=en&tab=docs address isoqlog-devel/FAQ0100644000175000000000000000055510044133601013161 0ustar muratwheel ISOQLOG FAQ ----------------------------- Q. I notice that I can see size of sent messages, but I can't see size of incoming meesages A. Because logs only show size for "from" addresses, but not "to" addresses. Additionally because of the inconsistency of log files, one ID may show up for other mails as well. But this will be fixed in isoqlog 3.0 isoqlog-devel/INSTALL0100644000175000000000000000374110044133601013660 0ustar muratwheelIsoqlog 2.2.x INSTALL - Installation 1. ./configure If you would like to use default options just type 'configure' To see more options type 'configure --help' 2. make Compiling... 3. make install Installing... 4. make clean Removing objects files... copy images and library directory that under htmltemp directory to isoqlog output directory 5. cp -pr ./htmltemp/images ./htmltemp/library isoqlogoutputdir/ 6. You can run isoqlog more than once in a day, though you must run at least once before 00:00 (i.e. 23:58) to get current day's statistics. 7. If you're using postfix, sendmail or qmail-syslog, it is strongly suggested you rotate your log files to get the data healthier. # crontab -e 58 * * * * /usr/local/bin/isoqlog 1>/dev/null 2>/dev/null this will run isoqlog every hour at 58. minute That's all IMPORTANT NOTE: If you type make and get an error like: Makefile line:XXX need an operator, you better use gmake, not make. - Files When you untar package, you should see following files and directories: Makefile -> You know what is this. configure -> Prepares your system for custom installations. isoqlog.conf -> Configuration file. (more isoqlog.conf) isoqlog.domains -> Domains htmltemp -> Contains HTML output templates. Edit them if you would like. - After installation Don't forget! If you configure your system with 'configure --prefix=install_dir' edit isoqlog.conf and change prefix variables. Also change others. NOTE: An important thing to note here is that; keep the size of your log file large. if you're using qmail with multilog, you can set this in the qmail-send/log/run file with the s (size) parameter like this: (all in one line) #!/bin/sh exec /usr/local/bin/setuidgid \ qmaill /usr/local/bin/multilog t s5000000 \ /var/log/qmail if you're using syslog, change the rotate size. PROBLEMS If you have trouble with GNU style configuration/installation please try Makefile.std cp Makefile.std Makefile make make install isoqlog-devel/Makefile.am0100644000175000000000000000345307742730630014703 0ustar muratwheel SUBDIRS = isoqlog tr EXTRA_DIST = AUTHORS ChangeLog COPYING EnderUNIX FAQ INSTALL NEWS README README.Turkish TODO install-data-local: $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/AUTHORS /usr/local/share/doc/isoqlog/AUTHORS $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/ChangeLog /usr/local/share/doc/isoqlog/ChangeLog $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/COPYING /usr/local/share/doc/isoqlog/COPYING $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/EnderUNIX /usr/local/share/doc/isoqlog/EnderUNIX $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/FAQ /usr/local/share/doc/isoqlog/FAQ $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/INSTALL /usr/local/share/doc/isoqlog/INSTALL $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/NEWS /usr/local/share/doc/isoqlog/NEWS $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/README /usr/local/share/doc/isoqlog/README $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/README.Turkish /usr/local/share/doc/isoqlog/README.Turkish $(mkinstalldirs) /usr/local/share/doc/isoqlog/ $(INSTALL_DATA) $(srcdir)/TODO /usr/local/share/doc/isoqlog/TODO uninstall-local: -rm -f /usr/local/share/doc/isoqlog/AUTHORS -rm -f /usr/local/share/doc/isoqlog/ChangeLog -rm -f /usr/local/share/doc/isoqlog/COPYING -rm -f /usr/local/share/doc/isoqlog/EnderUNIX -rm -f /usr/local/share/doc/isoqlog/FAQ -rm -f /usr/local/share/doc/isoqlog/INSTALL -rm -f /usr/local/share/doc/isoqlog/NEWS -rm -f /usr/local/share/doc/isoqlog/README -rm -f /usr/local/share/doc/isoqlog/README.Turkish -rm -f /usr/local/share/doc/isoqlog/TODO AUTOMAKE_OPTIONS = foreign isoqlog-devel/Makefile.dist0100644000175000000000000000070107617675536015260 0ustar muratwheelall: @echo "This Makefile is only for the CVS repository" @echo "This will be deleted before making the distribution" @echo "" @if test ! -d admin; then \ echo "Please recheckout this module!" ;\ echo "for cvs: use checkout once and after that update again" ;\ echo "for cvsup: checkout kde-common from cvsup and" ;\ echo " link kde-common/admin to ./admin" ;\ exit 1 ;\ fi $(MAKE) -f admin/Makefile.common cvs .SILENT: isoqlog-devel/NEWS0100644000175000000000000000000007617675536013345 0ustar muratwheelisoqlog-devel/README0100644000175000000000000000327210044133601013506 0ustar muratwheel Isoqlog Version 2.2-BETA What is Isoqlog ---------------- Isoqlog is an MTA log analysis program written in C . it designed to scan qmail, postfix, sendmail, exim logfile and produce usage statistics in HTML format. for viewing through a browser. It produces Top domains output according to Incoming , Outgoing , total mails and bytes, it keeps your main domain mail statistics with Days Top Domain, Top Users values for per day , per month ,and years. Features: -------- * Multi MTA support(qmail (multilog and syslog), postfix, sendmail, exim) * Multi-domain support: Shows quite detailed statistics for not only your main domain, but also, any domain you want. * Displays statistics for common mail delivery errors. * For each domain you specify; displays Top incoming, outgoing, total and byte based statistics for users. * Displays server's activity based on incoming, outgoing, total mails and size of incoming mail, for domain and its users. * All days', all months', all years' activities ( above ones ) are stored for future inspection. * Multi-language Support ( Turkish, English, German,Portuguese,Spanish ,Italian,french, Swedish, Dutch, Polish, Norwegian, Russian, Czech, Romanian, Danish) The Latest Version ------------------ Details of the latest version can be found at http://www.enderunix.org/isoqlog Installation ------------ Read INSTALL file for installation instructions. Licensing --------- Please see the file called COPYING. Isoqlog is tested on FreeBSD 4.9-Stable Solaris 2.8(Sparc) Slackware Linux, Redhat 6.2,7.2,8.0,9.0, OpenBSD-3.3, HP-UX 11.11 EnderUNIX Software Development Team -- http://www.enderunix.org Thu Apr 29 11:01:05 EEST 2004 isoqlog-devel/README.Turkish0100644000175000000000000000007407617675536015171 0ustar muratwheelTurkce Kurulum ve Konfigurasyon icin ./tr dizinine bakiniz isoqlog-devel/TODO0100644000175000000000000000151210044133601013311 0ustar muratwheel ISOQLOG TODO ************ * Fabrice LABORIE reports: is a domain is listed in Top 100 Receiver Domain but is NOT in Top 100 domains Sender it will not appear in the Top 100 Domain although it potentially received mails alone that some other send+receive ! This is probably true for some high traffic domain for which a server acts as a relay. ( MX). So it's not really a bug, but probably more a feature request ... * Tomasz Klim reports:[ismail] I need to hide extra recipient, defined in extra.h. * Old days' log processing.[ismail] * Callculate Total traffic [ismail] * Ignore user defined mail addresses such as postmaster, root ... * Common error reports. * Apply FreeBSD coding style to code. * Image representation of statistics using GD library * Performance optimization * Fix Bugs. (no need to mention?) isoqlog-devel/autogen.sh0100755000175000000000000000653410043712754014646 0ustar muratwheel#! /bin/sh #Taken from KDE project with conformance to FreeBSD binary layout! # Global variables... echo "***********************************************************" echo "Make SURE you have installed automake and autoconf packages" echo "***********************************************************" sleep 1; AUTOCONF="autoconf" AUTOHEADER="autoheader" AUTOM4TE="autom4te" AUTOMAKE="automake" ACLOCAL="aclocal" # We don't use variable here for remembering the type ... strings. # local variables are not that portable, but we fear namespace issues with # our includer. The repeated type calls are not that expensive. checkAutoconf() { if test -x "`$WHICH autoconf253`";then AUTOCONF="`$WHICH autoconf253`" elif test -x "`$WHICH autoconf257`" ; then AUTOCONF="`$WHICH autoconf257`" elif test -x "`$WHICH autoconf258`" ; then AUTOCONF="`$WHICH autoconf258`" elif test -x "`$WHICH autoconf259`" ; then AUTOCONF="`$WHICH autoconf259`" elif test -x "`$WHICH autoconf-2.5x`" ; then AUTOCONF="`$WHICH autoconf-2.5x`" elif test -x "`$WHICH autoconf-2.53`" ; then AUTOCONF="`$WHICH autoconf-2.53`" elif test -x "`$WHICH autoconf-2.52`" ; then AUTOCONF="`$WHICH autoconf-2.52`" elif test -x "`$WHICH autoconf2.50`" ; then AUTOCONF="`$WHICH autoconf2.50`" elif test -x "`$WHICH autoconf`";then AUTOCONF="`$WHICH autoconf`" fi } checkAutoheader() { if test -x "`$WHICH autoheader253`";then AUTOCONF="`$WHICH autoheader253`" elif test -x "`$WHICH autoheader258`" ; then AUTOCONF="`$WHICH autoheader258`" elif test -x "`$WHICH autoheader259`" ; then AUTOCONF="`$WHICH autoheader259`" elif test -x "`$WHICH autoheader-2.5x`" ; then AUTOHEADER="`$WHICH autoheader-2.5x`" AUTOM4TE="`$WHICH autom4te-2.5x`" elif test -x "`$WHICH autoheader-2.53`" ; then AUTOHEADER="`$WHICH autoheader-2.53`" AUTOM4TE="`$WHICH autom4te-2.53`" elif test -x "`$WHICH autoheader-2.52`" ; then AUTOHEADER="`$WHICH autoheader-2.52`" elif test -x "`$WHICH autoheader2.50`" ; then AUTOHEADER="`$WHICH autoheader2.50`" elif test -x "`$WHICH autoheader`" ; then AUTOHEADER="`$WHICH autoheader`" fi } checkAutomakeAclocal () { if test -z "$UNSERMAKE"; then if test -x "`$WHICH automake18`" ; then AUTOMAKE="`$WHICH automake18`" ACLOCAL="`$WHICH aclocal18`" elif test -x "`$WHICH automake-1.5`" ; then AUTOMAKE="`$WHICH automake-1.5`" ACLOCAL="`$WHICH aclocal-1.5`" elif test -x "`$WHICH automake-1.6`" ; then AUTOMAKE="`$WHICH automake-1.6`" ACLOCAL="`$WHICH aclocal-1.6`" elif test -x "`$WHICH automake`" ; then AUTOMAKE="`$WHICH automake`" ACLOCAL="`$WHICH aclocal`" fi else AUTOMAKE="$UNSERMAKE" fi } checkWhich () { WHICH="" for i in "type -p" "which" "type" ; do T=`$i sh` test -x "$T" && WHICH="$i" && break done } checkWhich checkAutoconf checkAutoheader checkAutomakeAclocal export WHICH AUTOHEADER AUTOCONF AUTOM4TE AUTOMAKE ACLOCAL echo "Execing $ACLOCAL" $ACLOCAL || echo "Can not find aclocal on your system. Install it" # >/dev/null 2>/dev/null echo "...Done" echo "Execing $AUTOMAKE" $AUTOMAKE -ac || echo "Can not find automake on your system. Install it" # >/dev/null 2>/dev/null echo "...Done" echo "Execing $AUTOCONF" $AUTOCONF || echo "Can not find autoconf on your system. Install it" #>/dev/null 2>/dev/null echo "...Done" isoqlog-devel/configure.in0100644000175000000000000000237510044133601015142 0ustar muratwheel# Process this file with autoconf to produce a configure script. AC_INIT(isoqlog, 2.2-BETA, bug-report@enderunix.org) AC_CANONICAL_SYSTEM AC_CONFIG_SRCDIR([isoqlog/Global.h]) AM_CONFIG_HEADER(isoqlog/config.h) #AC_CONFIG_HEADER macro used by autoheader #AC_CONFIG_HEADER(isoqlog/config.h) AM_INIT_AUTOMAKE(isoqlog, 2.2-BETA) # Checks for programs. AC_PROG_CC unset CDPATH dnl make /usr/local the default for the installation #AC_PREFIX_DEFAULT(/usr/local) if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix ac_configure_args="$ac_configure_args --prefix $prefix" fi # Checks for libraries. # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h strings.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_STRUCT_TM # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_STAT AC_CHECK_FUNCS([gethostname memset mkdir strcasecmp strdup strerror strstr]) AC_CONFIG_FILES([ Makefile ]) AC_CONFIG_FILES([ isoqlog/Makefile ]) AC_CONFIG_FILES([ isoqlog/htmltemp/Makefile ]) AC_CONFIG_FILES([ isoqlog/htmltemp/images/Makefile ]) AC_CONFIG_FILES([ isoqlog/htmltemp/library/Makefile ]) AC_CONFIG_FILES([ isoqlog/lang/Makefile ]) AC_CONFIG_FILES([ tr/Makefile ]) AC_OUTPUT isoqlog-devel/tr/0040755000175000000000000000000010055616055013265 5ustar muratwheelisoqlog-devel/tr/BENIOKU0100644000175000000000000000323610044133601014272 0ustar muratwheel Isoqlog Versiyon 2.2-BETA Isoqlog Nedir? Isoqlog C dilinde yazilmis bir MTA log analiz programidir. Qmail, Postfix, Senmail log dosyalarini tarayarak gerekli istatistiklerin HTML formatinda tarayicilarda gorulmesini saglar. Istatistikler Gonderici, Alici, Toplam gonderilen mail ve buyuklugune ve sayisina gore tutulmanin yanisira gunluk, aylik ve yillik en cok kullanilan email ve domain ciktisinda yer alir. Ozellikler Coklu MTA destegi (qmail (multilog and syslog), postfix, sendmail, exim) Coklu domain destegi. Ana domain hakkinda detayli istatistik cikarmanin yani sira istenen domainler icin detayli istatistik cikartabilir. Genel mail iletim hatalarinin istatistiklerini gosterir. Her bir domaindeki userlar icin toplam gelen ve giden mail istatistiklerini tutar. Sunucunun aktivitesini gelen, giden mail aktivitesi, domain icin toplam giden ve gelen mail istatistilerini tutar ve gosterir. Gunluk, aylik ve yillik istatistikler daha sonraki incelemer icin tutulur. Coklu dil destegi ( Turkish, English, German,Portuguese,Spanish ,Italian,french, Swedish, Dutch, Polish, Norwegian, Russian, Czech) En Son haberler ------------------ Detaylar http://www.enderunix.org/isoqlog adresinde bulunabilir. Kurulum ------------ Kurulum icin KURULUM dokumanini okuyunuz Lisans --------- Lutfen KOPYALAMA dosyasini okuyunuz. Isoqlog FreeBSD 4.9-Stable Solaris 2.8(Sparc) Slackware Linux, Redhat 6.2,7.2 ,8.0, 9.0 OpenBSD-3.2 isletim sistemlerinde test edilmis ve problemsiz calismistir. EnderUNIX Software Development Team -- http://www.enderunix.org Thu Apr 29 11:02:33 EEST 2004 isoqlog-devel/tr/DEGISIKLIKLER0100644000175000000000000001044510044133601015160 0ustar muratwheel Isoqlog Versiyon Degisiklikleri - Gelistirme Versiyonu - Version 2.2-BETA 29 Nisan 2004 * Parser modulu yeniden yazildi. Guvenlik taramasi yapildi, fixler yapildi. * Postfix Virtual Domain handling * Lukas Maly im at lukasmaly.net tarafindan yazilan Cek dil destegi eklendi. * Marco Erra tarafindan exim mail sunucu destegi eklendi * Danis translation by "Christian Kurek" * Romanian dil dosyasi Gelu.Constantin at anofm.ro tarafindan yollandi. * missing fclose()'s added. Thanks manu - manu at asp.be * "Koh Swee Meng" Parser.c:44 hatasini duzelten bir yama yollamistir. * Autotool betikleri en bastan yazildi - Version 2.1 Ocak 03, 2003 * Birkac dil dosyasi eklendi * 2.0-current de yapilan hata duzeltemeleri ve yamalari bu release' eklendi - Version 2.0-current Haziran 17, 2002 * Postfix bug 'i duzeltildi * Html.c:1322 "%d" -> "%d/" - Versiyon 2.0 Temmuz 16, 2002 * lowercase fonksiyonundaki sorun giderildi. * configure script i duzeltildi * Dil destegi aktif hale getirildi * Yukari ve Ana sayfa butonlari eklendi - Versiyon 2.0beta Haziran 15, 2002 * Yeni Isoqlog tamamen C dili ile en bastan yazilmistir. * Daha hizli log analiz ve raporlama gerceklestirilmistir. * Coklu MTA destegi eklenmistir (Isoqlog qail(multilog/syslog) sendmail and postfix mail sunucusu loglarini analiz edebilir. * HTML Templates. Html templates ve .css dosyalarini degistirerek istatistik dosyalarinizin gorunusunu tamamen degistirebilirsiniz. * Dunun istatisklerinin taramasi yerine artik bugununde istatistikleri taranabilir. * Multilog-rotate temizlendi. Boylece Isoqlog butun log/ dizinini okur ve sadece o gunun maillerini isler. * Az trafikli mail server problemi cozuldu. Boylece current dosyasi gunun sonunda rotate islemine ugramasa bile problemle karsilasilmaz. * Onceki bilgiler ikili log formatinda tutularak programin bilgileri daha hizli islemsi saglanmistir. of history. * Daha fazla ozellestirilme destegi verilmistir. Programi tekrar derlemeden MTA log dosyasinin format degisiklikleri havada uygulanabilir * GNU stilinde ./configure && make && make install kurulumu oldukca kolaylastirmistir. - Versiyon 1.7 Mayis 17 2001 * R. Hutchinson hutch@midwales.com tarafindan degisiklikler yapilmistir: * Html uzerinde degisiklikler yapildi ve MBorKBs eklenid ayrica eger 0 olarak ayarlanirsa ekrana cikti vermeyen $Debug degiskeni eklendi * Daha fazla hata mesajlari gorulur. * Kod kolay okunulabilirlik icin tab ile tekrar formatlanmistir. * Perl qq fonksiyonlari kullanilarak farkli bir koddan html kodu cagrilmasi kolay hale getirilmistir. * Yeni sub 'lar: &makehtmlheader &makemenu &display_time * EnderUnixTeam sub' inin degismesi degistirilmemistir . - Versiyon 1.5 Stable 12 Nisan 2001 * Ispanyolca dil destegi eklenmistir ( cad_vga ) (18 Nisan 2001) * Portekizce dil destegi (Thanks to Edson Lima Monteiro ) (16 Nisan 2001) * 0 MB problemlemi duzeltildi . Eger domain'e gelen mail buyuklugu 1 MB'tan kucukse KB kullanilacaktir. * Dil destegi eklenmistir. * Garip < karakteri problemi giderilmistir. - Version 1.5 6 Mart 2001 * Butun kod en basta yazilmistir. * multilog destegi verilmistir. * Kullanici tabanli en cok gelen mail destegi her bir domain icin verilmistir. * Kullanici tabanli en cok giden mail destegi her bir domain icin verilmistir. * Kullanici tabanli en cok mail, toplam skor tanimlanan herbir domain icin verilmistir. * Kullanici tabanli mail buyuklugu destegi verilmisitir. * Domain tabali en cok mail destegi verilmistir. * En cok kullanilan kismindaki - problemi duzeltilmistir. * Giving Full Langugaga support (15 Mar 2001) * 0 MB values changed to KB when total byte values less than 1 MB (15 Mar 2001) * More clear Documentation (16 Mar 2001 Thanks to Murat Balaban ) - Versiyon 1.4 15 Subat 2001 * Coklu domain destegi verilmistir. * En cok kullanilan domain duzeltilmistir. * Yanlis gun tarihi problemi duzeltilmistir. - Version 1.3.1 1 Ekim 2000 * Yil hatasi duzeltilmistir. * Version 1.2 28 November 2000 * Domain hatasi duzeltilmistir. http://www.enderunix.org Thu Apr 29 11:04:06 EEST 2004 isoqlog-devel/tr/HABERLER0100644000175000000000000000000207617675536014404 0ustar muratwheel isoqlog-devel/tr/KOPYALAMA0100644000175000000000000000354410044133601014516 0ustar muratwheel Copyright (c) 2002,2004 EnderUNIX SDT All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the EnderUNIX Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EnderUNIX Software Development Team @ Turkiye Thu Apr 29 11:04:33 EEST 2004 isoqlog-devel/tr/KURULUM0100644000175000000000000000314010044133601014334 0ustar muratwheelIsoqlog 2.2-BETA Kurulumu - Kurulum 1. ./configure Eger varsayilan opsiyonlari istiyorsaniz sadece "configure" (tirnak isaretleri yok) diyebilirsiniz. Daha fazla bilgi icin 'configure --help' yaziniz. 2. make Derleniyor... 3. make install Kuruluyor... 4. make clean Object dosyalari siliniyor... 5. cp -pr ./htmltemp/images ./htmltemp/library isoqlogciktidizini/ images ve library dizinini ustteki gibi hedef sizin isoqlogciktidizini olacak sekilde kopyalayiniz. 6. Isoqlog'u ayni gun icersinde birden fazla sekilde calistirabilirsiniz. Ama o gunku istatistikleri almak icin mutlaka saat 00:00 (mesela 23:58) once bir defa calistirilmalidir. 7. Eger postfix, sendmail ya da qmail-syslog kullaniyorsaniz log dosyalarinizi rotate etmenizi daha saglikli bir sonuc almaniz icin oneririz. # crontab -e 58 * * * * /usr/local/bin/isoqlog 1>/dev/null 2>/dev/null Ustteki isoqlog'u her saat'in 58. dakikasinda calistiracaktir Hepsi bu kadar Onemli NOT: Eger assagidaki gibi bir hata aliyorsaniz: Makefile line:XXX need an operator, make yerine gmake kullanin. - Dosyalar Paketi acinda su dizinler ve dosyalar acilacaktir: Makefile -> Ne oldugunu zaten biliyorsunuz. configure -> Bununda ne oldugu bilinmektedir. isoqlog.conf -> Konfigurasyon dosyasi. (more isoqlog.conf) htmltemp -> HTML cikti template'lerini icerir. Istediginiz gibi degistirebilirsiniz - Kurulumdan sonra Eger isoqlog'u 'configure --prefix=install_dir' ile kurarsaniz isoqlog.conf dosyasinda prefix degiskenini ve diger degiskenleri degistirmeyi unutmayin. Thu Apr 29 11:04:54 EEST 2004 isoqlog-devel/tr/Makefile.am0100644000175000000000000000224407742730631015326 0ustar muratwheel EXTRA_DIST = BENIOKU DEGISIKLIKLER HABERLER KOPYALAMA KURULUM YAZARLAR install-data-local: $(mkinstalldirs) /usr/local/share/doc/isoqlog/tr/ $(INSTALL_DATA) $(srcdir)/BENIOKU /usr/local/share/doc/isoqlog/tr/BENIOKU $(mkinstalldirs) /usr/local/share/doc/isoqlog/tr/ $(INSTALL_DATA) $(srcdir)/DEGISIKLIKLER /usr/local/share/doc/isoqlog/tr/DEGISIKLIKLER $(mkinstalldirs) /usr/local/share/doc/isoqlog/tr/ $(INSTALL_DATA) $(srcdir)/HABERLER /usr/local/share/doc/isoqlog/tr/HABERLER $(mkinstalldirs) /usr/local/share/doc/isoqlog/tr/ $(INSTALL_DATA) $(srcdir)/KOPYALAMA /usr/local/share/doc/isoqlog/tr/KOPYALAMA $(mkinstalldirs) /usr/local/share/doc/isoqlog/tr/ $(INSTALL_DATA) $(srcdir)/KURULUM /usr/local/share/doc/isoqlog/tr/KURULUM $(mkinstalldirs) /usr/local/share/doc/isoqlog/tr/ $(INSTALL_DATA) $(srcdir)/YAZARLAR /usr/local/share/doc/isoqlog/tr/YAZARLAR uninstall-local: -rm -f /usr/local/share/doc/isoqlog/tr/BENIOKU -rm -f /usr/local/share/doc/isoqlog/tr/DEGISIKLIKLER -rm -f /usr/local/share/doc/isoqlog/tr/HABERLER -rm -f /usr/local/share/doc/isoqlog/tr/KOPYALAMA -rm -f /usr/local/share/doc/isoqlog/tr/KURULUM -rm -f /usr/local/share/doc/isoqlog/tr/YAZARLAR isoqlog-devel/tr/YAZARLAR0100644000175000000000000000036307742707145014446 0ustar muratwheel IsoqLog YAZARLARI ---------------------- (Alfabetik Siraya Gore) Atilim Boy (aboy@trunix.org) Baris Simsek (simsek@acikkod.org) Ismail Yenigul (ismail@enderunix.org) Murat Balaban (murat@enderunix.org) Omer Faruk Sen (ofsen@enderunix.org)