1 #ifndef NULLMAILER__PROTOCOL__H__ 2 #define NULLMAILER__PROTOCOL__H__ 3 4 #include "fdbuf/fdbuf.h" 5 6 #define DEFAULT_CA_FILE "/etc/ssl/certs/ca-certificates.crt" 7 8 extern const int default_port; 9 extern const int default_tls_port; 10 extern void protocol_fail(int e, const char* msg); 11 extern void protocol_succ(const char* msg); 12 13 #define AUTH_DETECT 0 14 #define AUTH_LOGIN 1 15 #define AUTH_PLAIN 2 16 extern const char* user; 17 extern const char* pass; 18 extern int auth_method; 19 extern int port; 20 extern int use_tls; 21 extern int use_starttls; 22 23 extern void protocol_prep(fdibuf& in); 24 extern void protocol_send(fdibuf& in, fdibuf& netin, fdobuf& netout); 25 extern void protocol_starttls(fdibuf& netin, fdobuf& netout); 26 27 extern int tls_insecure; 28 extern int tls_anon_auth; 29 extern const char* tls_x509certfile; 30 extern const char* tls_x509keyfile; 31 extern const char* tls_x509cafile; 32 extern const char* tls_x509crlfile; 33 extern int tls_x509derfmt; 34 extern void tls_init(const char* remote); 35 extern void tls_send(fdibuf& in, int fd); 36 37 #endif 38