comparison src/mail/ngx_mail_parse.c @ 394:a96157df5186

Mail: extensibility. - If mail module enabled, honor mail dependencies while building addons. - Introduce handlers for external mail modules: handler_init_session, handler_init_protocol, handler_read. - Parse some additional smtp commands, fix generic handler to live with it. - Some missing macros, some functions (notably command parsing) non-static.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 18 Jul 2007 00:47:55 +0000
parents f745bf973510
children f9e6413396d4
comparison
equal deleted inserted replaced
320:95183808f549 394:a96157df5186
644 644
645 } else if (c0 == 'R' && c1 == 'S' && c2 == 'E' && c3 == 'T') 645 } else if (c0 == 'R' && c1 == 'S' && c2 == 'E' && c3 == 'T')
646 { 646 {
647 s->command = NGX_SMTP_RSET; 647 s->command = NGX_SMTP_RSET;
648 648
649 } else if (c0 == 'R' && c1 == 'C' && c2 == 'P' && c3 == 'T')
650 {
651 s->command = NGX_SMTP_RCPT;
652
653 } else if (c0 == 'V' && c1 == 'R' && c2 == 'F' && c3 == 'Y')
654 {
655 s->command = NGX_SMTP_VRFY;
656
657 } else if (c0 == 'E' && c1 == 'X' && c2 == 'P' && c3 == 'N')
658 {
659 s->command = NGX_SMTP_EXPN;
660
661 } else if (c0 == 'H' && c1 == 'E' && c2 == 'L' && c3 == 'P')
662 {
663 s->command = NGX_SMTP_HELP;
664
649 } else { 665 } else {
650 goto invalid; 666 goto invalid;
651 } 667 }
668
669 #if (NGX_MAIL_SSL)
670 } else if (p - c == 8) {
671
672 if ((c[0] == 'S'|| c[0] == 's')
673 && (c[1] == 'T'|| c[1] == 't')
674 && (c[2] == 'A'|| c[2] == 'a')
675 && (c[3] == 'R'|| c[3] == 'r')
676 && (c[4] == 'T'|| c[4] == 't')
677 && (c[5] == 'T'|| c[5] == 't')
678 && (c[6] == 'L'|| c[6] == 'l')
679 && (c[7] == 'S'|| c[7] == 's'))
680 {
681 s->command = NGX_SMTP_STARTTLS;
682
683 } else {
684 goto invalid;
685 }
686 #endif
652 687
653 } else { 688 } else {
654 goto invalid; 689 goto invalid;
655 } 690 }
656 691