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) ...@@ -236,13 +236,15 @@ _message_open (mu_stream_t stream)
236 mu_address_t addr; 236 mu_address_t addr;
237 237
238 mu_address_create (&addr, from); 238 mu_address_create (&addr, from);
239 if (!addr 239 if (addr)
240 || mu_address_aget_email (addr, 1, &env_from)) 240 {
241 env_from = mu_strdup ("GNU-Mailutils"); 241 mu_address_aget_email (addr, 1, &env_from);
242 mu_address_destroy (&addr); 242 mu_address_destroy (&addr);
243 } 243 }
244 else 244 }
245 env_from = mu_strdup ("GNU-MH"); 245
246 if (!env_from)
247 env_from = mu_get_user_email (NULL);
246 } 248 }
247 free (from); 249 free (from);
248 250
......
...@@ -40,16 +40,15 @@ Sergey ...@@ -40,16 +40,15 @@ Sergey
40 ]) 40 ])
41 41
42 burst +inbox 1 || exit $? 42 burst +inbox 1 || exit $?
43 grep -v ^X-Envelope-Date Mail/inbox/2 43 grep -v ^X-Envelope- Mail/inbox/2
44 grep -v ^X-Envelope-Date Mail/inbox/3 44 grep -v ^X-Envelope- Mail/inbox/3
45 grep -v ^X-Envelope-Date Mail/inbox/4 45 grep -v ^X-Envelope- Mail/inbox/4
46 ], 46 ],
47 [0], 47 [0],
48 [X-Burst-Part: 1 1 01 48 [X-Burst-Part: 1 1 01
49 From: Sergey Poznyakoff <gray@example.net> 49 From: Sergey Poznyakoff <gray@example.net>
50 To: root@example.com 50 To: root@example.com
51 Subject: digest 51 Subject: digest
52 X-Envelope-Sender: gray@example.net
53 52
54 Initial text. 53 Initial text.
55 54
...@@ -57,13 +56,11 @@ X-Burst-Part: 1 2 02 ...@@ -57,13 +56,11 @@ X-Burst-Part: 1 2 02
57 From: Puszcza hackers 56 From: Puszcza hackers
58 To: Sergey Poznyakoff <gray@gnu.org> 57 To: Sergey Poznyakoff <gray@gnu.org>
59 Subject: Hello 58 Subject: Hello
60 X-Envelope-Sender: GNU-Mailutils
61 59
62 Greetings 60 Greetings
63 --------- 61 ---------
64 How are you? 62 How are you?
65 X-Burst-Part: 1 3 00 63 X-Burst-Part: 1 3 00
66 X-Envelope-Sender: GNU-MH
67 64
68 Regards, 65 Regards,
69 Sergey 66 Sergey
...@@ -93,16 +90,15 @@ Sergey ...@@ -93,16 +90,15 @@ Sergey
93 ]) 90 ])
94 91
95 burst +inbox --length=7 1 || exit $? 92 burst +inbox --length=7 1 || exit $?
96 grep -v ^X-Envelope-Date Mail/inbox/2 93 grep -v ^X-Envelope- Mail/inbox/2
97 grep -v ^X-Envelope-Date Mail/inbox/3 94 grep -v ^X-Envelope- Mail/inbox/3
98 grep -v ^X-Envelope-Date Mail/inbox/4 95 grep -v ^X-Envelope- Mail/inbox/4
99 ], 96 ],
100 [0], 97 [0],
101 [X-Burst-Part: 1 1 01 98 [X-Burst-Part: 1 1 01
102 From: Sergey Poznyakoff <gray@example.net> 99 From: Sergey Poznyakoff <gray@example.net>
103 To: root@example.com 100 To: root@example.com
104 Subject: digest 101 Subject: digest
105 X-Envelope-Sender: gray@example.net
106 102
107 Initial text. 103 Initial text.
108 104
...@@ -110,13 +106,11 @@ X-Burst-Part: 1 2 02 ...@@ -110,13 +106,11 @@ X-Burst-Part: 1 2 02
110 From: Puszcza hackers 106 From: Puszcza hackers
111 To: Sergey Poznyakoff <gray@gnu.org> 107 To: Sergey Poznyakoff <gray@gnu.org>
112 Subject: Hello 108 Subject: Hello
113 X-Envelope-Sender: GNU-Mailutils
114 109
115 Greetings 110 Greetings
116 ----- 111 -----
117 How are you? 112 How are you?
118 X-Burst-Part: 1 3 00 113 X-Burst-Part: 1 3 00
119 X-Envelope-Sender: GNU-MH
120 114
121 Regards, 115 Regards,
122 Sergey 116 Sergey
......