2 * This module is an SMTP and ESMTP implementation for the Citadel system.
3 * It is compliant with all of the following:
5 * RFC 821 - Simple Mail Transfer Protocol
6 * RFC 876 - Survey of SMTP Implementations
7 * RFC 1047 - Duplicate messages and SMTP
8 * RFC 1652 - 8 bit MIME
9 * RFC 1869 - Extended Simple Mail Transfer Protocol
10 * RFC 1870 - SMTP Service Extension for Message Size Declaration
11 * RFC 2033 - Local Mail Transfer Protocol
12 * RFC 2197 - SMTP Service Extension for Command Pipelining
13 * RFC 2476 - Message Submission
14 * RFC 2487 - SMTP Service Extension for Secure SMTP over TLS
15 * RFC 2554 - SMTP Service Extension for Authentication
16 * RFC 2821 - Simple Mail Transfer Protocol
17 * RFC 2822 - Internet Message Format
18 * RFC 2920 - SMTP Service Extension for Command Pipelining
20 * The VRFY and EXPN commands have been removed from this implementation
21 * because nobody uses these commands anymore, except for spammers.
23 * Copyright (c) 1998-2012 by the citadel.org team
25 * This program is open source software; you can redistribute it and/or modify
26 * it under the terms of the GNU General Public License version 3.
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
49 #include <sys/types.h>
52 #if TIME_WITH_SYS_TIME
53 # include <sys/time.h>
57 # include <sys/time.h>
67 #include <sys/socket.h>
68 #include <netinet/in.h>
69 #include <arpa/inet.h>
70 #include <libcitadel.h>
73 #include "citserver.h"
80 #include "internet_addressing.h"
83 #include "clientsocket.h"
84 #include "locate_host.h"
85 #include "citadel_dirs.h"
94 #include "ctdl_module.h"
96 #include "smtp_util.h"
97 enum { /* Command states for login authentication */
108 /*****************************************************************************/
109 /* SMTP SERVER (INBOUND) STUFF */
110 /*****************************************************************************/
114 * Here's where our SMTP session begins its happy day.
116 void smtp_greeting(int is_msa)
119 char message_to_spammer[1024];
121 strcpy(CC->cs_clientname, "SMTP session");
122 CC->internal_pgm = 1;
123 CC->cs_flags |= CS_STEALTH;
124 CC->session_specific_data = malloc(sizeof(citsmtp));
125 memset(SMTP, 0, sizeof(citsmtp));
127 sSMTP->is_msa = is_msa;
129 /* If this config option is set, reject connections from problem
130 * addresses immediately instead of after they execute a RCPT
132 if ( (config.c_rbl_at_greeting) && (sSMTP->is_msa == 0) ) {
133 if (rbl_check(message_to_spammer)) {
134 if (server_shutting_down)
135 cprintf("421 %s\r\n", message_to_spammer);
137 cprintf("550 %s\r\n", message_to_spammer);
138 CC->kill_me = KILLME_SPAMMER;
139 /* no need to free_recipients(valid), it's not allocated yet */
144 /* Otherwise we're either clean or we check later. */
146 if (CC->nologin==1) {
147 cprintf("451 Too many connections are already open; please try again later.\r\n");
148 CC->kill_me = KILLME_MAX_SESSIONS_EXCEEDED;
149 /* no need to free_recipients(valid), it's not allocated yet */
153 /* Note: the FQDN *must* appear as the first thing after the 220 code.
154 * Some clients (including citmail.c) depend on it being there.
156 cprintf("220 %s ESMTP Citadel server ready.\r\n", config.c_fqdn);
161 * SMTPS is just like SMTP, except it goes crypto right away.
163 void smtps_greeting(void) {
164 CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
166 if (!CC->redirect_ssl) CC->kill_me = KILLME_NO_CRYPTO; /* kill session if no crypto */
173 * SMTP MSA port requires authentication.
175 void smtp_msa_greeting(void) {
181 * LMTP is like SMTP but with some extra bonus footage added.
183 void lmtp_greeting(void) {
191 * Generic SMTP MTA greeting
193 void smtp_mta_greeting(void) {
199 * We also have an unfiltered LMTP socket that bypasses spam filters.
201 void lmtp_unfiltered_greeting(void) {
207 sSMTP->is_unfiltered = 1;
212 * Login greeting common to all auth methods
214 void smtp_auth_greeting(void) {
215 cprintf("235 Hello, %s\r\n", CC->user.fullname);
216 syslog(LOG_NOTICE, "SMTP authenticated %s\n", CC->user.fullname);
217 CC->internal_pgm = 0;
218 CC->cs_flags &= ~CS_STEALTH;
223 * Implement HELO and EHLO commands.
225 * which_command: 0=HELO, 1=EHLO, 2=LHLO
227 void smtp_hello(char *argbuf, int which_command) {
228 citsmtp *sSMTP = SMTP;
230 safestrncpy(sSMTP->helo_node, argbuf, sizeof sSMTP->helo_node);
232 if ( (which_command != 2) && (sSMTP->is_lmtp) ) {
233 cprintf("500 Only LHLO is allowed when running LMTP\r\n");
237 if ( (which_command == 2) && (sSMTP->is_lmtp == 0) ) {
238 cprintf("500 LHLO is only allowed when running LMTP\r\n");
242 if (which_command == 0) {
243 cprintf("250 Hello %s (%s [%s])\r\n",
250 if (which_command == 1) {
251 cprintf("250-Hello %s (%s [%s])\r\n",
258 cprintf("250-Greetings and joyous salutations.\r\n");
260 cprintf("250-HELP\r\n");
261 cprintf("250-SIZE %ld\r\n", config.c_maxmsglen);
265 * Offer TLS, but only if TLS is not already active.
266 * Furthermore, only offer TLS when running on
267 * the SMTP-MSA port, not on the SMTP-MTA port, due to
268 * questionable reliability of TLS in certain sending MTA's.
270 if ( (!CC->redirect_ssl) && (sSMTP->is_msa) ) {
271 cprintf("250-STARTTLS\r\n");
273 #endif /* HAVE_OPENSSL */
275 cprintf("250-AUTH LOGIN PLAIN\r\n"
276 "250-AUTH=LOGIN PLAIN\r\n"
285 * Implement HELP command.
287 void smtp_help(void) {
288 cprintf("214 RTFM http://www.ietf.org/rfc/rfc2821.txt\r\n");
295 void smtp_get_user(char *argbuf) {
298 citsmtp *sSMTP = SMTP;
300 CtdlDecodeBase64(username, argbuf, SIZ);
301 /* syslog(LOG_DEBUG, "Trying <%s>\n", username); */
302 if (CtdlLoginExistingUser(NULL, username) == login_ok) {
303 CtdlEncodeBase64(buf, "Password:", 9, 0);
304 cprintf("334 %s\r\n", buf);
305 sSMTP->command_state = smtp_password;
308 cprintf("500 No such user.\r\n");
309 sSMTP->command_state = smtp_command;
317 void smtp_get_pass(char *argbuf) {
321 memset(password, 0, sizeof(password));
322 len = CtdlDecodeBase64(password, argbuf, SIZ);
323 /* syslog(LOG_DEBUG, "Trying <%s>\n", password); */
324 if (CtdlTryPassword(password, len) == pass_ok) {
325 smtp_auth_greeting();
328 cprintf("535 Authentication failed.\r\n");
330 SMTP->command_state = smtp_command;
335 * Back end for PLAIN auth method (either inline or multistate)
337 void smtp_try_plain(char *encoded_authstring) {
338 char decoded_authstring[1024];
345 CtdlDecodeBase64(decoded_authstring, encoded_authstring, strlen(encoded_authstring) );
346 safestrncpy(ident, decoded_authstring, sizeof ident);
347 safestrncpy(user, &decoded_authstring[strlen(ident) + 1], sizeof user);
348 len = safestrncpy(pass, &decoded_authstring[strlen(ident) + strlen(user) + 2], sizeof pass);
350 len = sizeof(pass) - 1;
352 SMTP->command_state = smtp_command;
354 if (!IsEmptyStr(ident)) {
355 result = CtdlLoginExistingUser(user, ident);
358 result = CtdlLoginExistingUser(NULL, user);
361 if (result == login_ok) {
362 if (CtdlTryPassword(pass, len) == pass_ok) {
363 smtp_auth_greeting();
367 cprintf("504 Authentication failed.\r\n");
372 * Attempt to perform authenticated SMTP
374 void smtp_auth(char *argbuf) {
375 char username_prompt[64];
377 char encoded_authstring[1024];
380 cprintf("504 Already logged in.\r\n");
384 extract_token(method, argbuf, 0, ' ', sizeof method);
386 if (!strncasecmp(method, "login", 5) ) {
387 if (strlen(argbuf) >= 7) {
388 smtp_get_user(&argbuf[6]);
391 CtdlEncodeBase64(username_prompt, "Username:", 9, 0);
392 cprintf("334 %s\r\n", username_prompt);
393 SMTP->command_state = smtp_user;
398 if (!strncasecmp(method, "plain", 5) ) {
399 if (num_tokens(argbuf, ' ') < 2) {
401 SMTP->command_state = smtp_plain;
405 extract_token(encoded_authstring, argbuf, 1, ' ', sizeof encoded_authstring);
407 smtp_try_plain(encoded_authstring);
411 if (strncasecmp(method, "login", 5) ) {
412 cprintf("504 Unknown authentication method.\r\n");
420 * Implements the RSET (reset state) command.
421 * Currently this just zeroes out the state buffer. If pointers to data
422 * allocated with malloc() are ever placed in the state buffer, we have to
423 * be sure to free() them first!
425 * Set do_response to nonzero to output the SMTP RSET response code.
427 void smtp_rset(int do_response) {
430 citsmtp *sSMTP = SMTP;
433 * Our entire SMTP state is discarded when a RSET command is issued,
434 * but we need to preserve this one little piece of information, so
435 * we save it for later.
437 is_lmtp = sSMTP->is_lmtp;
438 is_unfiltered = sSMTP->is_unfiltered;
440 memset(sSMTP, 0, sizeof(citsmtp));
443 * It is somewhat ambiguous whether we want to log out when a RSET
444 * command is issued. Here's the code to do it. It is commented out
445 * because some clients (such as Pine) issue RSET commands before
446 * each message, but still expect to be logged in.
448 * if (CC->logged_in) {
454 * Reinstate this little piece of information we saved (see above).
456 sSMTP->is_lmtp = is_lmtp;
457 sSMTP->is_unfiltered = is_unfiltered;
460 cprintf("250 Zap!\r\n");
465 * Clear out the portions of the state buffer that need to be cleared out
466 * after the DATA command finishes.
468 void smtp_data_clear(void) {
469 citsmtp *sSMTP = SMTP;
471 strcpy(sSMTP->from, "");
472 strcpy(sSMTP->recipients, "");
473 sSMTP->number_of_recipients = 0;
474 sSMTP->delivery_mode = 0;
475 sSMTP->message_originated_locally = 0;
479 * Implements the "MAIL FROM:" command
481 void smtp_mail(char *argbuf) {
485 citsmtp *sSMTP = SMTP;
487 if (!IsEmptyStr(sSMTP->from)) {
488 cprintf("503 Only one sender permitted\r\n");
492 if (strncasecmp(argbuf, "From:", 5)) {
493 cprintf("501 Syntax error\r\n");
497 strcpy(sSMTP->from, &argbuf[5]);
498 striplt(sSMTP->from);
499 if (haschar(sSMTP->from, '<') > 0) {
500 stripallbut(sSMTP->from, '<', '>');
503 /* We used to reject empty sender names, until it was brought to our
504 * attention that RFC1123 5.2.9 requires that this be allowed. So now
505 * we allow it, but replace the empty string with a fake
506 * address so we don't have to contend with the empty string causing
507 * other code to fail when it's expecting something there.
509 if (IsEmptyStr(sSMTP->from)) {
510 strcpy(sSMTP->from, "someone@example.com");
513 /* If this SMTP connection is from a logged-in user, force the 'from'
514 * to be the user's Internet e-mail address as Citadel knows it.
517 safestrncpy(sSMTP->from, CC->cs_inet_email, sizeof sSMTP->from);
518 cprintf("250 Sender ok <%s>\r\n", sSMTP->from);
519 sSMTP->message_originated_locally = 1;
523 else if (sSMTP->is_lmtp) {
524 /* Bypass forgery checking for LMTP */
527 /* Otherwise, make sure outsiders aren't trying to forge mail from
528 * this system (unless, of course, c_allow_spoofing is enabled)
530 else if (config.c_allow_spoofing == 0) {
531 process_rfc822_addr(sSMTP->from, user, node, name);
532 if (CtdlHostAlias(node) != hostalias_nomatch) {
533 cprintf("550 You must log in to send mail from %s\r\n", node);
534 strcpy(sSMTP->from, "");
539 cprintf("250 Sender ok\r\n");
545 * Implements the "RCPT To:" command
547 void smtp_rcpt(char *argbuf) {
549 char message_to_spammer[SIZ];
550 struct recptypes *valid = NULL;
551 citsmtp *sSMTP = SMTP;
553 if (IsEmptyStr(sSMTP->from)) {
554 cprintf("503 Need MAIL before RCPT\r\n");
558 if (strncasecmp(argbuf, "To:", 3)) {
559 cprintf("501 Syntax error\r\n");
563 if ( (sSMTP->is_msa) && (!CC->logged_in) ) {
564 cprintf("550 You must log in to send mail on this port.\r\n");
565 strcpy(sSMTP->from, "");
569 safestrncpy(recp, &argbuf[3], sizeof recp);
571 stripallbut(recp, '<', '>');
573 if ( (strlen(recp) + strlen(sSMTP->recipients) + 1 ) >= SIZ) {
574 cprintf("452 Too many recipients\r\n");
579 if ( (!CC->logged_in) /* Don't RBL authenticated users */
580 && (!sSMTP->is_lmtp) ) { /* Don't RBL LMTP clients */
581 if (config.c_rbl_at_greeting == 0) { /* Don't RBL again if we already did it */
582 if (rbl_check(message_to_spammer)) {
583 if (server_shutting_down)
584 cprintf("421 %s\r\n", message_to_spammer);
586 cprintf("550 %s\r\n", message_to_spammer);
587 /* no need to free_recipients(valid), it's not allocated yet */
593 valid = validate_recipients(recp,
594 smtp_get_Recipients (),
595 (sSMTP->is_lmtp)? POST_LMTP:
596 (CC->logged_in)? POST_LOGGED_IN:
598 if (valid->num_error != 0) {
599 cprintf("550 %s\r\n", valid->errormsg);
600 free_recipients(valid);
604 if (valid->num_internet > 0) {
606 if (CtdlCheckInternetMailPermission(&CC->user)==0) {
607 cprintf("551 <%s> - you do not have permission to send Internet mail\r\n", recp);
608 free_recipients(valid);
614 if (valid->num_internet > 0) {
615 if ( (sSMTP->message_originated_locally == 0)
616 && (sSMTP->is_lmtp == 0) ) {
617 cprintf("551 <%s> - relaying denied\r\n", recp);
618 free_recipients(valid);
623 cprintf("250 RCPT ok <%s>\r\n", recp);
624 if (!IsEmptyStr(sSMTP->recipients)) {
625 strcat(sSMTP->recipients, ",");
627 strcat(sSMTP->recipients, recp);
628 sSMTP->number_of_recipients += 1;
630 free_recipients(valid);
638 * Implements the DATA command
640 void smtp_data(void) {
642 char *defbody; //TODO: remove me
643 struct CtdlMessage *msg = NULL;
646 struct recptypes *valid;
650 citsmtp *sSMTP = SMTP;
652 if (IsEmptyStr(sSMTP->from)) {
653 cprintf("503 Need MAIL command first.\r\n");
657 if (sSMTP->number_of_recipients < 1) {
658 cprintf("503 Need RCPT command first.\r\n");
662 cprintf("354 Transmit message now - terminate with '.' by itself\r\n");
664 datestring(nowstamp, sizeof nowstamp, time(NULL), DATESTRING_RFC822);
665 defbody = malloc(4096);
667 if (defbody != NULL) {
668 if (sSMTP->is_lmtp && (CC->cs_UDSclientUID != -1)) {
669 snprintf(defbody, 4096,
670 "Received: from %s (Citadel from userid %ld)\n"
673 (long int) CC->cs_UDSclientUID,
678 snprintf(defbody, 4096,
679 "Received: from %s (%s [%s])\n"
688 body = CtdlReadMessageBodyBuf(HKEY("."), config.c_maxmsglen, defbody, 1, NULL);
690 cprintf("550 Unable to save message: internal error.\r\n");
694 syslog(LOG_DEBUG, "Converting message...\n");
695 msg = convert_internet_message_buf(&body);
697 /* If the user is locally authenticated, FORCE the From: header to
698 * show up as the real sender. Yes, this violates the RFC standard,
699 * but IT MAKES SENSE. If you prefer strict RFC adherence over
700 * common sense, you can disable this in the configuration.
702 * We also set the "message room name" ('O' field) to MAILROOM
703 * (which is Mail> on most systems) to prevent it from getting set
704 * to something ugly like "0000058008.Sent Items>" when the message
705 * is read with a Citadel client.
707 if ( (CC->logged_in) && (config.c_rfc822_strict_from == 0) ) {
708 if (msg->cm_fields['A'] != NULL) free(msg->cm_fields['A']);
709 if (msg->cm_fields['N'] != NULL) free(msg->cm_fields['N']);
710 if (msg->cm_fields['H'] != NULL) free(msg->cm_fields['H']);
711 if (msg->cm_fields['F'] != NULL) free(msg->cm_fields['F']);
712 if (msg->cm_fields['O'] != NULL) free(msg->cm_fields['O']);
713 msg->cm_fields['A'] = strdup(CC->user.fullname);
714 msg->cm_fields['N'] = strdup(config.c_nodename);
715 msg->cm_fields['H'] = strdup(config.c_humannode);
716 msg->cm_fields['F'] = strdup(CC->cs_inet_email);
717 msg->cm_fields['O'] = strdup(MAILROOM);
720 /* Set the "envelope from" address */
721 if (msg->cm_fields['P'] != NULL) {
722 free(msg->cm_fields['P']);
724 msg->cm_fields['P'] = strdup(sSMTP->from);
726 /* Set the "envelope to" address */
727 if (msg->cm_fields['V'] != NULL) {
728 free(msg->cm_fields['V']);
730 msg->cm_fields['V'] = strdup(sSMTP->recipients);
732 /* Submit the message into the Citadel system. */
733 valid = validate_recipients(sSMTP->recipients,
734 smtp_get_Recipients (),
735 (sSMTP->is_lmtp)? POST_LMTP:
736 (CC->logged_in)? POST_LOGGED_IN:
739 /* If there are modules that want to scan this message before final
740 * submission (such as virus checkers or spam filters), call them now
741 * and give them an opportunity to reject the message.
743 if (sSMTP->is_unfiltered) {
747 scan_errors = PerformMessageHooks(msg, EVT_SMTPSCAN);
750 if (scan_errors > 0) { /* We don't want this message! */
752 if (msg->cm_fields['0'] == NULL) {
753 msg->cm_fields['0'] = strdup("Message rejected by filter");
756 sprintf(result, "550 %s\r\n", msg->cm_fields['0']);
759 else { /* Ok, we'll accept this message. */
760 msgnum = CtdlSubmitMsg(msg, valid, "", 0);
762 sprintf(result, "250 Message accepted.\r\n");
765 sprintf(result, "550 Internal delivery error\r\n");
769 /* For SMTP and ESTMP, just print the result message. For LMTP, we
770 * have to print one result message for each recipient. Since there
771 * is nothing in Citadel which would cause different recipients to
772 * have different results, we can get away with just spitting out the
773 * same message once for each recipient.
775 if (sSMTP->is_lmtp) {
776 for (i=0; i<sSMTP->number_of_recipients; ++i) {
777 cprintf("%s", result);
781 cprintf("%s", result);
784 /* Write something to the syslog(which may or may not be where the
785 * rest of the Citadel logs are going; some sysadmins want LOG_MAIL).
787 syslog((LOG_MAIL | LOG_INFO),
788 "%ld: from=<%s>, nrcpts=%d, relay=%s [%s], stat=%s",
791 sSMTP->number_of_recipients,
798 CtdlFreeMessage(msg);
799 free_recipients(valid);
800 smtp_data_clear(); /* clear out the buffers now */
805 * implements the STARTTLS command (Citadel API version)
807 void smtp_starttls(void)
809 char ok_response[SIZ];
810 char nosup_response[SIZ];
811 char error_response[SIZ];
814 "220 Begin TLS negotiation now\r\n");
815 sprintf(nosup_response,
816 "554 TLS not supported here\r\n");
817 sprintf(error_response,
818 "554 Internal error\r\n");
819 CtdlModuleStartCryptoMsgs(ok_response, nosup_response, error_response);
826 * Main command loop for SMTP sessions.
828 void smtp_command_loop(void) {
830 citsmtp *sSMTP = SMTP;
833 syslog(LOG_EMERG, "Session SMTP data is null. WTF? We will crash now.\n");
834 return cit_panic_backtrace (0);
838 memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
839 if (client_getln(cmdbuf, sizeof cmdbuf) < 1) {
840 syslog(LOG_CRIT, "SMTP: client disconnected: ending session.\n");
841 CC->kill_me = KILLME_CLIENT_DISCONNECTED;
844 syslog(LOG_INFO, "SMTP server: %s\n", cmdbuf);
845 while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
847 if (sSMTP->command_state == smtp_user) {
848 smtp_get_user(cmdbuf);
851 else if (sSMTP->command_state == smtp_password) {
852 smtp_get_pass(cmdbuf);
855 else if (sSMTP->command_state == smtp_plain) {
856 smtp_try_plain(cmdbuf);
859 else if (!strncasecmp(cmdbuf, "AUTH", 4)) {
860 smtp_auth(&cmdbuf[5]);
863 else if (!strncasecmp(cmdbuf, "DATA", 4)) {
867 else if (!strncasecmp(cmdbuf, "HELO", 4)) {
868 smtp_hello(&cmdbuf[5], 0);
871 else if (!strncasecmp(cmdbuf, "EHLO", 4)) {
872 smtp_hello(&cmdbuf[5], 1);
875 else if (!strncasecmp(cmdbuf, "LHLO", 4)) {
876 smtp_hello(&cmdbuf[5], 2);
879 else if (!strncasecmp(cmdbuf, "HELP", 4)) {
883 else if (!strncasecmp(cmdbuf, "MAIL", 4)) {
884 smtp_mail(&cmdbuf[5]);
887 else if (!strncasecmp(cmdbuf, "NOOP", 4)) {
888 cprintf("250 NOOP\r\n");
891 else if (!strncasecmp(cmdbuf, "QUIT", 4)) {
892 cprintf("221 Goodbye...\r\n");
893 CC->kill_me = KILLME_CLIENT_LOGGED_OUT;
897 else if (!strncasecmp(cmdbuf, "RCPT", 4)) {
898 smtp_rcpt(&cmdbuf[5]);
901 else if (!strncasecmp(cmdbuf, "RSET", 4)) {
905 else if (!strcasecmp(cmdbuf, "STARTTLS")) {
910 cprintf("502 I'm afraid I can't do that.\r\n");
923 /*****************************************************************************/
924 /* MODULE INITIALIZATION STUFF */
925 /*****************************************************************************/
927 * This cleanup function blows away the temporary memory used by
930 void smtp_cleanup_function(void) {
932 /* Don't do this stuff if this is not an SMTP session! */
933 if (CC->h_command_function != smtp_command_loop) return;
935 syslog(LOG_DEBUG, "Performing SMTP cleanup hook\n");
941 const char *CitadelServiceSMTP_MTA="SMTP-MTA";
942 const char *CitadelServiceSMTPS_MTA="SMTPs-MTA";
943 const char *CitadelServiceSMTP_MSA="SMTP-MSA";
944 const char *CitadelServiceSMTP_LMTP="LMTP";
945 const char *CitadelServiceSMTP_LMTP_UNF="LMTP-UnF";
947 CTDL_MODULE_INIT(smtp)
951 CtdlRegisterServiceHook(config.c_smtp_port, /* SMTP MTA */
956 CitadelServiceSMTP_MTA);
959 CtdlRegisterServiceHook(config.c_smtps_port,
964 CitadelServiceSMTPS_MTA);
967 CtdlRegisterServiceHook(config.c_msa_port, /* SMTP MSA */
972 CitadelServiceSMTP_MSA);
974 CtdlRegisterServiceHook(0, /* local LMTP */
979 CitadelServiceSMTP_LMTP);
981 CtdlRegisterServiceHook(0, /* local LMTP */
982 file_lmtp_unfiltered_socket,
983 lmtp_unfiltered_greeting,
986 CitadelServiceSMTP_LMTP_UNF);
988 CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP);
991 /* return our module name for the log */