common.h revision c3e30ffd8ac58854cc1162c33b4019a6d710b013
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#ifndef __COMMON_H
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#define __COMMON_H
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#include "lib.h"
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#include "client.h"
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina/* Disconnect client after idling this many seconds */
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#define CLIENT_IDLE_TIMEOUT (60*30)
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina/* If we can't send anything to client for this long, disconnect the client */
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#define CLIENT_OUTPUT_TIMEOUT (5*60)
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina/* Stop buffering more data into output stream after this many bytes */
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#define CLIENT_OUTPUT_OPTIMAL_SIZE 2048
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina/* Disconnect client when it sends too many bad commands in a row */
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#define CLIENT_MAX_BAD_COMMANDS 20
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina/* RFC-2683 recommends at least 8000 bytes. Some clients however don't
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina break large message sets to multiple commands, so we're pretty liberal
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina by default. */
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#define DEFAULT_IMAP_MAX_LINE_LENGTH 65536
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#define DEFAULT_MAX_KEYWORD_LENGTH 50
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaenum client_workarounds {
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina WORKAROUND_DELAY_NEWMAIL = 0x01,
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina WORKAROUND_OUTLOOK_IDLE = 0x02,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina WORKAROUND_NETSCAPE_EOH = 0x04,
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březina WORKAROUND_TB_EXTRA_MAILBOX_SEP = 0x08
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březina};
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaextern struct ioloop *ioloop;
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaextern unsigned int max_keyword_length;
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaextern unsigned int imap_max_line_length;
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaextern enum client_workarounds client_workarounds;
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaextern const char *logout_format;
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaextern string_t *capability_string;
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaextern void (*hook_client_created)(struct client **client);
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#endif
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina