MODULE SPOP3DEF IDENT "SPOP3DEF-1-X"; /*++ /* Facility: /* StarLet POP3 Server /* /* Abstract: /* An interface module defined POP3 primitives, constants, this story is based on /* RFC1939 (ftp://ftp.rfc-editor.org/in-notes/rfc1939.txt) /* /* /* Author: /* Ruslan R. Laishev /* /* Creation Date: 23-MAR-2005 /* /* Modification History: /* /* 1-SEP-2005 Added lkid field into the pop3ctx structure. /* 9-NOV-2005 Added sent flag to the message context structure. /* /*-- /* /* Include RMS definitions /* read "rmsusr.sdi"; CONSTANT PORT EQUALS 110 PREFIX POP3__$; CONSTANT LINESZ EQUALS 78 PREFIX SPOP3__$; CONSTANT EXPIRE EQUALS 0 PREFIX POP3__$; CONSTANT LOGINTVL EQUALS 180 PREFIX POP3__$; CONSTANT TIMEOUT EQUALS 90 PREFIX SPOP3__$; /* /**++ /** /** POP3 Server-Clients command constants /** /**-- /* CONSTANT ( QUIT, /* QUIT Command STAT, /* STAT Command _LIST, /* LIST [msg] Command RETR, /* RETR msg Command DELE, /* DELE msg Command NOOP, /* NOOP Command RSET, /* RSET Command TOP, /* TOP msg n Command UIDL, /* UIDL [msg] Command USER, /* USER name Command PASS, /* PASS pass Command SHUTDOWN, /* SHUTDOWN management command RESTART, /* RESTART management command STATUS, /* STATUS management command ) EQUALS 1 INCREMENT 1 PREFIX POP3CMD$; CONSTANT ( INITIAL, LOGGED ) EQUALS 0 INCREMENT 1 PREFIX POP3LVL$; /* /**++ /** /** Workers/threads context data structure /** /**-- /* AGGREGATE pop3ctx STRUCTURE PREFIX pop3ctx$; /* Session context structure flink ADDRESS; blink ADDRESS; dummy LONGWORD UNSIGNED DIMENSION 4 FILL; tid QUADWORD UNSIGNED; /* Thread ID, pthread_t tid_ QUADWORD UNSIGNED; idx BYTE UNSIGNED; /* Thread index chan LONGWORD UNSIGNED; /* Network I/O channel ulen BYTE UNSIGNED; uname CHARACTER DIMENSION 12; alen BYTE UNSIGNED; addr CHARACTER DIMENSION 15; level LONGWORD UNSIGNED; /* Session level, see POP3LVL* maildir CHARACTER DIMENSION 255; msgctx LONGWORD UNSIGNED; /* MAIL$_MESSAGE_FILE_CTX mfile LONGWORD UNSIGNED; /* MAIL.MAI file context mlist ADDRESS (mhdr); /* Link to list of mail header mlistsz LONGWORD UNSIGNED; /* List count mlast ADDRESS (mhdr); /* Link to last accessed mail header mdeltd LONGWORD UNSIGNED; /* Count of deleted messages mlines LONGWORD UNSIGNED; /* Total size of all mails in lines mfab FABDEF; /* FAB structure mrab RABDEF; /* RAB structure flags STRUCTURE PREFIX pop3ctx$; debug BITFIELD LENGTH 1 MASK; /* Session is under debug termd BITFIELD LENGTH 1 MASK; /* Session has been terminated used BITFIELD LENGTH 1 MASK; /* Context is in use END flags; expire LONGWORD UNSIGNED; /* A day to keep messages lkid LONGWORD UNSIGNED; /* A VMS Lock Id END pop3ctx; /* /**++ /** /** Mail list structure /** /**-- /* AGGREGATE mhdr STRUCTURE PREFIX mhdr$; /* Mail header structure next ADDRESS (mhdr); /* Link to next mail header structure date UNION; /* MAIL$_MESSAGE_BINARY_DATE date LONGWORD UNSIGNED DIMENSION 2; date QUADWORD UNSIGNED; END date; messid LONGWORD UNSIGNED; /* MAIL$_MESSAGE_ID fromlen BYTE UNSIGNED; from CHARACTER DIMENSION 255; /* MAIL$_MESSAGE_FROM tolen BYTE UNSIGNED; to CHARACTER DIMENSION 255; /* MAIL$_MESSAGE_TO subjlen BYTE UNSIGNED; subj CHARACTER DIMENSION 255; /* MAIL$_MESSAGE_SUBJECT lines LONGWORD UNSIGNED; /* MAIL$_MESSAGE_SIZE extlen BYTE UNSIGNED; extid CHARACTER DIMENSION 255; /* MAIL$_MESSAGE_EXTID flags WORD UNSIGNED; /* MAIL$_MESSAGE_RETURN_FLAGS iflags STRUCTURE PREFIX MHDR$; decnet BITFIELD LENGTH 1 MASK; /* Message sent with DECNET deleted BITFIELD LENGTH 1 MASK; /* Message is marked for DELEtion sent BITFIELD LENGTH 1 MASK; /* Message has been sent END iflags; END mhdr; END_MODULE SPOP3DEF;