Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for libplaton/utils/meetmail/meetmail.c between version 1.1 and 1.2

version 1.1, 2003/01/03 14:56:05 version 1.2, 2003/01/04 10:14:43
Line 9 
Line 9 
  *  All rights reserved.                                                  *   *  All rights reserved.                                                  *
  *                                                                        *   *                                                                        *
  *  Updates:                                                              *   *  Updates:                                                              *
  *    17.7.2000, 15.09.2000, 5.10.2000                                    *   *    17/7/2000, 15/09/2000, 5/10/2000                                    *
  *    19.1.2001 - doplnena sprava hlavicky Errors-To                      *   *    19/1/2001 - added 'Errors-To' header handling                       *
  *     5.3.2001 - opraveny bug pri spracovani prazdneho Subject-u         *   *     5/3/2001 - fixed bug with empty 'Subject' line                     *
  *    19.4.2001 - zmena nazvu z 'konfmail' na 'meetmail'                  *   *    19/4/2001 - changed name from 'konfmail' to 'meetmail'              *
  *    14.5.2001 - upraveny BUG s CONFFILENAMESIZE                         *   *    14/5/2001 - fixed bug with CONFFILENAMESIZE                         *
  *     3.1.2003 - import into CVS; project libplaton directory utils      *   *     3/1/2003 - import into CVS; project 'libplaton' directory 'utils'  *
    *              - made meetmail to work with libplaton library            *
  *                                                                        *   *                                                                        *
  **************************************************************************/   **************************************************************************/
   
Line 25 
Line 26 
 #include <platon/str/strctype.h>  #include <platon/str/strctype.h>
   
 #ifndef __PRGVERSION__  #ifndef __PRGVERSION__
 #  define __PRGVERSION__        "0.3.2"  #  define __PRGVERSION__        "0.3.2"
 #endif  #endif
   
 #define MEETMAILSTR     \  #define MEETMAILSTR     \
Line 38 
Line 39 
 #define XOLDSTR                 "X-Old"  #define XOLDSTR                 "X-Old"
 #define DEFSUBJECTSTR   "(ziadny predmet)"  #define DEFSUBJECTSTR   "(ziadny predmet)"
   
 #define BUFSIZE 501  #define BUFSIZE                                 501
   
 #define CONFNAMESIZE                    30  #define CONFNAMESIZE                    30
 #define CONFERRORSTOSIZE                50  #define CONFERRORSTOSIZE                50
Line 64  int main(int argc, char **argv)
Line 65  int main(int argc, char **argv)
         int eol_count = 0;          int eol_count = 0;
         FILE *f;          FILE *f;
   
         /* Informations and help */          /* Information and help */
         if (argc < 3) {          if (argc < 3) {
                 printf("meetmail - MS-Dos/UNIX conference e-mail modifier" \                  printf("meetmail - MS-Dos/UNIX conference e-mail modifier"
                                 " v%s / %s %s\n",__PRGVERSION__,__DATE__,__TIME__);                                  " v%s / %s %s\n",__PRGVERSION__,__DATE__,__TIME__);
                 puts("Developed by Ondrej Jombik, " \                  puts("Developed by Ondrej Jombik, " \
                                 "e-mail: nepto@pobox.sk, Web: http://nepto.sk/");                                  "e-mail: nepto@pobox.sk, web: http://nepto.sk/");
                 puts("(c) Copyright 2001-2003 Platon SDG, http://www.platon.sk/, "                  puts("Copyright (c) 2001-2003 Platon SDG, http://www.platon.sk/, "
                                 "All rights reserved.");                                  "All rights reserved.");
   
                 puts("\nUsage: meetmail <Name> <errors-to-e-mail-address> " \                  puts("\nUsage: meetmail <Name> <errors-to-e-mail-address> "
                                 "[<address>] [<infofile>]");                                  "[<address>] [<infofile>]");
                 puts("default address: name@pobox.sk, " \                  puts("default address: name@pobox.sk, " \
                                 "default infofile: conf.name.txt");                                  "default infofile: conf.name.txt");
Line 87  int main(int argc, char **argv)
Line 88  int main(int argc, char **argv)
   
         /* confadminemail */          /* confadminemail */
         strncpy(conferrorsto, argv[2], CONFERRORSTOSIZE);          strncpy(conferrorsto, argv[2], CONFERRORSTOSIZE);
         confname[CONFERRORSTOSIZE] = '\0';          confname[CONFERRORSTOSIZE] = '\0';
   
         /* confaddress */          /* confaddress */
         if (argc > 3) {          if (argc > 3) {
Line 120  int main(int argc, char **argv)
Line 121  int main(int argc, char **argv)
   
         /* E-mail headers alternation ("Subject:", "Reply-to:") */          /* E-mail headers alternation ("Subject:", "Reply-to:") */
         while (fgets(buf, BUFSIZE, stdin) != NULL) {          while (fgets(buf, BUFSIZE, stdin) != NULL) {
                 /* Modifikacia subjectu. */                  /* Subject modification */
                 if (strstr(buf, SUBJECTSTR) == buf) {                  if (strstr(buf, SUBJECTSTR) == buf) {
                         char*pom;                          char*pom;
                         if ((pom = (char*)malloc(strlen(confname)+2+1)) == NULL) {                          if ((pom = (char*)malloc(strlen(confname)+2+1)) == NULL) {
Line 148  int main(int argc, char **argv)
Line 149  int main(int argc, char **argv)
                                 free(pom);                                  free(pom);
                 }                  }
                 else {                  else {
                         /* Modifikacia "Reply-to:" polozky. */                          /* Header "Reply-to:" altering */
                         if (stristr(buf, REPLYTOSTR) == buf) {                          if (stristr(buf, REPLYTOSTR) == buf) {
                                 fputs(REPLYTOSTR,stdout);                                  fputs(REPLYTOSTR,stdout);
                                 fputc(' ',stdout);                                  fputc(' ',stdout);
Line 156  int main(int argc, char **argv)
Line 157  int main(int argc, char **argv)
                                 fputc('\n',stdout);                                  fputc('\n',stdout);
                                 fReplyToModified=1;                                  fReplyToModified=1;
                         }                          }
                         /* Najdena "X-Conference-Software:" polozka. */                          /* Header "X-Conference-Software:" found */
                         else if (strstr(buf, XCONFSOFTSTR) == buf) {                          else if (strstr(buf, XCONFSOFTSTR) == buf) {
                                 fputs(XCONFSOFTSTR,stdout);                                  fputs(XCONFSOFTSTR,stdout);
                                 fputc(' ',stdout);                                  fputc(' ',stdout);
Line 164  int main(int argc, char **argv)
Line 165  int main(int argc, char **argv)
                                 fputc('\n',stdout);                                  fputc('\n',stdout);
                                 fXConfSoftModified=1;                                  fXConfSoftModified=1;
   
                                 if(strchr(buf,'-')!=NULL){                                  if (strchr(buf, '-') != NULL) {
                                         fputs(XOLDSTR,stdout);                                          fputs(XOLDSTR, stdout);
                                         fputs(strchr(buf,'-'),stdout);                                          fputs(strchr(buf, '-'), stdout);
                                 }                                  }
                         }                          }
                         /* Najdena "Errors-To:" polozka. */                          /* Header "Errors-To:" found */
                         else if(strstr(buf, ERRORSTOSTR) == buf) {                          else if (strstr(buf, ERRORSTOSTR) == buf) {
                                 fputs(ERRORSTOSTR, stdout);                                  fputs(ERRORSTOSTR, stdout);
                                 fputc(' ', stdout);                                  fputc(' ', stdout);
                                 fputs(conferrorsto, stdout);                                  fputs(conferrorsto, stdout);
Line 180  int main(int argc, char **argv)
Line 181  int main(int argc, char **argv)
                                 fputs(XOLDSTR, stdout);                                  fputs(XOLDSTR, stdout);
                                 fputc('-', stdout);                                  fputc('-', stdout);
                                 fputs(buf, stdout);                                  fputs(buf, stdout);
                         }                          }
                         else {                          else {
                                 if(!strcmp(buf,"\n"))break;                                  if (! strcmp(buf, "\n"))
                                           break;
                                 fputs(buf,stdout);                                  fputs(buf,stdout);
                         }                          }
                 }                  }
         } // while(fgets()!=NULL)          }
   
         /* Doplnenie "Subject:" polozky ak chybala. */          /* Adding "Subject:" header if missing */
         if (! fSubjectModified) {          if (! fSubjectModified) {
                 fputs(SUBJECTSTR, stdout);                  fputs(SUBJECTSTR, stdout);
                 fputc(' ', stdout);                  fputc(' ', stdout);
Line 200  int main(int argc, char **argv)
Line 202  int main(int argc, char **argv)
                 fputc('\n', stdout);                  fputc('\n', stdout);
         }          }
   
         /* Doplnenie "Reply-to:" polozky ak chybala. */          /* Adding "Reply-to:" header if missing */
         if (! fReplyToModified) {          if (! fReplyToModified) {
                 fputs(REPLYTOSTR,stdout);                  fputs(REPLYTOSTR,stdout);
                 fputc(' ',stdout);                  fputc(' ',stdout);
Line 208  int main(int argc, char **argv)
Line 210  int main(int argc, char **argv)
                 fputc('\n',stdout);                  fputc('\n',stdout);
         }          }
   
         /* Doplnenie "X-Conference-Software:" polozky ak chybala. */          /* Adding "X-Conference-Software:" header if missing */
         if (! fXConfSoftModified) {          if (! fXConfSoftModified) {
                 fputs(XCONFSOFTSTR,stdout);                  fputs(XCONFSOFTSTR,stdout);
                 fputc(' ',stdout);                  fputc(' ',stdout);
Line 216  int main(int argc, char **argv)
Line 218  int main(int argc, char **argv)
                 fputc('\n',stdout);                  fputc('\n',stdout);
         }          }
   
         /* Doplnenie "Errors-To:" polozky ak chybala. */          /* Adding "Errors-To:" header if missing */
         if (! fErrorsToModified) {          if (! fErrorsToModified) {
                 fputs(ERRORSTOSTR, stdout);                  fputs(ERRORSTOSTR, stdout);
                 fputc(' ', stdout);                  fputc(' ', stdout);
Line 226  int main(int argc, char **argv)
Line 228  int main(int argc, char **argv)
   
         fputc('\n',stdout);          fputc('\n',stdout);
   
         /* Kopirovnanie mailu. */          /* E-mail message copying */
         while (fgets(buf,BUFSIZE,stdin) != NULL) {          while (fgets(buf,BUFSIZE,stdin) != NULL) {
                 fLastBufWasEOL = strchr(buf, '\n') != NULL ? 1 : 0;                  fLastBufWasEOL = strchr(buf, '\n') != NULL ? 1 : 0;
   
Line 240  int main(int argc, char **argv)
Line 242  int main(int argc, char **argv)
                 }                  }
         }          }
   
         /* Uprava konca mailu. Priprava na pridanie info textu. */          /* End of e-mail message altering and preparing e-mail conference
              informational text adding */
         if (!fLastBufWasEOL)          if (!fLastBufWasEOL)
                 fputc('\n',stdout);                  fputc('\n',stdout);
   
         /* Pridanie info textu zo suboru na koniec mailu. */          /* Adding info text from file */
         if ((f = fopen(conffilename, "rt")) != NULL) {          if ((f = fopen(conffilename, "rt")) != NULL) {
                 while (fgets(buf,BUFSIZE,f) != NULL)                  while (fgets(buf,BUFSIZE,f) != NULL)
                         fputs(buf, stdout);                          fputs(buf, stdout);
Line 257  int main(int argc, char **argv)
Line 260  int main(int argc, char **argv)
                                 " with this problem.\n", stdout);                                  " with this problem.\n", stdout);
         }          }
   
         /* Vystrazny text, ak nastalo upravovanie uz upraveneho mailu. */          /* Warning text if already altered e-mail was modified */
         if (fXConfSoftModified) {          if (fXConfSoftModified) {
                 fputs("\n\n--\nMeetmail WARNING: "                  fputs("\n\n--\nMeetmail WARNING: "
                                 "E-mail message was already modified.", stdout);                                  "E-mail message was already modified.", stdout);
Line 266  int main(int argc, char **argv)
Line 269  int main(int argc, char **argv)
         }          }
   
         return 0;          return 0;
   
 }  }
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top