From 6b8dfa5df12415e43a3ec4cad081339a39736dfa Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Fri, 5 Sep 2003 07:52:00 +0000
Subject: [PATCH] Added new mail server option flag: NO_NOTIFY, to disable user
 notification messages for received SMTP mail (for all users).

---
 src/sbbs3/mailsrvr.c | 2 +-
 src/sbbs3/mailsrvr.h | 1 +
 src/sbbs3/sbbs_ini.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/mailsrvr.c b/src/sbbs3/mailsrvr.c
index 49a9e35b99..e34c5144e5 100644
--- a/src/sbbs3/mailsrvr.c
+++ b/src/sbbs3/mailsrvr.c
@@ -2135,7 +2135,7 @@ static void smtp_thread(void* arg)
 					}
 					lprintf("%04d SMTP Created message #%ld from %s to %s <%s>"
 						,socket, newmsg.hdr.number, sender, rcpt_name, rcpt_addr);
-					if(usernum) {
+					if(!(startup->options&MAIL_OPT_NO_NOTIFY) && usernum) {
 						sprintf(str,"\7\1n\1hOn %.24s\r\n\1m%s \1n\1msent you e-mail from: "
 							"\1h%s\1n\r\n"
 							,timestr(&scfg,(time_t*)&newmsg.hdr.when_imported.time,tmp)
diff --git a/src/sbbs3/mailsrvr.h b/src/sbbs3/mailsrvr.h
index a3e47cc119..ae6a2fafc0 100644
--- a/src/sbbs3/mailsrvr.h
+++ b/src/sbbs3/mailsrvr.h
@@ -89,6 +89,7 @@ typedef struct {
 #define MAIL_OPT_RELAY_TX			(1<<5)	/* Use SMTP relay server */
 #define MAIL_OPT_DEBUG_POP3			(1<<6)
 #define MAIL_OPT_ALLOW_RX_BY_NUMBER	(1<<7)	/* Allow mail sent to user # */
+#define MAIL_OPT_NO_NOTIFY			(1<<8)	/* Don't notify local recipients */
 #define MAIL_OPT_NO_HOST_LOOKUP		(1<<11)	/* Don't look-up hostnames */
 #define MAIL_OPT_USE_TCP_DNS		(1<<12)	/* Use TCP vs UDP for DNS req */
 #define MAIL_OPT_NO_SENDMAIL		(1<<13)	/* Don't run SendMail thread */
diff --git a/src/sbbs3/sbbs_ini.c b/src/sbbs3/sbbs_ini.c
index 2f0019fa39..71e156a923 100644
--- a/src/sbbs3/sbbs_ini.c
+++ b/src/sbbs3/sbbs_ini.c
@@ -111,6 +111,7 @@ static ini_bitdesc_t mail_options[] = {
 	{ MAIL_OPT_RELAY_TX				,"RELAY_TX"				},
 	{ MAIL_OPT_DEBUG_POP3			,"DEBUG_POP3"			},
 	{ MAIL_OPT_ALLOW_RX_BY_NUMBER	,"ALLOW_RX_BY_NUMBER"	},
+	{ MAIL_OPT_NO_NOTIFY			,"NO_NOTIFY"			},
 	{ MAIL_OPT_NO_HOST_LOOKUP		,"NO_HOST_LOOKUP"		},
 	{ MAIL_OPT_USE_TCP_DNS			,"USE_TCP_DNS"			},
 	{ MAIL_OPT_NO_SENDMAIL			,"NO_SENDMAIL"			},
-- 
GitLab