From a2087cd3441dce78f83626b25416ba9086cce31a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 28 May 2003 03:08:38 +0000 Subject: [PATCH] * msgbase.c: validate_recipients() now rejects Internet addresses in domains belonging to the local system or an attached Citadel network, when it fails to translate to a Citadel address. --- citadel/ChangeLog | 6 +++++- citadel/locate_host.c | 4 ++-- citadel/msgbase.c | 22 +++++++++++++++++----- citadel/serv_smtp.c | 2 +- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index c96f4709c..9bfe0cae8 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,9 @@ $Log$ + Revision 606.5 2003/05/28 03:08:38 ajc + * msgbase.c: validate_recipients() now rejects Internet addresses in + domains belonging to the local system or an attached Citadel network, + when it fails to translate to a Citadel address. + Revision 606.4 2003/05/26 05:36:25 ajc * citadel.h: changed internal version number to 6.07 * file_ops.c: #include @@ -4729,4 +4734,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/locate_host.c b/citadel/locate_host.c index 18a5dc907..c95569dcf 100644 --- a/citadel/locate_host.c +++ b/citadel/locate_host.c @@ -103,7 +103,7 @@ int rbl_check_addr(struct in_addr *addr, char *message_to_spammer) num_rbl = get_hosts(rbl_domains, "rbl"); if (num_rbl < 1) return(0); - /* Try all configured RBL */ + /* Try all configured RBL's */ for (rbl=0; rblnum_internet; - if (strlen(ret->recp_internet) > 0) { - strcat(ret->recp_internet, "|"); + /* Yes, you're reading this correctly: if the target + * domain points back to the local system or an attached + * Citadel directory, the address is invalid. That's + * because if the address were valid, we would have + * already translated it to a local address by now. + */ + if (IsDirectory(this_recp)) { + ++ret->num_error; + invalid = 1; + } + else { + ++ret->num_internet; + if (strlen(ret->recp_internet) > 0) { + strcat(ret->recp_internet, "|"); + } + strcat(ret->recp_internet, this_recp); } - strcat(ret->recp_internet, this_recp); break; case MES_IGNET: ++ret->num_ignet; @@ -3074,7 +3086,7 @@ void CtdlWriteObject(char *req_room, /* Room to stuff it in */ rewind(fp); lprintf(9, "Raw length is %ld\n", (long)raw_length); - raw_message = mallok((size_t)raw_length); + raw_message = mallok((size_t)raw_length + 2); fread(raw_message, (size_t)raw_length, 1, fp); fclose(fp); diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index 958441bc4..28b582632 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -445,7 +445,7 @@ void smtp_rcpt(char *argbuf) { if (valid->num_internet > 0) { if (SMTP->message_originated_locally == 0) { - cprintf("551 5.7.1 Relaying denied <%s>\r\n", recp); + cprintf("551 5.7.1 <%s> - relaying denied\r\n", recp); phree(valid); return; } -- 2.39.2