mail-send.c revision 83bb013a99f0936995f9c7a1077822662d8fefdb
/* Copyright (C) 2005-2006 Timo Sirainen */
#include "lib.h"
#include "ioloop.h"
#include "hostpid.h"
#include "istream.h"
#include "str.h"
#include "str-sanitize.h"
#include "var-expand.h"
#include "message-date.h"
#include "message-size.h"
#include "duplicate.h"
#include "istream-header-filter.h"
#include "smtp-client.h"
#include "deliver.h"
#include "mail-send.h"
int global_outgoing_count = 0;
static const struct var_expand_table *
const char *recipient)
{
static struct var_expand_table static_tab[] = {
{ 'n', NULL },
{ 'r', NULL },
{ 's', NULL },
{ 't', NULL },
{ '\0', NULL }
};
struct var_expand_table *tab;
const char *subject;
subject = "";
return tab;
}
const char *reason)
{
struct smtp_client *smtp_client;
FILE *f;
struct message_size hdr_size;
const char *return_addr, *str;
const unsigned char *data;
int ret;
orig_msgid = NULL;
if (return_addr == NULL) {
i_info("msgid=%s: Return-Path missing, rejection reason: %s",
return 0;
}
fprintf(f, "From: Mail Delivery Subsystem <%s>\r\n",
fprintf(f, "MIME-Version: 1.0\r\n");
fprintf(f, "Content-Type: "
"\tboundary=\"%s\"\r\n", boundary);
fprintf(f, "Subject: Automatically rejected mail\r\n");
fprintf(f, "Auto-Submitted: auto-replied (rejected)\r\n");
fprintf(f, "Precedence: bulk\r\n");
fprintf(f, "\r\nThis is a MIME-encapsulated message\r\n\r\n");
/* human readable status report */
fprintf(f, "Content-Disposition: inline\r\n");
fprintf(f, "Content-Transfer-Encoding: 8bit\r\n\r\n");
/* MDN status report */
fprintf(f, "--%s\r\n"
"Content-Type: message/disposition-notification\r\n\r\n",
boundary);
fprintf(f, "Reporting-UA: %s; Dovecot Mail Delivery Agent\r\n",
if (orig_msgid != NULL)
fprintf(f, "Disposition: "
"automatic-action/MDN-sent-automatically; deleted\r\n");
fprintf(f, "\r\n");
/* original message's headers */
/* Note: If you add more headers, they need to be sorted.
We'll drop Content-Type because we're not including the message
body, and having a multipart Content-Type may confuse some
MIME parsers when they don't see the message boundaries. */
static const char *const exclude_headers[] = {
"Content-Type"
};
sizeof(exclude_headers) / sizeof(exclude_headers[0]),
break;
}
}
return smtp_client_close(smtp_client);
}
{
static const char *hide_headers[] = {
"Return-Path"
};
struct smtp_client *smtp_client;
FILE *f;
const unsigned char *data;
const char *return_path;
int ret;
return -1;
return_path = "";
sizeof(hide_headers) /
sizeof(hide_headers[0]),
break;
}
return smtp_client_close(smtp_client);
}