2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#ifndef SUBMISSION_COMMON_H
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#define SUBMISSION_COMMON_H
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#include "lib.h"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#include "array.h"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#include "ioloop.h"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#include "smtp-reply.h"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#include "smtp-server.h"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#include "submission-client.h"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#include "submission-settings.h"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#define URL_HOST_ALLOW_ANY "*"
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch/* Maximum number of bytes added to a relayed message. This is used to
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch calculate the SIZE capability based on what the backend server states. */
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#define SUBMISSION_MAX_ADDITIONAL_MAIL_SIZE 1024
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#define SUBMISSION_MAIL_DATA_MAX_INMEMORY_SIZE (1024*128)
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
961a5c472495203d4714a059a192fb0bf72d56d5Stephan Bosch/* Maximum time to wait for QUIT reply from relay server */
961a5c472495203d4714a059a192fb0bf72d56d5Stephan Bosch#define SUBMISSION_MAX_WAIT_QUIT_REPLY_MSECS 2000
961a5c472495203d4714a059a192fb0bf72d56d5Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschtypedef void submission_client_created_func_t(struct client **client);
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschextern submission_client_created_func_t *hook_client_created;
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschextern bool submission_debug;
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschextern struct smtp_server *smtp_server;
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschextern struct smtp_client *smtp_client;
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch/* Sets the hook_client_created and returns the previous hook,
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch which the new_hook should call if it's non-NULL. */
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschsubmission_client_created_func_t *
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschsubmission_client_created_hook_set(submission_client_created_func_t *new_hook);
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschvoid submission_refresh_proctitle(void);
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Boschvoid client_handshake(struct client *client);
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch
2cbbe9b4829adb184c83dbf780316f4144559054Stephan Bosch#endif