* RFC 821 - Simple Mail Transfer Protocol
* RFC 876 - Survey of SMTP Implementations
* RFC 1047 - Duplicate messages and SMTP
- * RFC 1854 - command pipelining
+ * RFC 1652 - 8 bit MIME
* RFC 1869 - Extended Simple Mail Transfer Protocol
* RFC 1870 - SMTP Service Extension for Message Size Declaration
- * RFC 1893 - Enhanced Mail System Status Codes
* RFC 2033 - Local Mail Transfer Protocol
- * RFC 2034 - SMTP Service Extension for Returning Enhanced Error Codes
* RFC 2197 - SMTP Service Extension for Command Pipelining
* RFC 2476 - Message Submission
* RFC 2487 - SMTP Service Extension for Secure SMTP over TLS
* Login greeting common to all auth methods
*/
void smtp_auth_greeting(void) {
- cprintf("235 2.0.0 Hello, %s\r\n", CC->user.fullname);
+ cprintf("235 Hello, %s\r\n", CC->user.fullname);
lprintf(CTDL_NOTICE, "SMTP authenticated %s\n", CC->user.fullname);
CC->internal_pgm = 0;
CC->cs_flags &= ~CS_STEALTH;
cprintf("250-SIZE %ld\r\n", config.c_maxmsglen);
#ifdef HAVE_OPENSSL
-
- /* Only offer the PIPELINING command if TLS is inactive,
- * because of flow control issues. Also, avoid offering TLS
- * if TLS is already active. Finally, we only offer TLS on
+ /*
+ * Offer TLS, but only if TLS is not already active.
+ * Furthermore, only offer TLS when running on
* the SMTP-MSA port, not on the SMTP-MTA port, due to
* questionable reliability of TLS in certain sending MTA's.
*/
if ( (!CC->redirect_ssl) && (SMTP->is_msa) ) {
- cprintf("250-PIPELINING\r\n");
cprintf("250-STARTTLS\r\n");
}
-
-#else /* HAVE_OPENSSL */
-
- /* Non SSL enabled server, so always offer PIPELINING. */
- cprintf("250-PIPELINING\r\n");
-
#endif /* HAVE_OPENSSL */
- cprintf("250-AUTH LOGIN PLAIN\r\n");
- cprintf("250-AUTH=LOGIN PLAIN\r\n");
-
- cprintf("250 ENHANCEDSTATUSCODES\r\n");
+ cprintf("250-AUTH LOGIN PLAIN\r\n"
+ "250-AUTH=LOGIN PLAIN\r\n"
+ "250 8BITMIME\r\n"
+ );
}
}
SMTP->command_state = smtp_password;
}
else {
- cprintf("500 5.7.0 No such user.\r\n");
+ cprintf("500 No such user.\r\n");
SMTP->command_state = smtp_command;
}
}
smtp_auth_greeting();
}
else {
- cprintf("535 5.7.0 Authentication failed.\r\n");
+ cprintf("535 Authentication failed.\r\n");
}
SMTP->command_state = smtp_command;
}
return;
}
}
- cprintf("504 5.7.4 Authentication failed.\r\n");
+ cprintf("504 Authentication failed.\r\n");
}
char encoded_authstring[1024];
if (CC->logged_in) {
- cprintf("504 5.7.4 Already logged in.\r\n");
+ cprintf("504 Already logged in.\r\n");
return;
}
}
if (strncasecmp(method, "login", 5) ) {
- cprintf("504 5.7.4 Unknown authentication method.\r\n");
+ cprintf("504 Unknown authentication method.\r\n");
return;
}
SMTP->is_unfiltered = is_unfiltered;
if (do_response) {
- cprintf("250 2.0.0 Zap!\r\n");
+ cprintf("250 Zap!\r\n");
}
}
char name[SIZ];
if (!IsEmptyStr(SMTP->from)) {
- cprintf("503 5.1.0 Only one sender permitted\r\n");
+ cprintf("503 Only one sender permitted\r\n");
return;
}
if (strncasecmp(argbuf, "From:", 5)) {
- cprintf("501 5.1.7 Syntax error\r\n");
+ cprintf("501 Syntax error\r\n");
return;
}
*/
if (CC->logged_in) {
safestrncpy(SMTP->from, CC->cs_inet_email, sizeof SMTP->from);
- cprintf("250 2.1.0 Sender ok <%s>\r\n", SMTP->from);
+ cprintf("250 Sender ok <%s>\r\n", SMTP->from);
SMTP->message_originated_locally = 1;
return;
}
else if (config.c_allow_spoofing == 0) {
process_rfc822_addr(SMTP->from, user, node, name);
if (CtdlHostAlias(node) != hostalias_nomatch) {
- cprintf("550 5.7.1 "
- "You must log in to send mail from %s\r\n",
- node);
+ cprintf("550 You must log in to send mail from %s\r\n", node);
strcpy(SMTP->from, "");
return;
}
}
- cprintf("250 2.0.0 Sender ok\r\n");
+ cprintf("250 Sender ok\r\n");
}
struct recptypes *valid = NULL;
if (IsEmptyStr(SMTP->from)) {
- cprintf("503 5.5.1 Need MAIL before RCPT\r\n");
+ cprintf("503 Need MAIL before RCPT\r\n");
return;
}
if (strncasecmp(argbuf, "To:", 3)) {
- cprintf("501 5.1.7 Syntax error\r\n");
+ cprintf("501 Syntax error\r\n");
return;
}
if ( (SMTP->is_msa) && (!CC->logged_in) ) {
- cprintf("550 5.1.8 "
- "You must log in to send mail on this port.\r\n");
+ cprintf("550 You must log in to send mail on this port.\r\n");
strcpy(SMTP->from, "");
return;
}
stripallbut(recp, '<', '>');
if ( (strlen(recp) + strlen(SMTP->recipients) + 1 ) >= SIZ) {
- cprintf("452 4.5.3 Too many recipients\r\n");
+ cprintf("452 Too many recipients\r\n");
return;
}
smtp_get_Recipients (),
(CC->logged_in)? POST_LOGGED_IN:POST_EXTERNAL);
if (valid->num_error != 0) {
- cprintf("599 5.1.1 Error: %s\r\n", valid->errormsg);
+ cprintf("599 Error: %s\r\n", valid->errormsg);
free_recipients(valid);
return;
}
if (valid->num_internet > 0) {
if (CC->logged_in) {
if (CtdlCheckInternetMailPermission(&CC->user)==0) {
- cprintf("551 5.7.1 <%s> - you do not have permission to send Internet mail\r\n", recp);
+ cprintf("551 <%s> - you do not have permission to send Internet mail\r\n", recp);
free_recipients(valid);
return;
}
if (valid->num_internet > 0) {
if ( (SMTP->message_originated_locally == 0)
&& (SMTP->is_lmtp == 0) ) {
- cprintf("551 5.7.1 <%s> - relaying denied\r\n", recp);
+ cprintf("551 <%s> - relaying denied\r\n", recp);
free_recipients(valid);
return;
}
}
- cprintf("250 2.1.5 RCPT ok <%s>\r\n", recp);
+ cprintf("250 RCPT ok <%s>\r\n", recp);
if (!IsEmptyStr(SMTP->recipients)) {
strcat(SMTP->recipients, ",");
}
char result[SIZ];
if (IsEmptyStr(SMTP->from)) {
- cprintf("503 5.5.1 Need MAIL command first.\r\n");
+ cprintf("503 Need MAIL command first.\r\n");
return;
}
if (SMTP->number_of_recipients < 1) {
- cprintf("503 5.5.1 Need RCPT command first.\r\n");
+ cprintf("503 Need RCPT command first.\r\n");
return;
}
body = CtdlReadMessageBody(".", config.c_maxmsglen, body, 1, 0);
if (body == NULL) {
- cprintf("550 5.6.5 "
- "Unable to save message: internal error.\r\n");
+ cprintf("550 Unable to save message: internal error.\r\n");
return;
}
}
#endif
else {
- cprintf("502 5.0.0 I'm afraid I can't do that.\r\n");
+ cprintf("502 I'm afraid I can't do that.\r\n");
}