However, it is beyond the scope of this document to detail the finer
points of the configuration of Postfix or any other mailer, so refer to
the documentation to those programs and keep in mind that Citadel has
-LMTP support.<span style="font-family: monospace;"><br>
-</span></p>
+LMTP support.<span style="font-family: monospace;"></p>
+<p>There are actually <i>two</i> LMTP sockets. One is called
+<tt>lmtp.socket</tt> and the other is called <tt>lmtp-unfiltered.socket</tt>
+(both are found in your Citadel directory). The difference should be
+obvious: messages submitted via <tt>lmtp.socket</tt> are subject to any
+spam filtering you may have configured (such as SpamAssassin), while messages
+submitted via <tt>lmtp-unfiltered.socket</tt> will bypass the filters. You
+would use the filtered socket when receiving mail from an external MTA such
+as Postfix, but you might want to use the unfiltered socket with utilities
+such as fetchmail.</p>
+<br>
<p>For outbound mail, you
can either allow Citadel to perform
deliveries directly
int delivery_mode;
int message_originated_locally;
int is_lmtp;
+ int is_unfiltered;
int is_msa;
};
}
+/*
+ * We also have an unfiltered LMTP socket that bypasses spam filters.
+ */
+void lmtp_unfiltered_greeting(void) {
+ smtp_greeting();
+ SMTP->is_lmtp = 1;
+ SMTP->is_unfiltered = 1;
+}
+
+
/*
* Login greeting common to all auth methods
*/
*/
void smtp_rset(int do_response) {
int is_lmtp;
+ int is_unfiltered;
/*
* Our entire SMTP state is discarded when a RSET command is issued,
* we save it for later.
*/
is_lmtp = SMTP->is_lmtp;
+ is_unfiltered = SMTP->is_unfiltered;
memset(SMTP, 0, sizeof(struct citsmtp));
* Reinstate this little piece of information we saved (see above).
*/
SMTP->is_lmtp = is_lmtp;
+ SMTP->is_unfiltered = is_unfiltered;
if (do_response) {
cprintf("250 2.0.0 Zap!\r\n");
* submission (such as virus checkers or spam filters), call them now
* and give them an opportunity to reject the message.
*/
- scan_errors = PerformMessageHooks(msg, EVT_SMTPSCAN);
+ if (SMTP->is_unfiltered) {
+ scan_errors = 0;
+ }
+ else {
+ scan_errors = PerformMessageHooks(msg, EVT_SMTPSCAN);
+ }
if (scan_errors > 0) { /* We don't want this message! */
smtp_command_loop,
NULL);
+ CtdlRegisterServiceHook(0, /* local LMTP */
+ "lmtp-unfiltered.socket",
+ lmtp_unfiltered_greeting,
+ smtp_command_loop,
+ NULL);
+
smtp_init_spoolout();
CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP);