summaryrefslogtreecommitdiff
path: root/extra/beagle/beagle-0.3.9-gmime24.patch
blob: 7d943dabf424630cd674a56611f6e8357a0eca6b (plain)
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
diff -upNr beagle-0.3.9.orign/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs beagle-0.3.9/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs
--- beagle-0.3.9.orign/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs	2008-04-25 20:17:04.000000000 +0200
+++ beagle-0.3.9/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs	2009-01-28 12:33:17.000000000 +0100
@@ -333,28 +333,46 @@ namespace Beagle.Daemon.EvolutionMailQue
                         indexable.AddProperty (Property.NewUnsearched ("fixme:folder", this.folder_name));
 
 			GMime.InternetAddressList addrs;
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.To);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+			
+			if (this.folder_name == "Sent") {
+				addrs = message.GetRecipients (GMime.RecipientType.To);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (this.folder_name == "Sent"  && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+			
+			if (this.folder_name == "Sent") {
+				addrs = message.GetRecipients (GMime.RecipientType.Cc);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (this.folder_name != "Sent"  && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", ia.Addr));
+			
+			if (this.folder_name != "Sent") {
+				addrs = GMime.InternetAddressList.Parse (message.Sender);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+						indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
+			
 			if (this.folder_name == "Sent")
 				indexable.AddProperty (Property.NewFlag ("fixme:isSent"));
 
@@ -750,48 +768,54 @@ namespace Beagle.Daemon.EvolutionMailQue
 			}
 
 			GMime.InternetAddressList addrs;
-			addrs = GMime.InternetAddressList.ParseString (messageInfo.to);
+			addrs = GMime.InternetAddressList.Parse (messageInfo.to);
 			foreach (GMime.InternetAddress ia in addrs) {
+				GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+				
 				if (!have_content) {
 					indexable.AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
-					if (ia.AddressType != GMime.InternetAddressType.Group)
-						indexable.AddProperty (Property.New ("fixme:to_address", ia.Addr));
-
+					if (ia is GMime.InternetAddressMailbox)
+						indexable.AddProperty (Property.New ("fixme:to_address", mailbox.Address));
+					
 					indexable.AddProperty (Property.New ("fixme:to_name", ia.Name));
 				}
-
-				if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+				
+				if (this.folder_name == "Sent" && ia is GMime.InternetAddressMailbox)
+					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (messageInfo.cc);
+			addrs = GMime.InternetAddressList.Parse (messageInfo.cc);
 			foreach (GMime.InternetAddress ia in addrs) {
+				GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+				
 				if (!have_content) {
 					indexable.AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
-					if (ia.AddressType != GMime.InternetAddressType.Group)
-						indexable.AddProperty (Property.New ("fixme:cc_address", ia.Addr));
-
+					if (ia is GMime.InternetAddressMailbox)
+						indexable.AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
+					
 					indexable.AddProperty (Property.New ("fixme:cc_name", ia.Name));
 				}
-
-				if (this.folder_name == "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", ia.Addr));
+				
+				if (this.folder_name == "Sent" && ia is GMime.InternetAddressMailbox)
+					indexable.AddProperty (Property.NewUnsearched ("fixme:sentTo", mailbox.Address));
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (messageInfo.from);
+			addrs = GMime.InternetAddressList.Parse (messageInfo.from);
 			foreach (GMime.InternetAddress ia in addrs) {
+				GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+				
 				if (!have_content) {
 					indexable.AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
-					if (ia.AddressType != GMime.InternetAddressType.Group)
-						indexable.AddProperty (Property.New ("fixme:from_address", ia.Addr));
-
+					if (ia is GMime.InternetAddressMailbox)
+						indexable.AddProperty (Property.New ("fixme:from_address", mailbox.Address));
+					
 					indexable.AddProperty (Property.New ("fixme:from_name", ia.Name));
 				}
 
-				if (this.folder_name != "Sent" && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", ia.Addr));
+				if (this.folder_name != "Sent" && ia is GMime.InternetAddressMailbox)
+					indexable.AddProperty (Property.NewUnsearched ("fixme:gotFrom", mailbox.Address));
 			}
 			addrs.Dispose ();
 
diff -upNr beagle-0.3.9.orign/beagled/GoogleBackends/GMailSearchDriver.cs beagle-0.3.9/beagled/GoogleBackends/GMailSearchDriver.cs
--- beagle-0.3.9.orign/beagled/GoogleBackends/GMailSearchDriver.cs	2008-04-25 21:26:19.000000000 +0200
+++ beagle-0.3.9/beagled/GoogleBackends/GMailSearchDriver.cs	2009-01-28 12:33:17.000000000 +0100
@@ -322,38 +322,47 @@ namespace Beagle.Daemon.GoogleBackend {
 			hit.AddProperty (Property.NewDate ("fixme:date", message.Date.ToUniversalTime ()));
 
 			GMime.InternetAddressList addrs;
-			addrs = message.GetRecipients (GMime.Message.RecipientType.To);
+			addrs = message.GetRecipients (GMime.RecipientType.To);
 			foreach (GMime.InternetAddress ia in addrs) {
 				hit.AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					hit.AddProperty (Property.New ("fixme:to_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					hit.AddProperty (Property.New ("fixme:to_address", mailbox.Address));
+				}
+				
 				hit.AddProperty (Property.New ("fixme:to_name", ia.Name));
 			}
 			addrs.Dispose ();
 
-			addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
+			addrs = message.GetRecipients (GMime.RecipientType.Cc);
 			foreach (GMime.InternetAddress ia in addrs) {
 				hit.AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					hit.AddProperty (Property.New ("fixme:cc_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					hit.AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
+				}
+				
 				hit.AddProperty (Property.New ("fixme:cc_name", ia.Name));
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
+			addrs = GMime.InternetAddressList.Parse (message.Sender);
 			foreach (GMime.InternetAddress ia in addrs) {
 				hit.AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					hit.AddProperty (Property.New ("fixme:from_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					hit.AddProperty (Property.New ("fixme:from_address", mailbox.Address));
+				}
+				
 				hit.AddProperty (Property.New ("fixme:from_name", ia.Name));
 			}
 			addrs.Dispose ();
 
 			foreach (GMime.References refs in message.References)
-				hit.AddProperty (Property.NewUnsearched ("fixme:reference", refs.Msgid));
+				hit.AddProperty (Property.NewUnsearched ("fixme:reference", refs.MessageId));
 
 			string list_id = message.GetHeader ("List-Id");
 			if (list_id != null)
diff -upNr beagle-0.3.9.orign/beagled/KMailQueryable/KMailIndexer.cs beagle-0.3.9/beagled/KMailQueryable/KMailIndexer.cs
--- beagle-0.3.9.orign/beagled/KMailQueryable/KMailIndexer.cs	2008-02-10 21:24:19.000000000 +0100
+++ beagle-0.3.9/beagled/KMailQueryable/KMailIndexer.cs	2009-01-28 12:33:17.000000000 +0100
@@ -407,28 +407,46 @@ namespace Beagle.Daemon.KMailQueryable {
                         indexable.AddProperty (Property.NewUnsearched ("fixme:folder", folder_name));
 
 			GMime.InternetAddressList addrs;
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.To);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (folder_name == Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", ia.Addr));
-			}
-			addrs.Dispose ();
-
-			addrs = message.GetRecipients (GMime.Message.RecipientType.Cc);
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (folder_name == Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", ia.Addr));
-			}
-			addrs.Dispose ();
-
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (message.Sender));
-			foreach (GMime.InternetAddress ia in addrs) {
-				if (folder_name != Queryable.SentMailFolderName && ia.AddressType != GMime.InternetAddressType.Group)
-					indexable.AddProperty (Property.NewKeyword ("fixme:gotFrom", ia.Addr));
+			
+			if (folder_name == Queryable.SentMailFolderName) {
+				addrs = message.GetRecipients (GMime.RecipientType.To);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
 			}
-			addrs.Dispose ();
-
+			
+			if (folder_name == Queryable.SentMailFolderName) {
+				addrs = message.GetRecipients (GMime.RecipientType.Cc);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewKeyword ("fixme:sentTo", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
+			}
+			
+			if (folder_name != Queryable.SentMailFolderName) {
+				addrs = GMime.InternetAddressList.Parse (message.Sender);
+				foreach (GMime.InternetAddress ia in addrs) {
+					if (ia is GMime.InternetAddressMailbox) {
+						GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+						
+						indexable.AddProperty (Property.NewKeyword ("fixme:gotFrom", mailbox.Address));
+					}
+				}
+				
+				addrs.Dispose ();
+			}
+			
 			if (folder_name == Queryable.SentMailFolderName)
 				indexable.AddProperty (Property.NewFlag ("fixme:isSent"));
 			else {
diff -upNr beagle-0.3.9.orign/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs beagle-0.3.9/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
--- beagle-0.3.9.orign/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs	2008-07-18 16:27:59.000000000 +0200
+++ beagle-0.3.9/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs	2009-01-28 12:33:17.000000000 +0100
@@ -367,9 +367,14 @@ namespace Beagle.Daemon.ThunderbirdQuery
 			message.Subject = Mime.HeaderDecodeText (GetText (document, "Subject"));
 			message.Sender = Mime.HeaderDecodePhrase (GetText (document, "Author"));
 			message.MessageId = GetText (document, "MessageId");
-			message.SetDate (DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date"))), 0);
-			message.AddRecipientsFromString ("To", Mime.HeaderDecodePhrase (GetText (document, "Recipients")));
-
+			message.Date = DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date")));
+			
+			string str = GetText (document, "Recipients");
+			GMime.InternetAddressList recipients = GMime.InternetAddressList.Parse (str);
+			foreach (GMime.InternetAddress ia in recipients)
+				message.To.Add (ia);
+			recipients.Dispose ();
+			
 			return message;
 		}
 		
@@ -434,7 +439,7 @@ namespace Beagle.Daemon.ThunderbirdQuery
 			
 			// We _know_ that the stream comes from a StreamReader, which uses UTF8 by
 			// default. So we use that here when parsing our string.
-			return (str != null ? Encoding.UTF8.GetString (str, 0, pos) : string.Empty);
+			return (str != null ? System.Text.Encoding.UTF8.GetString (str, 0, pos) : string.Empty);
 		}
 		
 		// This spell "charset="
@@ -462,7 +467,7 @@ namespace Beagle.Daemon.ThunderbirdQuery
 			// instead of UTF-8 in some cases and that will really mess things up.
 			byte[] buffer = null;
 			int c, header_length = 0, newlines = 0, charset_pos = 0;
-			Encoding enc = Encoding.UTF8;
+			System.Text.Encoding enc = System.Text.Encoding.UTF8;
 			try {
 				do {
 					c = stream.BaseStream.ReadByte ();
@@ -491,7 +496,7 @@ namespace Beagle.Daemon.ThunderbirdQuery
 				stream.BaseStream.Read (buffer, 0, buffer.Length);
 				
 				// We need to use correct encoding
-				enc = Encoding.GetEncoding (encoding_str);
+				enc = System.Text.Encoding.GetEncoding (encoding_str);
 			} catch {
 			} finally {
 				stream.Close ();
diff -upNr beagle-0.3.9.orign/configure beagle-0.3.9/configure
--- beagle-0.3.9.orign/configure	2008-07-19 13:20:36.000000000 +0200
+++ beagle-0.3.9/configure	2009-01-28 12:35:43.000000000 +0100
@@ -2791,7 +2791,7 @@ MONODOC_REQUIRED=1.2.4
 NDESK_DBUS_REQUIRED=0.5.2
 NDESK_DBUS_GLIB_REQUIRED=0.3.0
 GTK_SHARP_REQUIRED=2.10.0
-GMIME_SHARP_REQUIRED=2.2.0
+GMIME_SHARP_REQUIRED=2.4.0
 EVOLUTION_SHARP_REQUIRED=0.13.3
 GSF_SHARP_REQUIRED=0.6
 GTK_REQUIRED=2.10.0
@@ -25660,7 +25660,7 @@ if test -n "$PKG_CONFIG"; then
 	glade-sharp-2.0 >= \$GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= \$GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= \$GTK_SHARP_REQUIRED
-	gmime-sharp >= \$GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= \$GMIME_SHARP_REQUIRED
 \"") >&5
   ($PKG_CONFIG --exists --print-errors "
 	gtk-sharp-2.0 >= $GTK_SHARP_REQUIRED
@@ -25668,7 +25668,7 @@ if test -n "$PKG_CONFIG"; then
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 ") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -25679,7 +25679,7 @@ if test -n "$PKG_CONFIG"; then
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 " 2>/dev/null`
 else
   pkg_failed=yes
@@ -25699,7 +25699,7 @@ if test -n "$PKG_CONFIG"; then
 	glade-sharp-2.0 >= \$GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= \$GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= \$GTK_SHARP_REQUIRED
-	gmime-sharp >= \$GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= \$GMIME_SHARP_REQUIRED
 \"") >&5
   ($PKG_CONFIG --exists --print-errors "
 	gtk-sharp-2.0 >= $GTK_SHARP_REQUIRED
@@ -25707,7 +25707,7 @@ if test -n "$PKG_CONFIG"; then
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 ") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -25718,7 +25718,7 @@ if test -n "$PKG_CONFIG"; then
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 " 2>/dev/null`
 else
   pkg_failed=yes
@@ -25744,7 +25744,7 @@ fi
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 "`
         else
 	        BEAGLE_UI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "
@@ -25753,7 +25753,7 @@ fi
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 "`
         fi
 	# Put the nasty error message in config.log where it belongs
@@ -25765,7 +25765,7 @@ fi
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 ) were not met:
 
 $BEAGLE_UI_PKG_ERRORS
@@ -25783,7 +25783,7 @@ echo "$as_me: error: Package requirement
 	glade-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED
 	gnome-vfs-sharp-2.0 >= $GTK_SHARP_REQUIRED
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 ) were not met:
 
 $BEAGLE_UI_PKG_ERRORS
@@ -26167,18 +26167,18 @@ if test -n "$PKG_CONFIG"; then
     { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"evolution-sharp >= \$EVOLUTION_SHARP_REQUIRED 	\\
                   gconf-sharp-2.0 >= \$GTK_SHARP_REQUIRED	\\
 		  glib-sharp-2.0 >= \$GTK_SHARP_REQUIRED
-                  gmime-sharp >= \$GMIME_SHARP_REQUIRED\"") >&5
+                  gmime-sharp-2.4 >= \$GMIME_SHARP_REQUIRED\"") >&5
   ($PKG_CONFIG --exists --print-errors "evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
 		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
-                  gmime-sharp >= $GMIME_SHARP_REQUIRED") 2>&5
+                  gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   pkg_cv_EVO_CFLAGS=`$PKG_CONFIG --cflags "evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
 		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
-                  gmime-sharp >= $GMIME_SHARP_REQUIRED" 2>/dev/null`
+                  gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -26194,18 +26194,18 @@ if test -n "$PKG_CONFIG"; then
     { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"evolution-sharp >= \$EVOLUTION_SHARP_REQUIRED 	\\
                   gconf-sharp-2.0 >= \$GTK_SHARP_REQUIRED	\\
 		  glib-sharp-2.0 >= \$GTK_SHARP_REQUIRED
-                  gmime-sharp >= \$GMIME_SHARP_REQUIRED\"") >&5
+                  gmime-sharp-2.4 >= \$GMIME_SHARP_REQUIRED\"") >&5
   ($PKG_CONFIG --exists --print-errors "evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
 		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
-                  gmime-sharp >= $GMIME_SHARP_REQUIRED") 2>&5
+                  gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   pkg_cv_EVO_LIBS=`$PKG_CONFIG --libs "evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
 		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
-                  gmime-sharp >= $GMIME_SHARP_REQUIRED" 2>/dev/null`
+                  gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -26227,12 +26227,12 @@ fi
 	        EVO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
 		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
-                  gmime-sharp >= $GMIME_SHARP_REQUIRED"`
+                  gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED"`
         else
 	        EVO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
 		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
-                  gmime-sharp >= $GMIME_SHARP_REQUIRED"`
+                  gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED"`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$EVO_PKG_ERRORS" >&5
@@ -26781,12 +26781,12 @@ if test -n "$PKG_CONFIG"; then
         if test -n "$PKG_CONFIG" && \
     { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"
 	shared-mime-info
-	gmime-sharp >= \$GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= \$GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= \$GTK_SHARP_REQUIRED
 \"") >&5
   ($PKG_CONFIG --exists --print-errors "
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 ") 2>&5
   ac_status=$?
@@ -26794,7 +26794,7 @@ if test -n "$PKG_CONFIG"; then
   (exit $ac_status); }; then
   pkg_cv_BEAGLED_CFLAGS=`$PKG_CONFIG --cflags "
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 " 2>/dev/null`
 else
@@ -26811,12 +26811,12 @@ if test -n "$PKG_CONFIG"; then
         if test -n "$PKG_CONFIG" && \
     { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"
 	shared-mime-info
-	gmime-sharp >= \$GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= \$GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= \$GTK_SHARP_REQUIRED
 \"") >&5
   ($PKG_CONFIG --exists --print-errors "
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 ") 2>&5
   ac_status=$?
@@ -26824,7 +26824,7 @@ if test -n "$PKG_CONFIG"; then
   (exit $ac_status); }; then
   pkg_cv_BEAGLED_LIBS=`$PKG_CONFIG --libs "
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 " 2>/dev/null`
 else
@@ -26847,13 +26847,13 @@ fi
         if test $_pkg_short_errors_supported = yes; then
 	        BEAGLED_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 "`
         else
 	        BEAGLED_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 "`
         fi
@@ -26862,7 +26862,7 @@ fi
 
 	{ { echo "$as_me:$LINENO: error: Package requirements (
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 ) were not met:
 
@@ -26877,7 +26877,7 @@ See the pkg-config man page for more det
 " >&5
 echo "$as_me: error: Package requirements (
 	shared-mime-info
-	gmime-sharp >= $GMIME_SHARP_REQUIRED
+	gmime-sharp-2.4 >= $GMIME_SHARP_REQUIRED
 	glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
 ) were not met:
 
@@ -26924,7 +26924,7 @@ BEAGLED_LIBS="$BEAGLED_LIBS $GSF_SHARP_L
 
 
 GSF_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gsf-sharp`
-GMIME_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gmime-sharp`
+GMIME_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gmime-sharp-2.4`
 
 
 # Check whether --enable-epiphany-extension was given.
diff -upNr beagle-0.3.9.orign/Filters/FilterMail.cs beagle-0.3.9/Filters/FilterMail.cs
--- beagle-0.3.9.orign/Filters/FilterMail.cs	2008-06-12 02:20:07.000000000 +0200
+++ beagle-0.3.9/Filters/FilterMail.cs	2009-01-28 12:33:17.000000000 +0100
@@ -126,7 +126,7 @@ namespace Beagle.Filters {
 
 			// Messages that are multipart/alternative shouldn't be considered as having
 			// attachments.  Unless of course they do.
-			if (mime_part is GMime.Multipart && mime_part.ContentType.Subtype.ToLower () != "alternative")
+			if (mime_part is GMime.Multipart && mime_part.ContentType.MediaSubtype.ToLower () != "alternative")
 				return true;
 
 			return false;
@@ -140,34 +140,43 @@ namespace Beagle.Filters {
 			AddProperty (Property.NewDate ("fixme:date", message.Date.ToUniversalTime ()));
 
 			GMime.InternetAddressList addrs;
-			addrs = this.message.GetRecipients (GMime.Message.RecipientType.To);
+			addrs = this.message.GetRecipients (GMime.RecipientType.To);
 			foreach (GMime.InternetAddress ia in addrs) {
 				AddProperty (Property.NewUnsearched ("fixme:to", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					AddProperty (Property.New ("fixme:to_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					AddProperty (Property.New ("fixme:to_address", mailbox.Address));
+				}
+				
 				AddProperty (Property.New ("fixme:to_name", ia.Name));
 				AddEmailLink (ia);
 			}
 			addrs.Dispose ();
 
-			addrs = this.message.GetRecipients (GMime.Message.RecipientType.Cc);
+			addrs = this.message.GetRecipients (GMime.RecipientType.Cc);
 			foreach (GMime.InternetAddress ia in addrs) {
 				AddProperty (Property.NewUnsearched ("fixme:cc", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					AddProperty (Property.New ("fixme:cc_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					AddProperty (Property.New ("fixme:cc_address", mailbox.Address));
+				}
+				
 				AddProperty (Property.New ("fixme:cc_name", ia.Name));
 				AddEmailLink (ia);
 			}
 			addrs.Dispose ();
 
-			addrs = GMime.InternetAddressList.ParseString (GMime.Utils.HeaderDecodePhrase (this.message.Sender));
+			addrs = GMime.InternetAddressList.Parse (this.message.Sender);
 			foreach (GMime.InternetAddress ia in addrs) {
 				AddProperty (Property.NewUnsearched ("fixme:from", ia.ToString (false)));
-				if (ia.AddressType != GMime.InternetAddressType.Group)
-					AddProperty (Property.New ("fixme:from_address", ia.Addr));
-
+				if (ia is GMime.InternetAddressMailbox) {
+					GMime.InternetAddressMailbox mailbox = ia as GMime.InternetAddressMailbox;
+					
+					AddProperty (Property.New ("fixme:from_address", mailbox.Address));
+				}
+				
 				AddProperty (Property.New ("fixme:from_name", ia.Name));
 				AddEmailLink (ia);
 			}
@@ -184,7 +193,7 @@ namespace Beagle.Filters {
 				AddProperty (Property.NewUnsearched ("fixme:msgid", GMime.Utils.DecodeMessageId (msgid)));
 
 			foreach (GMime.References refs in this.message.References)
-				AddProperty (Property.NewUnsearched ("fixme:reference", refs.Msgid));
+				AddProperty (Property.NewUnsearched ("fixme:reference", refs.MessageId));
 
 			string list_id = this.message.GetHeader ("List-Id");
 			if (list_id != null)
@@ -345,16 +354,15 @@ namespace Beagle.Filters {
 					}
 				} else if (mime_part is GMime.Multipart) {
 					GMime.Multipart multipart = (GMime.Multipart) mime_part;
-
-					int num_parts = multipart.Number;
+					int num_parts = multipart.Count;
 
 					// If the mimetype is multipart/alternative, we only want to index
 					// one part -- the richest one we can filter.
-					if (mime_part.ContentType.Subtype.ToLower () == "alternative") {
+					if (mime_part.ContentType.MediaSubtype.ToLower () == "alternative") {
 						// The richest formats are at the end, so work from there
 						// backward.
 						for (int i = num_parts - 1; i >= 0; i--) {
-							GMime.Object subpart = multipart.GetPart (i);
+							GMime.Object subpart = multipart[i];
 
 							if (IsMimeTypeHandled (subpart.ContentType.ToString ())) {
 								part = subpart;
@@ -370,7 +378,7 @@ namespace Beagle.Filters {
 					// the parts, treat them like a bunch of attachments.
 					if (part == null) {
 						for (int i = 0; i < num_parts; i++) {
-							using (GMime.Object subpart = multipart.GetPart (i))
+							using (GMime.Object subpart = multipart[i])
 								this.OnEachPart (subpart);
 						}
 					}
@@ -400,7 +408,7 @@ namespace Beagle.Filters {
 						} else if (mime_type == "text/html") {
 							no_child_needed = true;
 							html_part = true;
-							string enc = part.GetContentTypeParameter ("charset"); 
+							string enc = part.ContentType.GetParameter ("charset"); 
 							// DataWrapper.Stream is a very limited stream
 							// and does not allow Seek or Tell
 							// HtmlFilter requires Stream.Position=0.
@@ -473,7 +481,7 @@ namespace Beagle.Filters {
 							if (length != -1)
 								child.AddProperty (Property.NewUnsearched ("fixme:filesize", length));
 
-							if (part.ContentType.Type.ToLower () == "text")
+							if (part.ContentType.MediaType.ToLower () == "text")
 								child.SetTextReader (new StreamReader (stream));
 							else
 								child.SetBinaryStream (stream);