Added SMTP HELP command to piler-smtp

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2021-02-08 20:36:11 +01:00
parent a1d81a0281
commit 5d70881463
2 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,11 @@ void process_smtp_command(struct smtp_session *session, char *buf, struct config
return; return;
} }
if(strncasecmp(buf, SMTP_CMD_HELP, strlen(SMTP_CMD_HELP)) == 0){
send_smtp_response(session, SMTP_RESP_221_PILER_SMTP_OK);
return;
}
if(strncasecmp(buf, SMTP_CMD_MAIL_FROM, strlen(SMTP_CMD_MAIL_FROM)) == 0){ if(strncasecmp(buf, SMTP_CMD_MAIL_FROM, strlen(SMTP_CMD_MAIL_FROM)) == 0){
process_command_mail_from(session, buf); process_command_mail_from(session, buf);
return; return;

View File

@ -18,6 +18,7 @@
#define SMTP_CMD_HELO "HELO" #define SMTP_CMD_HELO "HELO"
#define SMTP_CMD_EHLO "EHLO" #define SMTP_CMD_EHLO "EHLO"
#define SMTP_CMD_HELP "HELP"
#define SMTP_CMD_MAIL_FROM "MAIL FROM:" #define SMTP_CMD_MAIL_FROM "MAIL FROM:"
#define SMTP_CMD_RCPT_TO "RCPT TO:" #define SMTP_CMD_RCPT_TO "RCPT TO:"
#define SMTP_CMD_DATA "DATA" #define SMTP_CMD_DATA "DATA"
@ -32,6 +33,7 @@
// SMTP responses // SMTP responses
#define SMTP_RESP_221_PILER_SMTP_OK "221 piler-smtp is OK\r\n"
#define SMTP_RESP_220_BANNER "220 %s ESMTP\r\n" #define SMTP_RESP_220_BANNER "220 %s ESMTP\r\n"
#define SMTP_RESP_220_READY_TO_START_TLS "220 Ready to start TLS\r\n" #define SMTP_RESP_220_READY_TO_START_TLS "220 Ready to start TLS\r\n"
#define SMTP_RESP_221_GOODBYE "221 %s Goodbye\r\n" #define SMTP_RESP_221_GOODBYE "221 %s Goodbye\r\n"