]> git.mikk.net Git - ssm_nmsg/commitdiff
Remove mail / rcpt reporting until we can do them right.
authorchris mikkelson <chris@mikk.net>
Sat, 13 Mar 2010 06:00:17 +0000 (00:00 -0600)
committerchris mikkelson <chris@mikk.net>
Sat, 13 Mar 2010 06:00:17 +0000 (00:00 -0600)
ssm_nmsg.c

index 358e548560b2636eb7c3f7b2797ab93480d6cbca..2b35d4548c8351b5b29066fb92f8684b6eac56c5 100644 (file)
@@ -107,21 +107,21 @@ ssm_nmsg_connect(struct conn *c)
        return SSM_PASS;
 }
 
-#define SAVEPARM(x) \
-static int \
-ssm_nmsg_##x(struct conn *c, const char *cmd, int len, int argoff) { \
-       struct ssm_nmsg_state *nms = ssm_getpriv(&ss_module, c); \
-       const uint8_t *data = (const uint8_t *)cmd; \
-       if (nms && nms->msg) \
-               nmsg_message_set_field(nms->msg, #x, 0, data + argoff, \
-                               len - argoff + 1); \
-       return SSM_PASS; \
+static int
+ssm_nmsg_helo(struct conn *c, const char *cmd, int len, int argoff)
+{
+       struct ssm_nmsg_state *nms = ssm_getpriv(&ss_module, c);
+       uint8_t *data = malloc(len + 1);
+
+       memcpy(data,cmd,len);
+       data[len] = 0;
+       if (nms && nms->msg)
+               nmsg_message_set_field(nms->msg, "helo", 0, data+argoff,
+                                       len - argoff + 1);
+       free(data);
+       return SSM_PASS;
 }
 
-SAVEPARM(helo)
-SAVEPARM(from)
-SAVEPARM(rcpt)
-
 static void
 ssm_nmsg_body(struct conn *c, const char *data, int len)
 {
@@ -167,8 +167,8 @@ struct smtpsink_module ss_module = {
 
        ssm_nmsg_connect,
        ssm_nmsg_helo,
-       ssm_nmsg_from,
-       ssm_nmsg_rcpt,
+       0,
+       0,
        0,
        ssm_nmsg_body,
        ssm_nmsg_enddata,