Commit 0ac52e06 0ac52e06cb1cb91602ee4dc4de32f66423e96b32 by Sergey Poznyakoff

message_stream: deduce default envelope address from the current user email

* libmailutils/stream/message_stream.c: Unless specified otherwise,
set envelope address based on the current user email.
* mh/tests/burst.at: Remove all X-Envelope headers before comparison.
1 parent ac1262fb
......@@ -236,13 +236,15 @@ _message_open (mu_stream_t stream)
mu_address_t addr;
mu_address_create (&addr, from);
if (!addr
|| mu_address_aget_email (addr, 1, &env_from))
env_from = mu_strdup ("GNU-Mailutils");
if (addr)
{
mu_address_aget_email (addr, 1, &env_from);
mu_address_destroy (&addr);
}
else
env_from = mu_strdup ("GNU-MH");
}
if (!env_from)
env_from = mu_get_user_email (NULL);
}
free (from);
......
......@@ -40,16 +40,15 @@ Sergey
])
burst +inbox 1 || exit $?
grep -v ^X-Envelope-Date Mail/inbox/2
grep -v ^X-Envelope-Date Mail/inbox/3
grep -v ^X-Envelope-Date Mail/inbox/4
grep -v ^X-Envelope- Mail/inbox/2
grep -v ^X-Envelope- Mail/inbox/3
grep -v ^X-Envelope- Mail/inbox/4
],
[0],
[X-Burst-Part: 1 1 01
From: Sergey Poznyakoff <gray@example.net>
To: root@example.com
Subject: digest
X-Envelope-Sender: gray@example.net
Initial text.
......@@ -57,13 +56,11 @@ X-Burst-Part: 1 2 02
From: Puszcza hackers
To: Sergey Poznyakoff <gray@gnu.org>
Subject: Hello
X-Envelope-Sender: GNU-Mailutils
Greetings
---------
How are you?
X-Burst-Part: 1 3 00
X-Envelope-Sender: GNU-MH
Regards,
Sergey
......@@ -93,16 +90,15 @@ Sergey
])
burst +inbox --length=7 1 || exit $?
grep -v ^X-Envelope-Date Mail/inbox/2
grep -v ^X-Envelope-Date Mail/inbox/3
grep -v ^X-Envelope-Date Mail/inbox/4
grep -v ^X-Envelope- Mail/inbox/2
grep -v ^X-Envelope- Mail/inbox/3
grep -v ^X-Envelope- Mail/inbox/4
],
[0],
[X-Burst-Part: 1 1 01
From: Sergey Poznyakoff <gray@example.net>
To: root@example.com
Subject: digest
X-Envelope-Sender: gray@example.net
Initial text.
......@@ -110,13 +106,11 @@ X-Burst-Part: 1 2 02
From: Puszcza hackers
To: Sergey Poznyakoff <gray@gnu.org>
Subject: Hello
X-Envelope-Sender: GNU-Mailutils
Greetings
-----
How are you?
X-Burst-Part: 1 3 00
X-Envelope-Sender: GNU-MH
Regards,
Sergey
......