RFCs conformed
--------------
+email:
822 - Standard for ARPA Internet Text Messages
2822 - Internet Message Format (updated rfc822)
2045..2049 - Multipurpose Internet Mail Extensions (MIME)
- 3501 - IMAP4rev1
- 2180 - IMAP4 Multi-Accessed Mailbox Practice
- 2683 - IMAP4 Implementation Recommendations
- 1939 - Post Office Protocol - Version 3
- 2449 - POP3 Extension Mechanism
-
+auth:
+ 2245 - Anonymous SASL Mechanism.
2595 - Using TLS with IMAP, POP3 and ACAP
2831 - Using Digest Authentication as a SASL Mechanism (DIGEST-MD5)
- 2245 - Anonymous SASL Mechanism.
5802 - Salted Challenge Response Authentication Mechanism (SCRAM)
SASL and GSS-API Mechanisms
+POP3:
+ 1939 - Post Office Protocol - Version 3
+ 2449 - POP3 Extension Mechanism
+ 3206 - The SYS and AUTH POP Response Codes
+
+IMAP base:
+ 3501 - IMAP4rev1
+ 2180 - IMAP4 Multi-Accessed Mailbox Practice
+ 2683 - IMAP4 Implementation Recommendations
+
+IMAP extensions:
2087 - IMAP4 QUOTA extension
2088 - IMAP4 non-synchronizing literals (LITERAL+)
2177 - IMAP4 IDLE command
case CLIENT_AUTH_RESULT_TEMPFAIL:
client_send_reply(client, POP3_CMD_REPLY_TEMPFAIL, text);
break;
+ case CLIENT_AUTH_RESULT_AUTHFAILED:
+ case CLIENT_AUTH_RESULT_AUTHFAILED_REASON:
+ case CLIENT_AUTH_RESULT_AUTHZFAILED:
+ case CLIENT_AUTH_RESULT_SSL_REQUIRED:
+ client_send_reply(client, POP3_CMD_REPLY_AUTH_ERROR, text);
+ break;
default:
client_send_reply(client, POP3_CMD_REPLY_ERROR, text);
break;
prefix = "+OK";
break;
case POP3_CMD_REPLY_TEMPFAIL:
- prefix = "-ERR [IN-USE]";
+ prefix = "-ERR [SYS/TEMP]";
+ break;
+ case POP3_CMD_REPLY_AUTH_ERROR:
+ prefix = "-ERR [AUTH]";
break;
case POP3_CMD_REPLY_ERROR:
break;
enum pop3_cmd_reply {
POP3_CMD_REPLY_OK,
POP3_CMD_REPLY_ERROR,
+ POP3_CMD_REPLY_AUTH_ERROR,
POP3_CMD_REPLY_TEMPFAIL
};
const char **error_r)
{
const char *lookup_error_str =
- "-ERR [IN-USE] "MAIL_ERRSTR_CRITICAL_MSG"\r\n";
+ "-ERR [SYS/TEMP] "MAIL_ERRSTR_CRITICAL_MSG"\r\n";
struct mail_storage_service_user *user;
struct mail_user *mail_user;
struct client *client;
{
const char *msg;
- msg = t_strdup_printf("-ERR [IN-USE] %s\r\n", errormsg);
+ msg = t_strdup_printf("-ERR [SYS/TEMP] %s\r\n", errormsg);
if (write(client->fd, msg, strlen(msg)) < 0) {
/* ignored */
}
if (IS_STANDALONE() && getuid() == 0 &&
net_getpeername(1, NULL, NULL) == 0) {
- printf("-ERR pop3 binary must not be started from "
+ printf("-ERR [SYS/PERM] pop3 binary must not be started from "
"inetd, use pop3-login instead.\n");
return 1;
}
"TOP\r\n" \
"UIDL\r\n" \
"RESP-CODES\r\n" \
- "PIPELINING\r\n"
+ "PIPELINING\r\n" \
+ "AUTH-RESP-CODE\r\n"
/* + SASL */
*error_r = "Can't sync mailbox: "
"Messages keep getting expunged";
}
- client_send_line(client, "-ERR [IN-USE] Couldn't sync mailbox.");
+ client_send_line(client, "-ERR [SYS/TEMP] Couldn't sync mailbox.");
}
return -1;
}
struct client *client;
enum mailbox_flags flags;
const char *errmsg;
- enum mail_error error;
pool_t pool;
/* always use nonblocking I/O */
client->mailbox = mailbox_alloc(client->inbox_ns->list, "INBOX", flags);
storage = mailbox_get_storage(client->mailbox);
if (mailbox_open(client->mailbox) < 0) {
- errmsg = t_strdup_printf("Couldn't open INBOX: %s",
- mailbox_get_last_error(client->mailbox,
- &error));
- i_error("%s", errmsg);
- client_send_line(client, "-ERR [IN-USE] %s", errmsg);
+ i_error("Couldn't open INBOX: %s",
+ mailbox_get_last_error(client->mailbox, NULL));
+ client_send_storage_error(client);
client_destroy(client, "Couldn't open INBOX");
return NULL;
}
void client_send_storage_error(struct client *client)
{
+ const char *errstr;
+ enum mail_error error;
+
if (mailbox_is_inconsistent(client->mailbox)) {
- client_send_line(client, "-ERR Mailbox is in inconsistent "
+ client_send_line(client, "-ERR [SYS/TEMP] Mailbox is in inconsistent "
"state, please relogin.");
client_disconnect(client, "Mailbox is in inconsistent state.");
return;
}
- client_send_line(client, "-ERR %s",
- mailbox_get_last_error(client->mailbox, NULL));
+ errstr = mailbox_get_last_error(client->mailbox, &error);
+ switch (error) {
+ case MAIL_ERROR_TEMP:
+ case MAIL_ERROR_NOSPACE:
+ case MAIL_ERROR_INUSE:
+ client_send_line(client, "-ERR [SYS/TEMP] %s", errstr);
+ break;
+ default:
+ client_send_line(client, "-ERR [SYS/PERM] %s", errstr);
+ break;
+ }
}
bool client_handle_input(struct client *client)
while (pop3_clients != NULL) {
if (pop3_clients->cmd == NULL) {
client_send_line(pop3_clients,
- "-ERR Server shutting down.");
+ "-ERR [SYS/TEMP] Server shutting down.");
}
client_destroy(pop3_clients, "Server shutting down.");
}