view src/deliver/deliver.h @ 6410:e4eb71ae8e96 HEAD

Changed .h ifdef/defines to use <NAME>_H format.
author Timo Sirainen <tss@iki.fi>
date Sun, 16 Sep 2007 11:31:27 +0300
parents f18a7fd8ac9a
children 95eb92b49d9c
line wrap: on
line source

#ifndef DELIVER_H
#define DELIVER_H

#include <sysexits.h>

#include "lib.h"
#include "mail-storage.h"

#define DEFAULT_MAIL_REJECTION_HUMAN_REASON \
	"Your message to <%t> was automatically rejected:%n%r"

struct deliver_settings {
	const char *hostname;
	const char *postmaster_address;
	const char *sendmail_path;
	const char *rejection_reason;
};

extern struct deliver_settings *deliver_set;

typedef int deliver_mail_func_t(struct mail_namespace *namespaces,
				struct mail_storage **storage_r,
				struct mail *mail,
				const char *username, const char *mailbox);

extern deliver_mail_func_t *deliver_mail;

void deliver_env_clean(void);

/* Save a mail into given mailbox with given flags and keywords. */
int deliver_save(struct mail_namespace *namespaces,
		 struct mail_storage **storage_r, const char *mailbox,
		 struct mail *mail, enum mail_flags flags,
		 const char *const *keywords);

/* Extracts user@domain from Return-Path header. Returns NULL if not found. */
const char *deliver_get_return_address(struct mail *mail);

/* Returns a new unique Message-ID */
const char *deliver_get_new_message_id(void);

#endif