OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp_main.c versions 1.61 and 1.62
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.61 -> 1.62

--- lmtp2nntp_main.c     2003/01/30 19:42:13     1.61
+++ lmtp2nntp_main.c     2003/01/30 19:45:20     1.62
@@ -135,19 +135,19 @@
 }
 
 static var_syntax_t syntax_ctx = {
-    '\\',         /* escape        */ 
-    '$',          /* varinit       */ 
-    '{',          /* startdelim    */ 
-    '}',          /* enddelim      */ 
-    '[',          /* startindex    */ 
-    ']',          /* endindex      */ 
-    '#',          /* current_index */ 
-    "a-zA-Z0-9.-" /* namechars     */ 
+    '\\',         /* escape        */
+    '$',          /* varinit       */
+    '{',          /* startdelim    */
+    '}',          /* enddelim      */
+    '[',          /* startindex    */
+    ']',          /* endindex      */
+    '#',          /* current_index */
+    "a-zA-Z0-9.-" /* namechars     */
 };
 
 static var_rc_t ctx_lookup(
     var_t *var,
-    void *_ctx, 
+    void *_ctx,
     const char *var_ptr, size_t var_len, int var_idx,
     const char **val_ptr, size_t *val_len, size_t *val_size)
 {
@@ -419,7 +419,7 @@
     ctx->config_varregex = NULL;
     ctx->config_varctx = NULL;
     ctx->msgcount = 0;
-    
+
     /* private application context */
     if (val_create(&ctx->prival) != VAL_OK)
         CU(ERR_EXECUTION);
@@ -477,7 +477,7 @@
 
     if (getuid() != ctx->option_uid) {
         if (setuid(ctx->option_uid) == -1) {
-            fprintf(stderr, "%s:Error: Setting UID to %d failed: %s\n", 
+            fprintf(stderr, "%s:Error: Setting UID to %d failed: %s\n",
                     ctx->progname, ctx->option_uid, strerror(errno));
             CU(ERR_EXECUTION);
         }
@@ -532,7 +532,7 @@
          *  In order to make SMTP workable, the following minimum implementation
          *  is required for all receivers: [...]
          *  RFC0821, 4.1.2. COMMAND SYNTAX
-         *  
+         *
          *  Verb Parameter
          *  ----+-------------------------------
          *  HELO <SP> <domain> <CRLF>
@@ -543,7 +543,7 @@
          *  NOOP <CRLF>
          *  QUIT <CRLF>
          */
-        lmtp_register(lmtp, "LHLO", lmtp_cb_lhlo, ctx, NULL, NULL); 
+        lmtp_register(lmtp, "LHLO", lmtp_cb_lhlo, ctx, NULL, NULL);
         lmtp_register(lmtp, "MAIL", lmtp_cb_mail, ctx, NULL, NULL);
         lmtp_register(lmtp, "RCPT", lmtp_cb_rcpt, ctx, NULL, NULL);
         lmtp_register(lmtp, "DATA", lmtp_cb_data, ctx, NULL, NULL);
@@ -628,13 +628,13 @@
             if (bOk) {
                 char *cpA;
                 sa_addr_a2u(ctx->saaIO, &cpA);
-                logbook(ctx->l2, L2_LEVEL_TRACE, "connection from %s accepted due to ACL", cpA); 
+                logbook(ctx->l2, L2_LEVEL_TRACE, "connection from %s accepted due to ACL", cpA);
                 free(cpA);
             }
             else {
                 char *cpA;
                 sa_addr_a2u(ctx->saaIO, &cpA);
-                logbook(ctx->l2, L2_LEVEL_ERROR, "connection from %s refused due to ACL", cpA); 
+                logbook(ctx->l2, L2_LEVEL_ERROR, "connection from %s refused due to ACL", cpA);
                 free(cpA);
                 sa_destroy(ctx->saIO);
                 sa_addr_destroy(ctx->saaIO);
@@ -661,7 +661,7 @@
             /* child must close listening socket */
             sa_destroy(ctx->saServerbind);
             ctx->saServerbind = NULL; /* prevent cleanup from free'ing this again */
-            
+
             /* initialize LMTP context */
             lmtp_io.ctx    = ctx;
             lmtp_io.read   = hook_lmtp_read;
@@ -674,7 +674,7 @@
              *  In order to make SMTP workable, the following minimum implementation
              *  is required for all receivers: [...]
              *  RFC0821, 4.1.2. COMMAND SYNTAX
-             *  
+             *
              *  Verb Parameter
              *  ----+-------------------------------
              *  HELO <SP> <domain> <CRLF>
@@ -685,7 +685,7 @@
              *  NOOP <CRLF>
              *  QUIT <CRLF>
              */
-            lmtp_register(lmtp, "LHLO", lmtp_cb_lhlo, ctx, NULL, NULL); 
+            lmtp_register(lmtp, "LHLO", lmtp_cb_lhlo, ctx, NULL, NULL);
             lmtp_register(lmtp, "MAIL", lmtp_cb_mail, ctx, NULL, NULL);
             lmtp_register(lmtp, "RCPT", lmtp_cb_rcpt, ctx, NULL, NULL);
             lmtp_register(lmtp, "DATA", lmtp_cb_data, ctx, NULL, NULL);
@@ -749,13 +749,13 @@
 
 static lmtp_rc_t lmtp_cb_lhlo(lmtp_t *lmtp, lmtp_io_t *io, lmtp_req_t *req, void *_ctx)
 {
-    /*  
+    /*
      *  RFC0821 [excerpt] 4.1. SMTP COMMANDS
      *  4.1.1.  COMMAND SEMANTICS, HELO
      *  This command and an OK reply to it confirm that both the sender-SMTP
      *  and the receiver-SMTP are in the initial state, that is, there is no
      *  transaction in progress and all state tables and buffers are cleared.
-     * 
+     *
      *  The first command in a session must be the HELO command.  The HELO
      *  command may be used later in a session as well.  If the HELO command
      *  argument is not acceptable a 501 failure reply must be returned and
@@ -904,7 +904,7 @@
             CU(LMTP_OK);
         }
     }
-        
+
     ctx->session.lhlo_seen = TRUE;
 
     /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   250 Requested mail action okay, completed
@@ -964,7 +964,7 @@
 {
     int rc;
 
-    rc = str_parse(msg, 
+    rc = str_parse(msg,
             "^.+ ("
     /*
      ##
@@ -973,7 +973,7 @@
      ##  because the given grammar is Chomsky-3 (right or left
      ##  linear grammar, but noth both).
      ##
-    
+
      # BNF grammar for <domain> according to RFC0821:
      # <snum>        ::= one, two, or three digits representing a decimal integer value in the range 0 through 255
      # <a>           ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case
@@ -1029,7 +1029,7 @@
 {
     int rc;
 
-    rc = str_parse(msg, 
+    rc = str_parse(msg,
             "^.+ ("
     /*
      ##
@@ -1112,7 +1112,7 @@
 
     /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   452 Requested action not taken: insufficient system storage
      *  RFC1893 2. Status Codes                         4.X.X   Persistent Transient Failure
-     *  RFC1893 3.5 Network and Routing Status          X.3.1   Mail system full 
+     *  RFC1893 3.5 Network and Routing Status          X.3.1   Mail system full
      */
     logbook(ctx->l2, L2_LEVEL_TRACE, "msg_create");
     ctx->msgcount++;
@@ -1130,13 +1130,13 @@
      *  indicating whether a 7bit message [...] or a MIME message [...] is
      *  being sent. The syntax of the value is as follows, using the ABNF
      *  notation [...]
-     *  
+     *
      *  body-value ::= "7BIT" / "8BITMIME"
-     *  
+     *
      *  "MAIL From:<foo@bar>"
      *  "MAIL From:<foo@bar> BODY=8BITMIME"
      *  "MAIL From:<foo@bar> BODY=7BIT"
-     *  
+     *
      *  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   553 Requested action not taken: mailbox name not allowed
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
      *  RFC1893 3.5 Network and Routing Status          X.1.7   Bad sender's mailbox address syntax
@@ -1154,14 +1154,14 @@
      */
     logbook(ctx->l2, L2_LEVEL_TRACE, "checking BODY keyword");
     if (str_parse(req->msg, "m/^MAIL From:\\s*<(.+@.+)>"
-                            "(?:\\s+BODY=(?:7BIT|8BITMIME)\\s*)?$/i", 
+                            "(?:\\s+BODY=(?:7BIT|8BITMIME)\\s*)?$/i",
                             &ctx->msg->mail_from) <= 0) {
         res.statuscode = "501";
         res.dsncode    = "5.5.4";
         res.statusmsg  = "Unknown parameter for keyword BODY.";
         CU(LMTP_OK);
     }
-    
+
     /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   550 Requested action not taken: mailbox unavailable
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
      *  RFC1893 3.5 Network and Routing Status          X.7.1   Delivery not authorized, message refused
@@ -1229,7 +1229,7 @@
         res.statusmsg  = "Syntax error in parameters.";
         CU(LMTP_OK);
     }
-    
+
     /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   550 Requested action not taken: mailbox unavailable
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
      *  RFC1893 3.5 Network and Routing Status          X.1.1   Bad destination mailbox address
@@ -1416,7 +1416,7 @@
         if ((cp = malloc(ctx->msg->asEnvgroups + 1)) == NULL) {
             /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   452 Requested action not taken: insufficient system storage
              *  RFC1893 2. Status Codes                         4.X.X   Persistent Transient Failure
-             *  RFC1893 3.5 Network and Routing Status          X.3.1   Mail system full 
+             *  RFC1893 3.5 Network and Routing Status          X.3.1   Mail system full
              */
             ctx->msgcount++;
             if ((ctx->msg = msg_create(ctx->prival)) == NULL) {
@@ -1434,7 +1434,7 @@
         if ((cp = malloc(ctx->asGroupargs + 1)) == NULL) {
             /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   452 Requested action not taken: insufficient system storage
              *  RFC1893 2. Status Codes                         4.X.X   Persistent Transient Failure
-             *  RFC1893 3.5 Network and Routing Status          X.3.1   Mail system full 
+             *  RFC1893 3.5 Network and Routing Status          X.3.1   Mail system full
              */
             ctx->msgcount++;
             if ((ctx->msg = msg_create(ctx->prival)) == NULL) {
@@ -1584,7 +1584,7 @@
                 break;
         }
     } else {
-        str_format(errorstring, sizeof(errorstring), "%sdelivery of %s [%d bytes]", 
+        str_format(errorstring, sizeof(errorstring), "%sdelivery of %s [%d bytes]",
                    ((ctx->option_operationmode == OPERATIONMODE_POST) ? "post " :
                    (ctx->option_operationmode == OPERATIONMODE_FEED) ? "feed " : ""),
                    ctx->msg->cpMsgid,
@@ -1645,16 +1645,16 @@
                 var_rc_t var_rc;
                 char *res_ptr;
                 size_t res_len;
-                str_format(errorstring, sizeof(errorstring), 
+                str_format(errorstring, sizeof(errorstring),
                            "${option.destination[%d]} returned %s\n"
                            "${option.destination[%d]} lastresp \"%s\"",
-                           i, nntp_error(ctx->pns[i].rc), 
+                           i, nntp_error(ctx->pns[i].rc),
                            i, nntp_lastresp(ctx->pns[i].nntp));
                 if ((var_rc = var_expand(ctx->config_varctx, errorstring, strlen(errorstring), &res_ptr, &res_len, FALSE)) != VAR_OK) {
-                    str_format(errorstring, sizeof(errorstring), 
+                    str_format(errorstring, sizeof(errorstring),
                                "destination[%d] returned %s\n"
                                "destination[%d] lastresp \"%s\"",
-                               i, nntp_error(ctx->pns[i].rc), 
+                               i, nntp_error(ctx->pns[i].rc),
                                i, nntp_lastresp(ctx->pns[i].nntp));
                 }
                 else {

CVSTrac 2.0.1