From: Art Cancro Date: Sun, 13 Jan 2002 04:46:31 +0000 (+0000) Subject: * Allow incoming SMTP to relay to other Citadel nodes for whom we are X-Git-Tag: v7.86~6611 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=1182183eaeaa74c662d3d530a346a8f09034fc75;p=citadel.git * Allow incoming SMTP to relay to other Citadel nodes for whom we are providing directory service. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index c16b7cc17..2f0ea96a8 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 590.59 2002/01/13 04:46:31 ajc + * Allow incoming SMTP to relay to other Citadel nodes for whom we are + providing directory service. + Revision 590.58 2002/01/13 04:06:33 ajc * Repaired the problems I created when moving the_mime_parser()'s variables from the stack to the heap. (Hint: sizeof(char *) is 4, not 4096) @@ -3143,3 +3147,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index 045d78a2d..ef18e1a98 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -187,7 +187,7 @@ void smtp_get_pass(char *argbuf) { decode_base64(password, argbuf, SIZ); lprintf(9, "Trying <%s>\n", password); if (CtdlTryPassword(password) == pass_ok) { - cprintf("235 Authentication successful.\r\n"); + cprintf("235 Hello, %s\r\n", CC->usersupp.fullname); lprintf(9, "SMTP authenticated login successful\n"); CC->internal_pgm = 0; CC->cs_flags &= ~CS_STEALTH; @@ -401,6 +401,7 @@ void smtp_rcpt(char *argbuf) { char user[SIZ]; char node[SIZ]; char recp[SIZ]; + int bypass_spam_checking = 0; if (strlen(SMTP->from) == 0) { cprintf("503 Need MAIL before RCPT\r\n"); @@ -415,6 +416,12 @@ void smtp_rcpt(char *argbuf) { strcpy(recp, &argbuf[3]); striplt(recp); stripallbut(recp, '<', '>'); + + /* Allow relaying if it's from the Internet to another Citadel node + * for whom we are providing directory service. + */ + bypass_spam_checking = IsDirectory(recp); + alias(recp); cvt = convert_internet_address(user, node, recp); snprintf(recp, sizeof recp, "%s@%s", user, node); @@ -423,7 +430,7 @@ void smtp_rcpt(char *argbuf) { /* FIXME possible buffer overflow type of issues here. */ switch(cvt) { case rfc822_address_locally_validated: - cprintf("250 %s is a valid local user.\r\n", user); + cprintf("250 RCPT ok\r\n"); if (SMTP->valid.num_local > 0) { strcat(SMTP->valid.recp_local, "|"); } @@ -433,7 +440,7 @@ void smtp_rcpt(char *argbuf) { return; case rfc822_room_delivery: - cprintf("250 Delivering to room '%s'\r\n", user); + cprintf("250 RCPT ok\r\n"); if (SMTP->valid.num_room > 0) { strcat(SMTP->valid.recp_room, "|"); } @@ -443,7 +450,7 @@ void smtp_rcpt(char *argbuf) { return; case rfc822_address_on_citadel_network: - cprintf("250 '%s' is a valid network user.\r\n", user); + cprintf("250 RCPT ok\r\n"); if (SMTP->valid.num_ignet > 0) { strcat(SMTP->valid.recp_ignet, "|"); } @@ -457,11 +464,12 @@ void smtp_rcpt(char *argbuf) { return; case rfc822_address_nonlocal: - if (SMTP->message_originated_locally == 0) { + if ( (SMTP->message_originated_locally == 0) + && (bypass_spam_checking == 0) ) { cprintf("551 Relaying denied.\r\n"); } else { - cprintf("250 Remote recipient %s ok\r\n", recp); + cprintf("250 RCPT ok\r\n"); if (SMTP->valid.num_internet > 0) { strcat(SMTP->valid.recp_internet, "|"); @@ -1042,7 +1050,6 @@ void smtp_do_bounce(char *instr) { /* First try the user who sent the message */ lprintf(9, "bounce to user? <%s>\n", bounceto); - TRACE; if (strlen(bounceto) == 0) { lprintf(7, "No bounce address specified\n"); bounce_msgid = (-1L); diff --git a/citadel/tools.c b/citadel/tools.c index 1ef4a53a3..1fd5c1f0e 100644 --- a/citadel/tools.c +++ b/citadel/tools.c @@ -146,9 +146,6 @@ void remove_token(char *source, int parmnum, char separator) } if (end < 0) end = strlen(source); - - printf("%d .. %d\n", start, end); - strcpy(&source[start], &source[end]); }