$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 <ctype.h>
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
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; rbl<num_rbl; ++rbl) {
snprintf(tbuf, sizeof tbuf,
"%d.%d.%d.%d.",
if (gethostbyname(tbuf) != NULL) {
strcpy(message_to_spammer,
- "Message rejected due to "
+ "5.7.1 Message rejected due to "
"known spammer source IP address"
);
return(1);
}
break;
case MES_INTERNET:
- ++ret->num_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;
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);
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;
}