/* RBL check */
if ( (!CC->logged_in) && (!CC->is_local_socket) ) {
if (rbl_check(message_to_spammer)) {
- cprintf("552 %s\r\n", message_to_spammer);
+ cprintf("550 %s\r\n", message_to_spammer);
/* no need to phree(valid), it's not allocated yet */
return;
}
/* If the user is locally authenticated, FORCE the From: header to
* show up as the real sender. Yes, this violates the RFC standard,
- * but IT MAKES SENSE. Comment it out if you don't like this behavior.
+ * but IT MAKES SENSE. If you prefer strict RFC adherence over
+ * common sense, you can disable this in the configuration.
*
* We also set the "message room name" ('O' field) to MAILROOM
* (which is Mail> on most systems) to prevent it from getting set
* to something ugly like "0000058008.Sent Items>" when the message
* is read with a Citadel client.
*/
- if (CC->logged_in) {
+ if ( (CC->logged_in) && (config.c_rfc822_strict_from == 0) ) {
if (msg->cm_fields['A'] != NULL) phree(msg->cm_fields['A']);
if (msg->cm_fields['N'] != NULL) phree(msg->cm_fields['N']);
if (msg->cm_fields['H'] != NULL) phree(msg->cm_fields['H']);
snprintf(dsn, SIZ, "Could not connect: %s", strerror(errno));
if (sock >= 0) lprintf(9, "Connected!\n");
if (sock < 0) snprintf(dsn, SIZ, "%s", strerror(errno));
- if (sock >= 0) break;
}
if (sock < 0) {
/*
* Now go through the instructions checking for stuff.
*/
-
for (i=0; i<lines; ++i) {
extract_token(buf, instr, i, '\n');
extract(key, buf, 0);
extract(dsn, buf, 3);
if ( (!strcasecmp(key, "remote"))
&& ((status==0)||(status==3)||(status==4)) ) {
+
+ /* Remove this "remote" instruction from the set,
+ * but replace the set's final newline if
+ * remove_token() stripped it. It has to be there.
+ */
remove_token(instr, i, '\n');
+ if (instr[strlen(instr)-1] != '\n') {
+ strcat(instr, "\n");
+ }
+
--i;
--lines;
lprintf(9, "SMTP: Trying <%s>\n", addr);