c116e589182c258b463850327755e6dd9a731616Stephan Bosch#ifndef LMTP_COMMON_H
c116e589182c258b463850327755e6dd9a731616Stephan Bosch#define LMTP_COMMON_H
c116e589182c258b463850327755e6dd9a731616Stephan Bosch
c116e589182c258b463850327755e6dd9a731616Stephan Boschstruct smtp_address;
c116e589182c258b463850327755e6dd9a731616Stephan Boschstruct smtp_server_cmd_ctx;
c116e589182c258b463850327755e6dd9a731616Stephan Boschstruct smtp_server_cmd_rcpt;
c116e589182c258b463850327755e6dd9a731616Stephan Boschstruct smtp_server_recipient;
c116e589182c258b463850327755e6dd9a731616Stephan Boschstruct client;
c116e589182c258b463850327755e6dd9a731616Stephan Bosch
11c80f46431050af464b044126887e81cb91e929Stephan Boschenum lmtp_recipient_type {
11c80f46431050af464b044126887e81cb91e929Stephan Bosch LMTP_RECIPIENT_TYPE_LOCAL,
11c80f46431050af464b044126887e81cb91e929Stephan Bosch LMTP_RECIPIENT_TYPE_PROXY,
11c80f46431050af464b044126887e81cb91e929Stephan Bosch};
11c80f46431050af464b044126887e81cb91e929Stephan Bosch
c116e589182c258b463850327755e6dd9a731616Stephan Boschstruct lmtp_recipient {
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct client *client;
11c80f46431050af464b044126887e81cb91e929Stephan Bosch enum lmtp_recipient_type type;
c116e589182c258b463850327755e6dd9a731616Stephan Bosch
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct smtp_address *path;
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct smtp_server_cmd_ctx *rcpt_cmd;
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct smtp_server_recipient *rcpt;
c116e589182c258b463850327755e6dd9a731616Stephan Bosch unsigned int index;
c116e589182c258b463850327755e6dd9a731616Stephan Bosch};
c116e589182c258b463850327755e6dd9a731616Stephan Bosch
c116e589182c258b463850327755e6dd9a731616Stephan Boschvoid lmtp_recipient_init(struct lmtp_recipient *rcpt,
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct client *client,
11c80f46431050af464b044126887e81cb91e929Stephan Bosch enum lmtp_recipient_type type,
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct smtp_server_cmd_ctx *cmd,
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct smtp_server_cmd_rcpt *data);
c116e589182c258b463850327755e6dd9a731616Stephan Bosch
c116e589182c258b463850327755e6dd9a731616Stephan Boschvoid lmtp_recipient_finish(struct lmtp_recipient *rcpt,
c116e589182c258b463850327755e6dd9a731616Stephan Bosch struct smtp_server_recipient *trcpt,
c116e589182c258b463850327755e6dd9a731616Stephan Bosch unsigned int index);
c116e589182c258b463850327755e6dd9a731616Stephan Bosch
80f5e1ea615677c1c37be6e7abb888c9cc22de3bStephan Boschstruct lmtp_recipient *
80f5e1ea615677c1c37be6e7abb888c9cc22de3bStephan Boschlmtp_recipient_find_duplicate(struct lmtp_recipient *rcpt,
80f5e1ea615677c1c37be6e7abb888c9cc22de3bStephan Bosch struct smtp_server_transaction *trans);
80f5e1ea615677c1c37be6e7abb888c9cc22de3bStephan Bosch
c116e589182c258b463850327755e6dd9a731616Stephan Bosch#endif