smtpap.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /**
  2. * smtpap.h
  3. * SMTP Application Proxy for Onion Routing
  4. *
  5. * Matej Pfajfar <mp292@cam.ac.uk>
  6. */
  7. /*
  8. * Changes :
  9. * $Log$
  10. * Revision 1.1 2002/06/26 22:45:50 arma
  11. * Initial revision
  12. *
  13. * Revision 1.12 2002/01/29 01:00:10 mp292
  14. * All network operations are now timeoutable.
  15. *
  16. * Revision 1.11 2002/01/26 21:50:17 mp292
  17. * Reviewed according to Secure-Programs-HOWTO. Still need to deal with network
  18. * timeouts.
  19. *
  20. * Revision 1.10 2001/12/18 14:56:29 badbytes
  21. * *** empty log message ***
  22. *
  23. * Revision 1.9 2001/12/18 14:43:19 badbytes
  24. * Added DEFAULT_SMTP_PORT.
  25. *
  26. * Revision 1.8 2001/12/12 16:02:29 badbytes
  27. * Testing completed.
  28. *
  29. * Revision 1.7 2001/12/11 10:43:21 badbytes
  30. * MAIL and RCPT handling completed. Still coding connection to Onion Proxy.
  31. *
  32. * Revision 1.6 2001/12/10 16:10:35 badbytes
  33. * Wrote a tokenize() function to help with parsing input from SMTP clients.
  34. *
  35. * Revision 1.5 2001/12/07 15:02:43 badbytes
  36. * Server setup code completed.
  37. *
  38. */
  39. #ifndef __SMTPAP_H
  40. #define __SMTPAP_H
  41. #define SMTPAP_CRLF "\015\012"
  42. #define SMTPAP_CRLF_LEN 2
  43. #define SMTPAP_CR '\015'
  44. #define SMTPAP_LF '\012'
  45. /* terminator for DATA input */
  46. #define SMTPAP_ENDDATA "\015\012.\015\012"
  47. #define SMTPAP_ENDDATA_LEN 5
  48. /* characters that separate tokens in SMTPAP commands */
  49. #define SMTPAP_SEPCHARS " \t\015\012" /* for general commands */
  50. #define SMTPAP_PATH_SEPCHARS " \t\015\012<>" /* for forward and reverse path */
  51. /* default listening port */
  52. #define SMTPAP_LISTEN_PORT 25
  53. /* default SMTP port */
  54. #define SMTPAP_DEFAULT_SMTP_PORT 25
  55. /* default connection timeout */
  56. #define SMTPAP_DEFAULT_CONN_TIMEOUT 120; /* 120s */
  57. /* SMTP commands and their lengths */
  58. #define SMTPAP_QUIT "quit"
  59. #define SMTPAP_QUIT_LEN 4
  60. #define SMTPAP_HELO "helo"
  61. #define SMTPAP_HELO_LEN 4
  62. #define SMTPAP_EHLO "ehlo"
  63. #define SMTPAP_EHLO_LEN 4
  64. #define SMTPAP_MAIL "mail"
  65. #define SMTPAP_MAIL_LEN 4
  66. #define SMTPAP_RSET "rset"
  67. #define SMTPAP_RSET_LEN 4
  68. #define SMTPAP_RCPT "rcpt"
  69. #define SMTPAP_RCPT_LEN 4
  70. #define SMTPAP_DATA "data"
  71. #define SMTPAP_DATA_LEN 4
  72. #endif