Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 9adab841b2346eed28e146b23c25375c > files > 148

exim-doc-4.73-2.fc15.noarch.rpm

<!DOCTYPE html PUBLIC "XSLT-compat">
<html lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../common.css">
<meta name="author" content="The Exim Project. &lt;http://www.exim.org/&gt;">
<meta name="copyright" content="Copyright ©2010 The Exim Project. All rights reserved">
<meta name="description" content="Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet.">
<meta name="keywords" content="exim,smtp,mta,email">
<meta name="robots" content="noodp,noydir,index,follow">
<meta name="viewport" content="width=device-width">
<title>46. Customizing bounce and warning messages</title>
<link rel="stylesheet" type="text/css" href="../../../../doc/chapter.css">
<link rel="canonical" href="http://www.exim.org/exim-html-current/doc/html/spec_html/ch46.html">
</head>
<body>
<h1 id="header"><a href="../../../..">Exim Internet Mailer</a></h1>
<div id="outer">
<ul id="nav_flow" class="nav">
<li><a href="../../../../index.html">Home</a></li>
<li><a href="../../../../mirrors.html">Download</a></li>
<li><a href="../../../../docs.html">Documentation</a></li>
<li><a href="../../../../maillist.html">Mailing Lists</a></li>
<li><a href="http://wiki.exim.org/">Wiki</a></li>
<li><a href="http://www.exim.org/bugzilla/">Bugs</a></li>
<li><a href="../../../../credits.html">Credits</a></li>
<li class="search"><form action="http://www.google.com/search" method="get">
<span class="search_field_container"><input type="search" name="q" placeholder="Search Docs" class="search_field"></span><input type="hidden" name="hl" value="en"><input type="hidden" name="ie" value="UTF-8"><input type="hidden" name="as_qdr" value="all"><input type="hidden" name="q" value="site:www.exim.org"><input type="hidden" name="q" value="inurl:exim-html-current">
</form></li>
</ul>
<div id="inner"><div id="content">
<a class="previous_page" href="ch45.html">&lt;-previous</a><a class="next_page" href="ch47.html">next-&gt;</a><div id="chapter" class="chapter">
<h2 id="CHAPemsgcust" class="">Chapter 46 - Customizing bounce and warning messages</h2>
<p>
When a message fails to be delivered, or remains on the queue for more than a
configured amount of time, Exim sends a message to the original sender, or
to an alternative configured address. The text of these messages is built into
the code of Exim, but it is possible to change it, either by adding a single
string, or by replacing each of the paragraphs by text supplied in a file.
</p>
<p>
The <span class="docbook_emphasis">From:</span> and <span class="docbook_emphasis">To:</span> header lines are automatically generated; you can
cause a <span class="docbook_emphasis">Reply-To:</span> line to be added by setting the <span class="docbook_option">errors_reply_to</span>
option. Exim also adds the line
</p>
<div class="docbook_literallayout"><pre>
Auto-Submitted: auto-generated
</pre></div>
<p>
to all warning and bounce messages,
</p>
<div class="section">
<h3 id="SECID239" class="">1. Customizing bounce messages</h3>
<p>


If <span class="docbook_option">bounce_message_text</span> is set, its contents are included in the default
message immediately after “This message was created automatically by mail
delivery software.” The string is not expanded. It is not used if
<span class="docbook_option">bounce_message_file</span> is set.
</p>
<p>
When <span class="docbook_option">bounce_message_file</span> is set, it must point to a template file for
constructing error messages. The file consists of a series of text items,
separated by lines consisting of exactly four asterisks. If the file cannot be
opened, default text is used and a message is written to the main and panic
logs. If any text item in the file is empty, default text is used for that
item.
</p>
<p>


Each item of text that is read from the file is expanded, and there are two
expansion variables which can be of use here: $bounce_recipient is set to
the recipient of an error message while it is being created, and
$bounce_return_size_limit contains the value of the <span class="docbook_option">return_size_limit</span>
option, rounded to a whole number.
</p>
<p>
The items must appear in the file in the following order:
</p>
<ul>
<li>
<p>
The first item is included in the headers, and should include at least a
<span class="docbook_emphasis">Subject:</span> header. Exim does not check the syntax of these headers.
</p>
</li>
<li>
<p>
The second item forms the start of the error message. After it, Exim lists the
failing addresses with their error messages.
</p>
</li>
<li>
<p>
The third item is used to introduce any text from pipe transports that is to be
returned to the sender. It is omitted if there is no such text.
</p>
</li>
<li>
<p>
The fourth item is used to introduce the copy of the message that is returned
as part of the error report.
</p>
</li>
<li>
<p>
The fifth item is added after the fourth one if the returned message is
truncated because it is bigger than <span class="docbook_option">return_size_limit</span>.
</p>
</li>
<li>
<p>
The sixth item is added after the copy of the original message.
</p>
</li>
</ul>
<p>
The default state (<span class="docbook_option">bounce_message_file</span> unset) is equivalent to the
following file, in which the sixth item is empty. The <span class="docbook_emphasis">Subject:</span> and some
other lines have been split in order to fit them on the page:
</p>
<div class="docbook_literallayout"><pre>
Subject: Mail delivery failed
  ${if eq{$sender_address}{$bounce_recipient}
  {: returning message to sender}}
****
This message was created automatically by mail delivery software.

A message ${if eq{$sender_address}{$bounce_recipient}
  {that you sent }{sent by

&lt;$sender_address&gt;

}}could not be delivered to all of its recipients.
This is a permanent error. The following address(es) failed:
****
The following text was generated during the delivery attempt(s):
****
------ This is a copy of the message, including all the headers.
  ------
****
------ The body of the message is $message_size characters long;
  only the first
------ $bounce_return_size_limit or so are included here.
****
</pre></div>
</div>
<div class="section">
<h3 id="SECTcustwarn" class="">2. Customizing warning messages</h3>
<p>


The option <span class="docbook_option">warn_message_file</span> can be pointed at a template file for use when
warnings about message delays are created. In this case there are only three
text sections:
</p>
<ul>
<li>
<p>
The first item is included in the headers, and should include at least a
<span class="docbook_emphasis">Subject:</span> header. Exim does not check the syntax of these headers.
</p>
</li>
<li>
<p>
The second item forms the start of the warning message. After it, Exim lists
the delayed addresses.
</p>
</li>
<li>
<p>
The third item then ends the message.
</p>
</li>
</ul>
<p>
The default state is equivalent to the following file, except that some lines
have been split here, in order to fit them on the page:
</p>
<div class="docbook_literallayout"><pre>
Subject: Warning: message $message_exim_id delayed
  $warn_message_delay
****
This message was created automatically by mail delivery software.

A message ${if eq{$sender_address}{$warn_message_recipients}
{that you sent }{sent by

&lt;$sender_address&gt;

}}has not been delivered to all of its recipients after
more than $warn_message_delay on the queue on $primary_hostname.

The message identifier is:     $message_exim_id
The subject of the message is: $h_subject
The date of the message is:    $h_date

The following address(es) have not yet been delivered:
****
No action is required on your part. Delivery attempts will
continue for some time, and this warning may be repeated at
intervals if the message remains undelivered. Eventually the
mail delivery software will give up, and when that happens,
the message will be returned to you.
</pre></div>
<p>


However, in the default state the subject and date lines are omitted if no
appropriate headers exist. During the expansion of this file,
$warn_message_delay is set to the delay time in one of the forms “&lt;<span class="docbook_emphasis">n</span>&gt;
minutes” or “&lt;<span class="docbook_emphasis">n</span>&gt; hours”, and $warn_message_recipients contains a list
of recipients for the warning message. There may be more than one if there are
multiple addresses with different <span class="docbook_option">errors_to</span> settings on the routers that
handled them.
</p>
</div>
</div>
<a class="previous_page" href="ch45.html">&lt;-previous</a><a class="next_page" href="ch47.html">next-&gt;</a>
</div></div>
<iframe id="branding" name="branding" src="../../../../branding/branding.html" height="0" frameborder="no" scrolling="no"></iframe><div id="footer">Website design by <a href="https://secure.grepular.com/">Mike Cardwell</a>, of <a href="http://cardwellit.com/">Cardwell IT Ltd.</a>
</div>
<div class="left_bar"></div>
<div class="right_bar"></div>
<div id="toc">
<ul class="hidden"></ul>
<img src="../../../../doc/contents.png" width="16" height="155">
</div>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script><script type="text/javascript" src="../../../../common.js"></script><script type="text/javascript" src="../../../../doc/chapter.js"></script>
</body>
</html>