/* Copyright (c) 2005-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "hostpid.h"
#include "istream.h"
#include "ostream.h"
#include "str.h"
#include "str-sanitize.h"
#include "var-expand.h"
#include "message-date.h"
#include "message-size.h"
#include "message-address.h"
#include "istream-header-filter.h"
#include "mail-storage.h"
#include "mail-storage-settings.h"
#include "iostream-ssl.h"
#include "lda-settings.h"
#include "mail-deliver.h"
#include "smtp-address.h"
#include "smtp-submit.h"
#include "mail-send.h"
static const struct var_expand_table *
const struct smtp_address *recipient,
const char *reason)
{
const char *subject;
subject = "";
{ 'n', "\r\n", "crlf" },
};
return tab;
}
const struct smtp_address *recipient,
const char *reason)
{
int ret;
orig_msgid = NULL;
i_info("msgid=%s: Auto-submitted message discarded: %s",
return 0;
}
if (smtp_address_isnull(return_addr)) {
i_info("msgid=%s: Return-Path missing, rejection reason: %s",
return 0;
}
&error)) {
i_error("msgid=%s: Invalid postmaster_address - can't send rejection: %s",
return -1;
}
i_debug("Sending a rejection to <%s>: %s",
}
"\tboundary=\"%s\"\r\n",
boundary);
i_error("Failed to expand rejection_subject=%s: %s",
}
/* human readable status report */
i_error("Failed to expand rejection_reason=%s: %s",
}
/* DSN status report: For LDA rejects. currently only used when
user is out of quota */
"Content-Type: message/delivery-status\r\n\r\n",
boundary);
} else {
/* MDN status report: For Sieve "reject" */
"Content-Type: message/disposition-notification\r\n\r\n",
boundary);
if (orig_msgid != NULL)
"automatic-action/MDN-sent-automatically; deleted\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"
};
}
str_truncate(str, 0);
i_error("msgid=%s: Temporarily failed to send rejection: %s",
} else if (ret == 0) {
i_info("msgid=%s: Permanently failed to send rejection: %s",
}
return ret < 0 ? -1 : 0;
}