addheader.at
5.35 KB
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
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2012, 2014-2017 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
AT_BANNER([addheader])
m4_pushdef([MUT_SIEVE_EXT_NAME],[addheader])
MUT_SIEVE_EXT_TEST([prepend header],[addheader addheader00],
[require "editheader";
addheader "X-Sieve-Filtered" "<kim@job.example.com>";
],
[MUT_MBCOPY($abs_top_srcdir/testsuite/spool/sieve.mbox,mailbox)
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog
sed '/X-IMAPbase:/d;s/ *$//' mailbox
],
[From coyote@desert.example.org Sun May 6 22:16:47 2001
X-Sieve-Filtered: <kim@job.example.com>
From: coyote@desert.example.org
To: roadrunner@acme.example.com
Subject: I have a present for you
X-Caffeine: C8H10N4O2
Status:
X-UID: 1
Look, I'm sorry about the whole anvil thing, and I really
didn't mean to try and drop it on you from the top of the
cliff. I want to try to make it up to you. I've got some
great birdseed over here at my place--top of the line
stuff--and if you come by, I'll have it all wrapped up
for you. I'm really sorry for all the problems I've caused
for you over the years, but I know we can work this out.
--
Wile E. Coyote "Super Genius" coyote@desert.example.org
From b1ff@de.res.example.com Sun May 6 22:17:15 2001
X-Sieve-Filtered: <kim@job.example.com>
From: youcouldberich!@reply-by-postal-mail.invalid
To: rube@landru.example.edu
Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
Date: TBD
X-Number: 0015
Status:
X-UID: 2
YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
$20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
!!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
From bar@dontmailme.org Fri Dec 28 23:28:09 2001
X-Sieve-Filtered: <kim@job.example.com>
Received: (from bar@dontmailme.org)
by dontmailme.org id fERKR9N16790
for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
Date: Fri, 28 Dec 2001 23:28:08 +0200
From: Bar <bar@dontmailme.org>
To: Foo Bar <foobar@nonexistent.net>
Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
Subject: Coffee
Status:
X-UID: 3
How about some coffee?
],
[ADDHEADER on msg uid 1: X-Sieve-Filtered: <kim@job.example.com>
ADDHEADER on msg uid 2: X-Sieve-Filtered: <kim@job.example.com>
ADDHEADER on msg uid 3: X-Sieve-Filtered: <kim@job.example.com>
])
MUT_SIEVE_EXT_TEST([append header],[addheader addheader01],
[require "editheader";
addheader :last "X-Sieve-Filtered" "<kim@job.example.com>";
],
[MUT_MBCOPY($abs_top_srcdir/testsuite/spool/sieve.mbox,mailbox)
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./mailbox prog
sed '/X-IMAPbase:/d;s/ *$//' mailbox
],
[From coyote@desert.example.org Sun May 6 22:16:47 2001
From: coyote@desert.example.org
To: roadrunner@acme.example.com
Subject: I have a present for you
X-Caffeine: C8H10N4O2
X-Sieve-Filtered: <kim@job.example.com>
Status:
X-UID: 1
Look, I'm sorry about the whole anvil thing, and I really
didn't mean to try and drop it on you from the top of the
cliff. I want to try to make it up to you. I've got some
great birdseed over here at my place--top of the line
stuff--and if you come by, I'll have it all wrapped up
for you. I'm really sorry for all the problems I've caused
for you over the years, but I know we can work this out.
--
Wile E. Coyote "Super Genius" coyote@desert.example.org
From b1ff@de.res.example.com Sun May 6 22:17:15 2001
From: youcouldberich!@reply-by-postal-mail.invalid
To: rube@landru.example.edu
Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
Date: TBD
X-Number: 0015
X-Sieve-Filtered: <kim@job.example.com>
Status:
X-UID: 2
YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
IT! SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS! IT WILL
GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
MONEY! MONEY! COLD HARD CASH! YOU WILL RECEIVE OVER
$20,000 IN LESS THAN TWO MONTHS! AND IT'S LEGAL!!!!!!!!!
!!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1 JUST
SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
From bar@dontmailme.org Fri Dec 28 23:28:09 2001
Received: (from bar@dontmailme.org)
by dontmailme.org id fERKR9N16790
for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200
Date: Fri, 28 Dec 2001 23:28:08 +0200
From: Bar <bar@dontmailme.org>
To: Foo Bar <foobar@nonexistent.net>
Message-Id: <200112232808.fERKR9N16790@dontmailme.org>
Subject: Coffee
X-Sieve-Filtered: <kim@job.example.com>
Status:
X-UID: 3
How about some coffee?
],
[ADDHEADER on msg uid 1: X-Sieve-Filtered: <kim@job.example.com>
ADDHEADER on msg uid 2: X-Sieve-Filtered: <kim@job.example.com>
ADDHEADER on msg uid 3: X-Sieve-Filtered: <kim@job.example.com>
])
m4_popdef([MUT_SIEVE_EXT_NAME])