]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_smtp.c
* Added cs_addr field to struct CitContext -- holds a dotted quad string
[citadel.git] / citadel / serv_smtp.c
index f1d1b8b083a6a482eceac6b839f9395679574193..28a2ec01534ece1ce522d8b11bad3c088ad037e3 100644 (file)
@@ -62,7 +62,7 @@
 struct citsmtp {               /* Information about the current session */
        int command_state;
        char helo_node[SIZ];
-       struct usersupp vrfy_buffer;
+       struct ctdluser vrfy_buffer;
        int vrfy_count;
        char vrfy_match[SIZ];
        char from[SIZ];
@@ -192,7 +192,7 @@ void smtp_get_pass(char *argbuf) {
        CtdlDecodeBase64(password, argbuf, SIZ);
        lprintf(9, "Trying <%s>\n", password);
        if (CtdlTryPassword(password) == pass_ok) {
-               cprintf("235 2.0.0 Hello, %s\r\n", CC->usersupp.fullname);
+               cprintf("235 2.0.0 Hello, %s\r\n", CC->user.fullname);
                lprintf(9, "SMTP authenticated login successful\n");
                CC->internal_pgm = 0;
                CC->cs_flags &= ~CS_STEALTH;
@@ -230,11 +230,11 @@ void smtp_auth(char *argbuf) {
 /*
  * Back end for smtp_vrfy() command
  */
-void smtp_vrfy_backend(struct usersupp *us, void *data) {
+void smtp_vrfy_backend(struct ctdluser *us, void *data) {
 
        if (!fuzzy_match(us, SMTP->vrfy_match)) {
                ++SMTP->vrfy_count;
-               memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp));
+               memcpy(&SMTP->vrfy_buffer, us, sizeof(struct ctdluser));
        }
 }
 
@@ -269,7 +269,7 @@ void smtp_vrfy(char *argbuf) {
 /*
  * Back end for smtp_expn() command
  */
-void smtp_expn_backend(struct usersupp *us, void *data) {
+void smtp_expn_backend(struct ctdluser *us, void *data) {
 
        if (!fuzzy_match(us, SMTP->vrfy_match)) {
 
@@ -281,7 +281,7 @@ void smtp_expn_backend(struct usersupp *us, void *data) {
                }
 
                ++SMTP->vrfy_count;
-               memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp));
+               memcpy(&SMTP->vrfy_buffer, us, sizeof(struct ctdluser));
        }
 }
 
@@ -493,14 +493,12 @@ void smtp_data(void) {
        datestring(nowstamp, sizeof nowstamp, time(NULL), DATESTRING_RFC822);
        body = mallok(4096);
 
-       /* FIXME
-          it should be Received: from %s (real.name.dom [w.x.y.z])
-        */
        if (body != NULL) snprintf(body, 4096,
-               "Received: from %s (%s)\n"
+               "Received: from %s (%s [%s])\n"
                "       by %s; %s\n",
                        SMTP->helo_node,
                        CC->cs_host,
+                       CC->cs_addr,
                        config.c_fqdn,
                        nowstamp);
        
@@ -530,7 +528,7 @@ void smtp_data(void) {
                if (msg->cm_fields['H'] != NULL) phree(msg->cm_fields['H']);
                if (msg->cm_fields['F'] != NULL) phree(msg->cm_fields['F']);
                if (msg->cm_fields['O'] != NULL) phree(msg->cm_fields['O']);
-               msg->cm_fields['A'] = strdoop(CC->usersupp.fullname);
+               msg->cm_fields['A'] = strdoop(CC->user.fullname);
                msg->cm_fields['N'] = strdoop(config.c_nodename);
                msg->cm_fields['H'] = strdoop(config.c_humannode);
                msg->cm_fields['F'] = strdoop(CC->cs_inet_email);
@@ -1348,7 +1346,7 @@ void smtp_do_queue(void) {
         */
        lprintf(7, "SMTP: processing outbound queue\n");
 
-       if (getroom(&CC->quickroom, SMTP_SPOOLOUT_ROOM) != 0) {
+       if (getroom(&CC->room, SMTP_SPOOLOUT_ROOM) != 0) {
                lprintf(3, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
                return;
        }
@@ -1407,7 +1405,7 @@ void cmd_smtp(char *argbuf) {
  * Initialize the SMTP outbound queue
  */
 void smtp_init_spoolout(void) {
-       struct quickroom qrbuf;
+       struct ctdlroom qrbuf;
 
        /*
         * Create the room.  This will silently fail if the room already