/* * hotwayd.h -- is a POP3-HTTPMail gateway. It will allow you to * check your HOTMAIL account from your unix box. * Created: Espeleta Tomas , 12-Apr-2001 * This POP3 code is based on nupop-0.4, by Kevin Stone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #include #include #include #include #include #include #include #include #define N_BUFLEN 1024 /* used for reading in commands to pop3/imap/smtp proxy */ #define N_BUFFER 1024 #define N_MYBUF 1024 #define N_PAIR 1024 #define PAM_SERVICE_NAME "hotway" #define SYSLOGNAME "hotway" #define SYSLOGFACILITY LOG_LOCAL7 #define COPY 1 #define MOVE 2 #define TRASH 3 #ifndef MIN # define MIN(a,b) (((a)<(b))?(a):(b)) #endif /* the following are login errors */ #define E_LOGIN_OK 0 #define E_LOGIN_UNRECOGNISED_DOMAIN 1 #define E_LOGIN_NO_DOMAIN 2 #define E_LOGIN_NOTALLOWED 3 /* #define PSOUT(args...) printf( args) */ #define PSOUT(args) fputs( args, stdout) #define PFSOUT(args...) printf( args) #define PCHAR(y) putchar(y) #define PFLUSH fflush(stdout); #define PCRLF PSOUT("\015\012"); fflush(stdout); #define LOG(args...) syslog(LOG_DEBUG, args ); DPRINTF( args ); #define OPENLOG openlog(SYSLOGNAME, LOG_PID | LOG_NDELAY, SYSLOGFACILITY); #define CLOSELOG closelog(); #ifdef DEBUG #define DPRINTF(args...) printf( args) #else #define DPRINTF(args...) #endif /* the OpenBSD strlcpy/strlcat functions */ size_t strlcpy(char *, const char*, size_t); size_t strlcat(char *, const char*, size_t); #define MAXARGC 4 typedef struct cmdtable { char name[20]; int states; void (*handler)(struct cmdtable *, int, char *[]); int argc; char *argv[MAXARGC]; long timestamp; char *response; } cmdtable;