home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / pine4.10.tar.gz / pine4.10.tar / pine4.10 / imap / src / c-client / smtp.h < prev    next >
Text File  |  1998-10-15  |  4KB  |  104 lines

  1. /*
  2.  * Program:    Simple Mail Transfer Protocol (SMTP) routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    27 July 1988
  13.  * Last Edited:    13 October 1998
  14.  *
  15.  * Sponsorship:    The original version of this work was developed in the
  16.  *        Symbolic Systems Resources Group of the Knowledge Systems
  17.  *        Laboratory at Stanford University in 1987-88, and was funded
  18.  *        by the Biomedical Research Technology Program of the National
  19.  *        Institutes of Health under grant number RR-00785.
  20.  *
  21.  * Original version Copyright 1988 by The Leland Stanford Junior University
  22.  * Copyright 1998 by the University of Washington
  23.  *
  24.  *  Permission to use, copy, modify, and distribute this software and its
  25.  * documentation for any purpose and without fee is hereby granted, provided
  26.  * that the above copyright notices appear in all copies and that both the
  27.  * above copyright notices and this permission notice appear in supporting
  28.  * documentation, and that the name of the University of Washington or The
  29.  * Leland Stanford Junior University not be used in advertising or publicity
  30.  * pertaining to distribution of the software without specific, written prior
  31.  * permission.  This software is made available "as is", and
  32.  * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
  33.  * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
  34.  * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  35.  * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
  36.  * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY
  37.  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  38.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  39.  * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
  40.  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  41.  *
  42.  */
  43.  
  44. /* Constants */
  45.  
  46. #define MAXLOGINTRIALS 3    /* maximum number of login trials */
  47. #define SMTPTCPPORT (long) 25    /* assigned TCP contact port */
  48. #define SMTPGREET (long) 220    /* SMTP successful greeting */
  49. #define SMTPAUTHED (long) 235    /* SMTP successful authentication */
  50. #define SMTPOK (long) 250    /* SMTP OK code */
  51. #define SMTPAUTHREADY (long) 334/* SMTP ready for authentication */
  52. #define SMTPREADY (long) 354    /* SMTP ready for data */
  53. #define SMTPSOFTFATAL (long) 421/* SMTP soft fatal code */
  54. #define SMTPWANTAUTH (long) 505    /* SMTP authentication needed */
  55. #define SMTPWANTAUTH2 (long) 530/* SMTP authentication needed */
  56. #define SMTPHARDERROR (long) 554/* SMTP miscellaneous hard failure */
  57.  
  58.  
  59. /* SMTP open options */
  60.  
  61. #define SOP_DEBUG (long) 1    /* debug protocol negotiations */
  62. #define SOP_DSN (long) 2    /* DSN requested */
  63.                 /* DSN notification, none set mean NEVER */
  64. #define SOP_DSN_NOTIFY_FAILURE (long) 4
  65. #define SOP_DSN_NOTIFY_DELAY (long) 8
  66. #define SOP_DSN_NOTIFY_SUCCESS (long) 16
  67.                 /* DSN return full msg vs. header */
  68. #define SOP_DSN_RETURN_FULL (long) 32
  69. #define SOP_8BITMIME 64        /* 8-bit MIME requested */
  70.  
  71.  
  72. /* Convenient access to protocol-specific data */
  73.  
  74. #define ESMTP stream->protocol.esmtp
  75.  
  76.  
  77. /* Compatibility support names */
  78.  
  79. #define smtp_open(hostlist,options) \
  80.   smtp_open_full (NIL,hostlist,"smtp",SMTPTCPPORT,options)
  81.  
  82.  
  83. /* Function prototypes */
  84.  
  85. void *smtp_parameters (long function,void *value);
  86. SENDSTREAM *smtp_open_full (NETDRIVER *dv,char **hostlist,char *service,
  87.                 unsigned long port,long options);
  88. void *smtp_challenge (void *s,unsigned long *len);
  89. long smtp_response (void *s,char *response,unsigned long size);
  90. long smtp_auth (SENDSTREAM *stream,NETMBX *mb,char *tmp);
  91. SENDSTREAM *smtp_close (SENDSTREAM *stream);
  92. long smtp_mail (SENDSTREAM *stream,char *type,ENVELOPE *msg,BODY *body);
  93. void smtp_debug (SENDSTREAM *stream);
  94. void smtp_nodebug (SENDSTREAM *stream);
  95. void smtp_rcpt (SENDSTREAM *stream,ADDRESS *adr,long *error);
  96. long smtp_send (SENDSTREAM *stream,char *command,char *args);
  97. long smtp_send_work (SENDSTREAM *stream,char *command,char *args);
  98. long smtp_send_auth (SENDSTREAM *stream,long code);
  99. long smtp_send_auth_work (SENDSTREAM *stream,NETMBX *mb,char *tmp);
  100. long smtp_reply (SENDSTREAM *stream);
  101. long smtp_ehlo (SENDSTREAM *stream,char *host,NETMBX *mb);
  102. long smtp_fake (SENDSTREAM *stream,long code,char *text);
  103. long smtp_soutr (void *stream,char *s);
  104.