Commit 27aae941 27aae941c77f38392a1b058ce8fb04241c143331 by Sergey Poznyakoff

Fix semantics of mu_header_set_value and creation of multipart/alternative MIME

Until now, mu_header_set_value called with replace=0 prepended the header
to the header list, if a header with such name was already present.  This
has been changed.  Now, if the header with the requested name is already
present, its action is as follows:

  1. If repl is 0, return MU_ERR_EXISTS
  2. Otherwise, replace the header with the new value.

If the header is not present, it is appended to the end of the header
list, instead of putting it at the beginning.

This change is incompatible and breaks the tests, that relied on a particular
field ordering.  These are fixed as well.

The use of mu_header_set_value throughout the sources has been revised to
ensure that single-instance headers are never added twice.

This change also facilitates the second part of this commit, which
fixes creation of the multipart/alternative message by the mail utility.

* libmailutils/mailbox/header.c (mu_header_set_value): Fix semantics.
If the replace parameter is not set and the header field with the
given name already exists, return MU_ERR_EXISTS without changing
anything.  If adding new header, append it to the end of the header
list, instead of pushing it to the top.

* configure.ac: Raise shared library revision number.

* libmu_scm/mu_message.c (mu-message-set-header)
(mu-message-set-header-fields): call mu_header_set_value explicitly if
repl is not set.
* libmu_sieve/extensions/moderator.c: Force replace header mode when
needed.
* libmu_sieve/extensions/vacation.c: Likewise.
* mh/mh_init.c (mh_annotate): Prepend the annotation header.
* mh/mhn.c: Force replace header mode when needed.
* mh/repl.c: Likewise.
* mh/send.c: Likewise.

* libmailutils/tests/modmesg01.at: Change expected header order.
* libmailutils/tests/modmesg03.at: Likewise.
* mh/tests/mhn.at: Likewise.
* mh/tests/send.at: Likewise.
* sieve/tests/moderator.at: Likewise.
* sieve/tests/redirect.at: Likewise.
* sieve/tests/reject.at: Likewise.
* sieve/tests/vacation.at: Likewise.

* examples/mta.c (message_finalize): Append X-Authentication-Warning,
instead of setting it.

Make sure Content-Disposition is not set for parts of a multipart/
alternative MIME message.  Some mail readers (notably, yahoo),
misinterpret it.

* libmailutils/mime/attachment.c (at_hdr): Use mu_header_set_value
to set Content-Type and Content-Disposition.
* libmailutils/mime/mime.c (_mime_set_content_type): If the content
type is set to multipart/alternative, remove the Content-Disposition
headers from the message parts.

* mail/send.c (saveatt): Don't set content-disposition for
multipart/alternative, it is now done by the library.
(add_attachments): Warn about ignored headers.
Append only Received and X-* headers, replace others.
(parse_headers): Append headers.
(compose_header_set): Use mu_header_append if COMPOSE_APPEND is requested.
* mail/util.c (util_header_expand): Use mu_header_append.
1 parent c010cf73
......@@ -32,7 +32,7 @@ AB_INIT
dnl Library versioning
AC_SUBST(VI_CURRENT, 5)
AC_SUBST(VI_REVISION, 2)
AC_SUBST(VI_REVISION, 3)
AC_SUBST(VI_AGE, 0)
dnl Library paths
......
......@@ -406,7 +406,7 @@ message_finalize (mu_message_t msg, int warn)
return 1;
}
sprintf (warn, "%s %s", pwd->pw_name, SENDER_WARNING);
mu_header_set_value (header, "X-Authentication-Warning", warn, 0);
mu_header_append (header, "X-Authentication-Warning", warn);
free (warn);
}
......
......@@ -490,7 +490,6 @@ mu_header_destroy (mu_header_t *ph)
*ph = NULL;
}
}
int
mu_header_set_value (mu_header_t header, const char *fn, const char *fv,
......@@ -511,9 +510,10 @@ mu_header_set_value (mu_header_t header, const char *fn, const char *fv,
if (fv == NULL && !replace)
return EINVAL;
ent = mu_hdrent_find (header, fn, 1);
if (replace)
{
ent = mu_hdrent_find (header, fn, 1);
if (ent)
{
if (fv == NULL)
......@@ -530,12 +530,16 @@ mu_header_set_value (mu_header_t header, const char *fn, const char *fv,
else if (fv == NULL)
return 0;
}
else if (ent)
{
return MU_ERR_EXISTS;
}
ent = mu_hdrent_create (header, NULL,
fn, strlen (fn), fv, strlen (fv));
if (!ent)
return ENOMEM;
mu_hdrent_prepend (header, ent);
mu_hdrent_append (header, ent);
HEADER_SET_MODIFIED (header);
return 0;
}
......
......@@ -83,11 +83,11 @@ at_hdr (mu_header_t hdr, const char *content_type, const char *encoding,
free (str);
if (rc)
return rc;
rc = mu_header_append (hdr, MU_HEADER_CONTENT_TYPE, val);
rc = mu_header_set_value (hdr, MU_HEADER_CONTENT_TYPE, val, 1);
free (val);
}
else
rc = mu_header_append (hdr, MU_HEADER_CONTENT_TYPE, content_type);
rc = mu_header_set_value (hdr, MU_HEADER_CONTENT_TYPE, content_type, 1);
if (rc)
return rc;
......@@ -101,15 +101,16 @@ at_hdr (mu_header_t hdr, const char *content_type, const char *encoding,
free (str);
if (rc)
return rc;
rc = mu_header_append (hdr, MU_HEADER_CONTENT_DISPOSITION, val);
rc = mu_header_set_value (hdr, MU_HEADER_CONTENT_DISPOSITION, val, 1);
free (val);
}
else
rc = mu_header_append (hdr, MU_HEADER_CONTENT_DISPOSITION, "attachment");
rc = mu_header_set_value (hdr, MU_HEADER_CONTENT_DISPOSITION, "attachment",
1);
if (rc)
return rc;
return mu_header_append (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING,
encoding ? encoding : "8bit");
return mu_header_set_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING,
encoding ? encoding : "8bit", 1);
}
/* Create in *NEWMSG an empty attachment of given CONTENT_TYPE and ENCODING.
......
......@@ -465,7 +465,21 @@ _mime_set_content_type (mu_mime_t mime)
if (mime->flags & MU_MIME_MULTIPART_MIXED)
content_type = "multipart/mixed; boundary=";
else
content_type = "multipart/alternative; boundary=";
{
size_t i;
/* Make sure content disposition is not set for alternative
parts */
for (i = 0; i < mime->nmtp_parts; i++)
{
mu_header_t hdr;
mu_message_get_header (mime->mtp_parts[i]->msg, &hdr);
mu_header_remove (hdr, MU_HEADER_CONTENT_DISPOSITION, 1);
}
content_type = "multipart/alternative; boundary=";
}
if (mime->boundary == NULL)
{
char boundary[128];
......@@ -1118,7 +1132,7 @@ mu_mime_get_message (mu_mime_t mime, mu_message_t *msg)
{
mu_message_set_header (mime->msg, mime->hdrs, mime);
mu_header_set_value (mime->hdrs, MU_HEADER_MIME_VERSION, "1.0",
0);
1);
if ((ret = _mime_set_content_type (mime)) == 0)
{
if ((ret = mu_body_create (&body, mime->msg)) == 0)
......
......@@ -19,9 +19,9 @@ AT_KEYWORDS([modmesg01])
AT_CHECK([modmesg -a To:gray@localhost -a Subject:test],
[0],
[Subject: test
[From: root
To: gray@localhost
From: root
Subject: test
This is a test message.
oo
......
......@@ -19,9 +19,9 @@ AT_KEYWORDS([modmesg02])
AT_CHECK([modmesg -a To:gray@localhost -a Subject:test -l 0 -t "That"],
[0],
[Subject: test
[From: root
To: gray@localhost
From: root
Subject: test
That is a test message.
oo
......
......@@ -289,10 +289,13 @@ SCM_DEFINE_PUBLIC (scm_mu_message_set_header, "mu-message-set-header", 3, 1, 0,
hdr_c = scm_to_locale_string (header);
val_c = scm_to_locale_string (value);
status = mu_header_set_value (hdr, hdr_c, val_c, repl);
if (repl)
status = mu_header_set_value (hdr, hdr_c, val_c, repl);
else
status = mu_header_append (hdr, hdr_c, val_c);
free (hdr_c);
free (val_c);
if (status)
mu_scm_error (FUNC_NAME, status,
"Cannot set header \"~A: ~A\" in message ~A",
......@@ -602,7 +605,10 @@ SCM_DEFINE_PUBLIC (scm_mu_message_set_header_fields, "mu-message-set-header-fiel
SCM_ASSERT (scm_is_string (cdr), cdr, SCM_ARGn, FUNC_NAME);
hdr_c = scm_to_locale_string (car);
val_c = scm_to_locale_string (cdr);
status = mu_header_set_value (hdr, hdr_c, val_c, repl);
if (repl)
status = mu_header_set_value (hdr, hdr_c, val_c, repl);
else
status = mu_header_append (hdr, hdr_c, val_c);
free (hdr_c);
free (val_c);
if (status)
......
......@@ -140,6 +140,9 @@ moderator_filter_message (mu_sieve_machine_t mach,
return rc;
}
/* Copy the value of the header field FROM from the email header FROM_HDR to
the header field TO in the header TO_HDR, replacing the field, if it
exists. */
static int
copy_header (mu_sieve_machine_t mach,
mu_header_t to_hdr, char *to, mu_header_t from_hdr, char *from)
......@@ -153,7 +156,7 @@ copy_header (mu_sieve_machine_t mach,
from, mu_strerror (rc));
return rc;
}
rc = mu_header_set_value (to_hdr, to, value, 0);
rc = mu_header_set_value (to_hdr, to, value, 1);
return rc;
}
......@@ -193,7 +196,7 @@ moderator_discard_message (mu_sieve_machine_t mach, mu_message_t request,
}
if (from)
mu_header_set_value (repl_hdr, MU_HEADER_FROM, from, 0);
mu_header_set_value (repl_hdr, MU_HEADER_FROM, from, 1);
mailer = mu_sieve_get_mailer (mach);
rc = mu_mailer_open (mailer, 0);
......
......@@ -513,10 +513,10 @@ vacation_subject (mu_sieve_machine_t mach,
if (mu_rfc2047_encode (MU_SIEVE_CHARSET, "quoted-printable",
subject, &value))
mu_header_set_value (newhdr, MU_HEADER_SUBJECT, subject, 0);
mu_header_set_value (newhdr, MU_HEADER_SUBJECT, subject, 1);
else
{
mu_header_set_value (newhdr, MU_HEADER_SUBJECT, value, 0);
mu_header_set_value (newhdr, MU_HEADER_SUBJECT, value, 1);
free (value);
}
......@@ -714,7 +714,7 @@ vacation_reply (mu_sieve_machine_t mach, mu_message_t msg,
}
else
{
mu_header_set_value (newhdr, MU_HEADER_TO, to, 0);
mu_header_set_value (newhdr, MU_HEADER_TO, to, 1);
val = mu_sieve_get_tag_untyped (mach, "header");
if (val)
......
......@@ -444,7 +444,8 @@ saveatt (void *item, void *data)
char *p;
rc = mu_attachment_create (&part, aptr->content_type, aptr->encoding,
aptr->name, aptr->filename);
env->alt ? NULL : aptr->name,
env->alt ? NULL : aptr->filename);
if (rc)
{
mu_error (_("can't create attachment %s: %s"),
......@@ -482,8 +483,6 @@ saveatt (void *item, void *data)
mu_mime_get_num_parts (env->mime, &nparts);
mu_message_get_header (part, &hdr);
if (env->alt)
mu_header_set_value (hdr, MU_HEADER_CONTENT_DISPOSITION, "inline", 1);
mu_rfc2822_msg_id (nparts, &p);
mu_header_set_value (hdr, MU_HEADER_CONTENT_ID, p, 1);
free (p);
......@@ -640,10 +639,17 @@ add_attachments (compose_env_t *env, mu_message_t *pmsg)
if (mu_iterator_current_kv (itr, (const void **)&name,
(void**)&value) == 0)
{
if (mu_c_strcasecmp (name, MU_HEADER_MIME_VERSION) == 0 ||
mu_c_strncasecmp (name, "Content-", 8) == 0)
continue;
mu_header_append (outhdr, name, value);
if (mu_c_strcasecmp (name, MU_HEADER_RECEIVED) == 0
|| mu_c_strncasecmp (name, "X-", 2) == 0)
mu_header_append (outhdr, name, value);
else if (mu_c_strcasecmp (name, MU_HEADER_MIME_VERSION) == 0 ||
mu_c_strncasecmp (name, "Content-", 8) == 0)
{
mu_error (_("%s: not setting header"), name);
continue;
}
else
mu_header_set_value (outhdr, name, value, 1);
}
}
mu_iterator_destroy (&itr);
......@@ -826,7 +832,7 @@ parse_headers (mu_stream_t input, compose_env_t *env)
if (name)
{
mu_header_set_value (header, name, value[0] ? value : NULL, 0);
mu_header_append (header, name, value[0] ? value : NULL);
free (name);
free (value);
name = value = NULL;
......@@ -856,7 +862,7 @@ parse_headers (mu_stream_t input, compose_env_t *env)
free (buf);
if (name)
{
mu_header_set_value (header, name, value, 0);
mu_header_append (header, name, value);
free (name);
free (value);
}
......@@ -902,19 +908,29 @@ compose_header_set (compose_env_t *env, const char *name,
switch (mode)
{
case COMPOSE_REPLACE:
case COMPOSE_APPEND:
if (is_address_field (name)
&& mailvar_get (NULL, "inplacealiases", mailvar_type_boolean, 0) == 0)
{
char *exp = alias_expand (value);
status = mu_header_set_value (env->header, name, exp ? exp : value,
mode);
status = mu_header_set_value (env->header, name, exp ? exp : value, 1);
free (exp);
}
else
status = mu_header_set_value (env->header, name, value, mode);
status = mu_header_set_value (env->header, name, value, 1);
break;
case COMPOSE_APPEND:
if (is_address_field (name)
&& mailvar_get (NULL, "inplacealiases", mailvar_type_boolean, 0) == 0)
{
char *exp = alias_expand (value);
status = mu_header_append (env->header, name, exp ? exp : value);
free (exp);
}
else
status = mu_header_append (env->header, name, value);
break;
case COMPOSE_SINGLE_LINE:
if (mu_header_aget_value (env->header, name, &old_value) == 0
&& old_value[0])
......
......@@ -964,7 +964,7 @@ util_header_expand (mu_header_t *phdr)
}
}
else
mu_header_set_value (hdr, name, value, 0);
mu_header_append (hdr, name, value);
}
if (errcnt == 0)
......
......@@ -856,11 +856,11 @@ mh_annotate (mu_message_t msg, const char *field, const char *text, int date)
tm = localtime (&t);
mu_strftime (datebuf, sizeof datebuf, "%a, %d %b %Y %H:%M:%S %Z", tm);
mu_header_set_value (hdr, field, datebuf, 0);
mu_header_prepend (hdr, field, datebuf);
}
if (text)
mu_header_set_value (hdr, field, text, 0);
mu_header_prepend (hdr, field, text);
mu_message_get_attribute (msg, &attr);
mu_attribute_set_modified (attr);
}
......
......@@ -1944,7 +1944,7 @@ copy_header (mu_message_t msg, mu_header_t out)
mu_header_sget_field_value (hdr, i, &value))
continue;
mu_header_set_value (out, name, value, 0);
mu_header_append (out, name, value);
}
}
......@@ -2009,7 +2009,7 @@ finish_text_msg (struct compose_env *env, mu_message_t *msg, int ascii)
mu_message_get_header (newmsg, &hdr);
copy_header (*msg, hdr);
mu_header_set_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING,
"quoted-printable", 0);
"quoted-printable", 1);
mu_message_get_body (newmsg, &body);
mu_body_get_streamref (body, &output);
......
......@@ -247,7 +247,7 @@ make_draft (mu_mailbox_t mbox, int disp, struct mh_whatnow_env *wh)
mu_message_create_copy (&tmp_msg, msg);
mu_message_get_header (tmp_msg, &hdr);
text = mu_opool_finish (fcc_pool, NULL);
mu_header_set_value (hdr, MU_HEADER_FCC, text, 0);
mu_header_set_value (hdr, MU_HEADER_FCC, text, 1);
mh_format (&format, tmp_msg, msgno, width, &buf);
mu_message_destroy (&tmp_msg, NULL);
}
......
......@@ -623,7 +623,7 @@ _action_send (void *item, void *data)
mu_header_set_value (hdr, MU_HEADER_X_MAILER,
DEFAULT_X_MAILER, 0);
else if (strcmp (p, "no"))
mu_header_set_value (hdr, MU_HEADER_X_MAILER, p, 0);
mu_header_remove (hdr, MU_HEADER_X_MAILER, 1);
}
}
......
......@@ -461,18 +461,18 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Adjacent plain text contexts
Content-Type: multipart/mixed; boundary="BOUNDARY-1"
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY-1"
--BOUNDARY-1
Content-ID: 1
Content-Type: text/plain
Content-ID: 1
this is the first content
--BOUNDARY-1
Content-ID: 2
Content-Type: text/plain
Content-ID: 2
and this is the second
......@@ -499,26 +499,26 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Plaintext content types
Content-Type: multipart/mixed; boundary="BOUNDARY-1"
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY-1"
--BOUNDARY-1
Content-Description: First part
Content-ID: 1
Content-Type: text/enriched
Content-ID: 1
Content-Description: First part
this content will be tagged as text/enriched
--BOUNDARY-1
Content-ID: 2
Content-Type: text/plain
Content-ID: 2
and this content will be tagged as text/plain
--BOUNDARY-1
Content-Description: this is a patch
Content-ID: 3
Content-Type: application/x-patch
Content-ID: 3
Content-Description: this is a patch
and this content will be tagged as application/x-patch
......@@ -540,8 +540,8 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Sharp at the beginning of a line
Content-Type: text/plain
MIME-Version: 1.0
Content-Type: text/plain
#when sent, this line will start with only one #
......@@ -562,9 +562,9 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Charset
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cze=C5=9B=C4=87
......@@ -586,9 +586,9 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Forwards
Content-Description: forwarded messages
Content-Type: multipart/digest; boundary="BOUNDARY-1"
MIME-Version: 1.0
Content-Type: multipart/digest; boundary="BOUNDARY-1"
Content-Description: forwarded messages
--BOUNDARY-1
Content-Type: message/rfc822
......@@ -713,9 +713,9 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Forwards
Content-Description: forwarded messages
Content-Type: multipart/digest; boundary="BOUNDARY-1"
MIME-Version: 1.0
Content-Type: multipart/digest; boundary="BOUNDARY-1"
Content-Description: forwarded messages
--BOUNDARY-1
Content-Type: message/rfc822
......@@ -839,9 +839,9 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Forwards
Content-Description: forwarded messages
Content-Type: message/rfc822
MIME-Version: 1.0
Content-Type: message/rfc822
Content-Description: forwarded messages
Received: (from foobar@nonexistent.net)
by nonexistent.net id fBSKI8N04906
......@@ -915,12 +915,12 @@ mimeflt input
[0],
[From: gray@example.net
Subject: External data
Content-Type: message/external-body; name="mailutils-3.0.tar.gz"; directory="/gnu/mailutils"; site="ftp.gnu.org"; access-type=anon-ftp; mode="image"
MIME-Version: 1.0
Content-Type: message/external-body; name="mailutils-3.0.tar.gz"; directory="/gnu/mailutils"; site="ftp.gnu.org"; access-type=anon-ftp; mode="image"
Content-Description: GNU Mailutils distribution
Content-ID: 1
Content-Type: application/octet-stream; type=tar; conversions=compress
Content-ID: 1
Content-Description: GNU Mailutils distribution
])
......@@ -956,25 +956,25 @@ mimeflt input
[0],
[From: gray@example.net
Subject: Multipart
Content-Type: multipart/mixed; boundary="BOUNDARY-1"
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY-1"
--BOUNDARY-1
Content-ID: 1
Content-Type: text/plain
Content-ID: 1
Initial text part.
--BOUNDARY-1
Content-Type: multipart/mixed; boundary="BOUNDARY-2"
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY-2"
--BOUNDARY-2
Content-Description: forwarded message
Content-ID: 2
Content-Type: message/rfc822
MIME-Version: 1.0
Content-Type: message/rfc822
Content-ID: 2
Content-Description: forwarded message
Received: (from foobar@nonexistent.net)
by nonexistent.net id fBSKI8N04906
......@@ -1025,22 +1025,22 @@ And the mome raths outgrabe.
--BOUNDARY-2
Content-ID: 3
Content-Type: text/plain
Content-ID: 3
Plain text 1
--BOUNDARY-2
Content-ID: 4
Content-Type: text/x-special
Content-ID: 4
Plain text 2
--BOUNDARY-2
Content-Transfer-Encoding: base64
Content-Description: Tar archive
Content-ID: 5
Content-Type: application/octet-stream; type=tar
Content-ID: 5
Content-Description: Tar archive
Content-Transfer-Encoding: base64
Tm90IGEgdGFyYmFsbCwgcmVhbGx5Cg==
--BOUNDARY-2--
......
......@@ -34,11 +34,11 @@ find . -name ,input
[0],
[ENVELOPE FROM: mhtester@example.net
ENVELOPE TO: <gray@example.net>
0: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
1: Date: now
2: From: mhtester@example.net
3: To: <gray@example.net>
4: Subject: Send file test
0: From: mhtester@example.net
1: To: <gray@example.net>
2: Subject: Send file test
3: Date: now
4: X-Mailer: MH (GNU Mailutils 3.2.91)
5:
6: Message body
END OF MESSAGE
......@@ -73,21 +73,21 @@ find . -name ',input.[[12]]' | sort
[0],
[ENVELOPE FROM: mhtester@example.net
ENVELOPE TO: <gray@example.net>
0: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
1: Date: now
2: From: mhtester@example.net
3: To: <gray@example.net>
4: Subject: Send file test 1
0: From: mhtester@example.net
1: To: <gray@example.net>
2: Subject: Send file test 1
3: Date: now
4: X-Mailer: MH (GNU Mailutils 3.2.91)
5:
6: Message body 1
END OF MESSAGE
ENVELOPE FROM: mhtester@example.net
ENVELOPE TO: <gray@example.org>
0: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
1: Date: now
2: From: mhtester@example.net
3: To: <gray@example.org>
4: Subject: Send file test 2
0: From: mhtester@example.net
1: To: <gray@example.org>
2: Subject: Send file test 2
3: Date: now
4: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
5:
6: Message body 2
END OF MESSAGE
......@@ -112,11 +112,11 @@ cat Mail/,draft
[0],
[ENVELOPE FROM: mhtester@example.net
ENVELOPE TO: <gray@example.net>
0: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
1: Date: now
2: From: mhtester@example.net
3: To: <gray@example.net>
4: Subject: Send file test
0: From: mhtester@example.net
1: To: <gray@example.net>
2: Subject: Send file test
3: Date: now
4: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
5:
6: Message body
END OF MESSAGE
......@@ -147,11 +147,11 @@ sed 's/: Date: .*/: Date: now/' $MTA_DIAG
[0],
[ENVELOPE FROM: mhtester@example.net
ENVELOPE TO: <gray@example.net>
0: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
1: Date: now
2: From: mhtester@example.net
3: To: <gray@example.net>
4: Subject: Draftfolder test
0: From: mhtester@example.net
1: To: <gray@example.net>
2: Subject: Draftfolder test
3: Date: now
4: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
5:
6: Message body
END OF MESSAGE
......@@ -184,11 +184,11 @@ sed 's/: Date: .*/: Date: now/' $MTA_DIAG
[0],
[ENVELOPE FROM: mhtester@example.net
ENVELOPE TO: <gray@example.org>
0: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
1: Date: now
2: From: mhtester@example.net
3: To: <gray@example.org>
4: Subject: Draftmessage test
0: From: mhtester@example.net
1: To: <gray@example.org>
2: Subject: Draftmessage test
3: Date: now
4: X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
5:
6: Message body
END OF MESSAGE
......
......@@ -31,8 +31,8 @@ sed 's/ENVELOPE FROM:.*/ENVELOPE FROM/' ./mta.diag
],
[ENVELOPE FROM
ENVELOPE TO: <bug-foobar-request@example.org>
0: Subject: confirm 7e02c99a82a21a2349291a4f142ee2347bb5fd0b
1: To: bug-foobar-request@example.org
0: To: bug-foobar-request@example.org
1: Subject: confirm 7e02c99a82a21a2349291a4f142ee2347bb5fd0b
2:
END OF MESSAGE
],
......@@ -55,9 +55,9 @@ cat ./mta.diag
],
[ENVELOPE FROM: sergiusz@example.org
ENVELOPE TO: <bug-foobar-request@example.org>
0: From: <sergiusz@example.org>
0: To: bug-foobar-request@example.org
1: Subject: confirm 7e02c99a82a21a2349291a4f142ee2347bb5fd0b
2: To: bug-foobar-request@example.org
2: From: <sergiusz@example.org>
3:
END OF MESSAGE
],
......
......@@ -36,11 +36,11 @@ sed 's/ $//' ./mta.diag
[0],
[ENVELOPE FROM: coyote@desert.example.org
ENVELOPE TO: <gray@gnu.org>
0: X-Loop-Prevention: foobar@nonexistent.net
1: From: coyote@desert.example.org
2: To: roadrunner@acme.example.com
3: Subject: I have a present for you
4: X-Caffeine: C8H10N4O2
0: From: coyote@desert.example.org
1: To: roadrunner@acme.example.com
2: Subject: I have a present for you
3: X-Caffeine: C8H10N4O2
4: X-Loop-Prevention: foobar@nonexistent.net
5:
6: Look, I'm sorry about the whole anvil thing, and I really
7: didn't mean to try and drop it on you from the top of the
......@@ -55,12 +55,12 @@ ENVELOPE TO: <gray@gnu.org>
END OF MESSAGE
ENVELOPE FROM: b1ff@de.res.example.com
ENVELOPE TO: <gray@gnu.org>
0: X-Loop-Prevention: foobar@nonexistent.net
1: From: youcouldberich!@reply-by-postal-mail.invalid
2: To: rube@landru.example.edu
3: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
4: Date: TBD
5: X-Number: 0015
0: From: youcouldberich!@reply-by-postal-mail.invalid
1: To: rube@landru.example.edu
2: Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
3: Date: TBD
4: X-Number: 0015
5: X-Loop-Prevention: foobar@nonexistent.net
6:
7: YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
8: IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
......@@ -72,15 +72,15 @@ ENVELOPE TO: <gray@gnu.org>
END OF MESSAGE
ENVELOPE FROM: bar@dontmailme.org
ENVELOPE TO: <gray@gnu.org>
0: X-Loop-Prevention: foobar@nonexistent.net
1: Received: (from bar@dontmailme.org)
2: by dontmailme.org id fERKR9N16790
3: for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
4: Date: Fri, 28 Dec 2001 23:28:08 +0200
5: From: Bar <bar@dontmailme.org>
6: To: Foo Bar <foobar@nonexistent.net>
7: Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
8: Subject: Coffee
0: Received: (from bar@dontmailme.org)
1: by dontmailme.org id fERKR9N16790
2: for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
3: Date: Fri, 28 Dec 2001 23:28:08 +0200
4: From: Bar <bar@dontmailme.org>
5: To: Foo Bar <foobar@nonexistent.net>
6: Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
7: Subject: Coffee
8: X-Loop-Prevention: foobar@nonexistent.net
9:
10: How about some coffee?
END OF MESSAGE
......
......@@ -55,8 +55,8 @@ sed -f filter.sed ./mta.diag
[ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
ENVELOPE TO: <coyote@desert.example.org>
0: To: coyote@desert.example.org
1: Content-Type: multipart/mixed; boundary=(boundary)
2: MIME-Version: 1.0
1: MIME-Version: 1.0
2: Content-Type: multipart/mixed; boundary=(boundary)
3:
4: --(boundary)
5: Content-Type: text/plain;charset=UTF-8
......@@ -104,8 +104,8 @@ END OF MESSAGE
ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
ENVELOPE TO: <b1ff@de.res.example.com>
0: To: b1ff@de.res.example.com
1: Content-Type: multipart/mixed; boundary=(boundary)
2: MIME-Version: 1.0
1: MIME-Version: 1.0
2: Content-Type: multipart/mixed; boundary=(boundary)
3:
4: --(boundary)
5: Content-Type: text/plain;charset=UTF-8
......@@ -151,8 +151,8 @@ END OF MESSAGE
ENVELOPE FROM: MAILER-DAEMON@nonexistent.net
ENVELOPE TO: <bar@dontmailme.org>
0: To: bar@dontmailme.org
1: Content-Type: multipart/mixed; boundary=(boundary)
2: MIME-Version: 1.0
1: MIME-Version: 1.0
2: Content-Type: multipart/mixed; boundary=(boundary)
3:
4: --(boundary)
5: Content-Type: text/plain;charset=UTF-8
......