#include "recvattach.h"
#include "buffy.h"
#include "thread.h"
+#include "mutt_sasl.h"
#include <imap/imap_private.h>
#include <nntp/nntp.h>
#endif
-#ifdef USE_SASL
-#include "mutt_sasl.h"
-#endif
-
static const char *No_mailbox_is_open = N_("No mailbox is open.");
static const char *There_are_no_messages = N_("There are no messages.");
static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
/* Close all open NNTP connections */
nntp_logout_all ();
#endif
-#ifdef USE_SASL
mutt_sasl_done ();
-#endif
}
mutt_menuDestroy (&menu);
* a protection buffer. */
#define M_SASL_MAXBUF 65536
-#define IP_PORT_BUFLEN 1024
+typedef struct {
+ sasl_conn_t *saslconn;
+ const sasl_ssf_t *ssf;
+ const unsigned int *pbufsize;
+
+ /* read buffer */
+ char *buf;
+ unsigned blen;
+ unsigned int bpos;
+
+ /* underlying socket data */
+ void *sockdata;
+ int (*msasl_open) (CONNECTION * conn);
+ int (*msasl_close) (CONNECTION * conn);
+ int (*msasl_read) (CONNECTION * conn, char *buf, ssize_t len);
+ int (*msasl_write) (CONNECTION * conn, const char *buf, ssize_t count);
+} SASL_DATA;
static sasl_callback_t mutt_sasl_callbacks[5];
struct sockaddr_storage local, remote;
socklen_t size;
- char iplocalport[IP_PORT_BUFLEN], ipremoteport[IP_PORT_BUFLEN];
+ char iplocalport[STRING], ipremoteport[STRING];
const char *service;
int rc;
size = sizeof(local);
if (getsockname(conn->fd, (struct sockaddr *) &local, &size)
- || iptostring(&local, iplocalport, IP_PORT_BUFLEN) != SASL_OK)
+ || iptostring(&local, iplocalport, STRING) != SASL_OK)
{
return -1;
}
size = sizeof(remote);
if (getpeername(conn->fd, (struct sockaddr *) &remote, &size)
- || iptostring(&remote, ipremoteport, IP_PORT_BUFLEN) != SASL_OK)
+ || iptostring(&remote, ipremoteport, STRING) != SASL_OK)
{
return -1;
}
void mutt_sasl_setup_conn (CONNECTION *, sasl_conn_t *);
void mutt_sasl_done(void);
-typedef struct {
- sasl_conn_t *saslconn;
- const sasl_ssf_t *ssf;
- const unsigned int *pbufsize;
-
- /* read buffer */
- char *buf;
- unsigned blen;
- unsigned int bpos;
-
- /* underlying socket data */
- void *sockdata;
- int (*msasl_open) (CONNECTION * conn);
- int (*msasl_close) (CONNECTION * conn);
- int (*msasl_read) (CONNECTION * conn, char *buf, ssize_t len);
- int (*msasl_write) (CONNECTION * conn, const char *buf, ssize_t count);
-} SASL_DATA;
-
#endif /* _MUTT_SASL_H_ */