1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
|
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from spec on 25 November 2000 -->
<TITLE>Exim Specification - 39. Customizing error and warning messages</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
Go to the <A HREF="spec_1.html">first</A>, <A HREF="spec_38.html">previous</A>, <A HREF="spec_40.html">next</A>, <A HREF="spec_59.html">last</A> section, <A HREF="spec_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC777" HREF="spec_toc.html#TOC777">39. Customizing error and warning messages</A></H1>
<P>
<A NAME="IDX1713"></A>
When a message fails to get 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>
<H2><A NAME="SEC778" HREF="spec_toc.html#TOC778">39.1 Customizing error messages</A></H2>
<P>
If <EM>errmsg_text</EM> 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 <EM>errmsg_file</EM> is set.
</P>
<P>
When <EM>errmsg_file</EM> 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: $<EM>errmsg_recipient</EM> is set to
the recipient of an error message while it is being created, and
$<EM>return_size_limit</EM> contains the value of the <EM>return_size_limit</EM> option,
rounded to a whole number.
</P>
<P>
The items must appear in the file in the following order:
</P>
<UL>
<LI>
The first item is included in the headers, and should include at least a
<EM>Subject:</EM> header. Exim does not check the syntax of these headers.
<LI>
The second item forms the start of the error message. After it, Exim
lists the failing addresses with their error messages.
<LI>
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.
<LI>
The fourth item is used to introduce the copy of the message that is
returned as part of the error report.
<LI>
The fifth item is added after the fourth one if the returned message is
truncated because it is bigger than <EM>return_size_limit</EM>.
<LI>
The sixth item is added after the copy of the original message.
</UL>
<P>
The default state (<EM>errmsg_file</EM> unset) is equivalent to the following file,
in which the sixth item is empty. The <EM>Subject:</EM> line has been split into two
here in order to fit it on the page.
-------------------------------------------------------------------------<BR>
<PRE>
>>>>>>> .linelength 80em
Subject: Mail delivery failed
${if eq{$sender_address}{$errmsg_recipient}{: returning message to sender}}
****
This message was created automatically by mail delivery software.
A message ${if eq{$sender_address}{$errmsg_recipient}{that you sent }{sent by
<$sender_address>
}}could not be delivered to all of its recipients.
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
------ $return_size_limit or so are included here.
****
</PRE>
<P>
-------------------------------------------------------------------------<BR>
</P>
<H2><A NAME="SEC779" HREF="spec_toc.html#TOC779">39.2 Customizing warning messages</A></H2>
<P>
<A NAME="IDX1714"></A>
The option <EM>warnmsg_file</EM> 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>
The first item is included in the headers, and should include at least a
<EM>Subject:</EM> header. Exim does not check the syntax of these headers.
<LI>
The second item forms the start of the warning message. After it, Exim
lists the delayed addresses.
<LI>
The third item then ends the message.
</UL>
<P>
The default state is equivalent to the file
-------------------------------------------------------------------------<BR>
<PRE>
>>>>>>> .linelength 80em
Subject: Warning: message $message_id delayed $warnmsg_delay
****
This message was created automatically by mail delivery software.
A message ${if eq{$sender_address}{$warnmsg_recipients}{that you sent }{sent by
<$sender_address>
}}has not been delivered to all of its recipients after
more than $warnmsg_delay on the queue on $primary_hostname.
The message identifier is: $message_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>
<P>
-------------------------------------------------------------------------<BR>
except that in the default state the subject and date lines are omitted if no
appropriate headers exist. During the expansion of this file,
$<EM>warnmsg_delay</EM> is set to the delay time in one of the forms `<<EM>n</EM>> minutes'
or `<<EM>n</EM>> hours', and $<EM>warnmsg_recipients</EM> contains a list of recipients for
the warning message. There may be more than one if there are multiple addresses
with different <EM>errors_to</EM> settings on the routers/directors that handled
them.
</P>
<P><HR><P>
Go to the <A HREF="spec_1.html">first</A>, <A HREF="spec_38.html">previous</A>, <A HREF="spec_40.html">next</A>, <A HREF="spec_59.html">last</A> section, <A HREF="spec_toc.html">table of contents</A>.
</BODY>
</HTML>
|