aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-06-08 08:12:52 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-06-08 08:12:52 +0800
commit47326377225c125b5fca37759faacfad1c75f20a (patch)
tree3171a0603c36399a29d6a527958e02d627ae11c5
parentc754daa1d6d974c0a0b9c6b2496236e429812ab0 (diff)
downloadgsoc2013-evolution-47326377225c125b5fca37759faacfad1c75f20a.tar.gz
gsoc2013-evolution-47326377225c125b5fca37759faacfad1c75f20a.tar.zst
gsoc2013-evolution-47326377225c125b5fca37759faacfad1c75f20a.zip
Added an argument, so that the original source URI of the mbox can be
2001-06-07 Jon Trowbridge <trow@ximian.com> * camel-filter-driver.c (camel_filter_driver_filter_mbox): Added an argument, so that the original source URI of the mbox can be passed in. This is needed because this function is called post-movemail, so we are never reading from the original mbox anymore. Without the original mbox URI, the X-Evolution-Source tag gets set incorrectly and filter-on-source will fail to work. (camel_filter_driver_filter_message): Also take an extra arg for the original source URI. It is the original URI, not the source URI, that is used for filtering and for setting the X-Evolution-Source tag. 2001-06-07 Jon Trowbridge <trow@ximian.com> * mail-ops.c (fetch_mail_fetch): Pass the original source URI to camel_filter_driver_filter_mbox. (mail_send_message): Pass NULL as the orginal source URI to camel_filter_driver_filter_message. svn path=/trunk/; revision=10152
-rw-r--r--camel/ChangeLog13
-rw-r--r--camel/camel-filter-driver.c19
-rw-r--r--camel/camel-filter-driver.h4
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/mail-ops.c4
5 files changed, 36 insertions, 11 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index cf6b62ffda..11f3b4c433 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,16 @@
+2001-06-07 Jon Trowbridge <trow@ximian.com>
+
+ * camel-filter-driver.c (camel_filter_driver_filter_mbox): Added
+ an argument, so that the original source URI of the mbox can be
+ passed in. This is needed because this function is called
+ post-movemail, so we are never reading from the original mbox
+ anymore. Without the original mbox URI, the X-Evolution-Source
+ tag gets set incorrectly and filter-on-source will fail to work.
+ (camel_filter_driver_filter_message): Also take an extra arg
+ for the original source URI. It is the original URI, not the
+ source URI, that is used for filtering and for setting the
+ X-Evolution-Source tag.
+
2001-06-05 Dan Winship <danw@ximian.com>
* providers/imap/camel-imap-folder.c (imap_rescan): Don't fetch
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 464ccc1539..d70798f6f2 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -628,7 +628,7 @@ camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, co
*
**/
int
-camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, CamelException *ex)
+camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, const char *original_source_url, CamelException *ex)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
CamelMimeParser *mp = NULL;
@@ -673,7 +673,8 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, Ca
goto fail;
}
- status = camel_filter_driver_filter_message (driver, msg, NULL, NULL, NULL, source_url, ex);
+ status = camel_filter_driver_filter_message (driver, msg, NULL, NULL, NULL, source_url,
+ original_source_url ? original_source_url : source_url, ex);
camel_object_unref (CAMEL_OBJECT (msg));
if (camel_exception_is_set (ex) || status == -1) {
report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed message %d"), i);
@@ -762,7 +763,7 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde
info = NULL;
status = camel_filter_driver_filter_message (driver, message, info, uids->pdata[i],
- folder, source_url, ex);
+ folder, source_url, source_url, ex);
if (camel_folder_has_summary_capability (folder))
camel_folder_free_message_info (folder, info);
@@ -806,6 +807,7 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde
* @uid: message uid or NULL
* @source: source folder or NULL
* @source_url: url of source folder or NULL
+ * @original_source_url: url of original source folder (pre-movemail) or NULL
* @ex: exception
*
* Filters a message based on rules defined in the FilterDriver
@@ -822,6 +824,7 @@ int
camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage *message,
CamelMessageInfo *info, const char *uid,
CamelFolder *source, const char *source_url,
+ const char *original_source_url,
CamelException *ex)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -848,15 +851,17 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
p->info = info;
p->uid = uid;
p->source = source;
-
- if (camel_mime_message_get_source (message) == NULL)
- camel_mime_message_set_source (message, source_url);
+
+ if (original_source_url && camel_mime_message_get_source (message) == NULL)
+ camel_mime_message_set_source (message, original_source_url);
node = (struct _filter_rule *)p->rules.head;
while (node->next) {
d(fprintf (stderr, "applying rule %s\n action %s\n", node->match, node->action));
- if (camel_filter_search_match(p->message, p->info, source_url, node->match, p->ex)) {
+ if (camel_filter_search_match(p->message, p->info,
+ original_source_url ? original_source_url : source_url,
+ node->match, p->ex)) {
filtered = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_START, node->name);
diff --git a/camel/camel-filter-driver.h b/camel/camel-filter-driver.h
index 94cc54820b..69e9518e7e 100644
--- a/camel/camel-filter-driver.h
+++ b/camel/camel-filter-driver.h
@@ -75,9 +75,9 @@ void camel_filter_driver_add_rule (CamelFilterDriver *d, const char *name, con
int camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage *message,
CamelMessageInfo *info, const char *uri,
- CamelFolder *source, const char *source_url,
+ CamelFolder *source, const char *source_url, const char *original_source_url,
CamelException *ex);
-int camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox,
+int camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, const char *original_source_url,
CamelException *ex);
int camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folder,
GPtrArray *uids, gboolean remove, CamelException *ex);
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5cf9910a36..e12cca3bfd 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2001-06-07 Jon Trowbridge <trow@ximian.com>
+
+ * mail-ops.c (fetch_mail_fetch): Pass the original source URI
+ to camel_filter_driver_filter_mbox.
+ (mail_send_message): Pass NULL as the orginal source URI
+ to camel_filter_driver_filter_message.
+
2001-06-06 Jon Trowbridge <trow@ximian.com>
* mail-account-gui.c (source_type_changed): Check that the chain
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index ba12baa140..4812f8c110 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -296,7 +296,7 @@ fetch_mail_fetch(struct _mail_msg *mm)
if (path && !camel_exception_is_set (&mm->ex)) {
camel_folder_freeze(fm->destination);
camel_filter_driver_set_default_folder(fm->driver, fm->destination);
- camel_filter_driver_filter_mbox(fm->driver, path, &mm->ex);
+ camel_filter_driver_filter_mbox(fm->driver, path, m->source_uri, &mm->ex);
camel_folder_thaw(fm->destination);
if (!camel_exception_is_set (&mm->ex))
@@ -549,7 +549,7 @@ mail_send_message(CamelMimeMessage *message, const char *destination, CamelFilte
if (driver)
camel_filter_driver_filter_message (driver, message, info,
- NULL, NULL, "", ex);
+ NULL, NULL, NULL, "", ex);
if (sent_folder_uri) {
folder = mail_tool_uri_to_folder (sent_folder_uri, NULL);
Update to 1.1.3jhale2016-11-228-81/+302 * Add shairport-sync 2.8.6, airPlay audio player with multi-room audioehaupt2016-11-216-0/+88 * Bump PORTREVISIONS for ports depending on the canonical version of GCC andgerald2016-11-2015-8/+15 * devel/icu: update to 58.1jbeich2016-11-202-2/+2 * - Use USES=sslsunpoet2016-11-201-2/+1 * audio/xmms-curses, sysutils/apachetop: Document ncurses requirementmarino2016-11-201-1/+1 * audio: pms, squash, tcd, waon: Document ncurses requirementmarino2016-11-204-3/+4 * audio/gramofile: Document ncurses requirement and honor CFLAGSmarino2016-11-192-6/+25 * audio: autocd, etcd, gramofile: Document ncurses requirementmarino2016-11-193-2/+3 * audio/teamspeak3-server: update 3.0.13.5 -> 3.0.13.6pi2016-11-192-6/+6 * Update to 0.4.4jhale2016-11-193-30/+14 * Drop maintainership after more than 7 years. It's about time to pass it on.decke2016-11-171-1/+1 * NOT_FOR_ARCH is the wrong spelling for NOT_FOR_ARCHS. But whilelinimon2016-11-161-2/+1 * Fix bogus BROKEN message.linimon2016-11-161-1/+1 * Fix fetchjhale2016-11-161-4/+2 * Mark as broken on various tier-2 archs.linimon2016-11-146-5/+15 * Update to 3.4.3jhale2016-11-133-61/+57 * audio/logitechmediaserver: Fix build with perl 5.24woodsb022016-11-132-7/+101 * Spell CHOSEN_COMPILER_TYPE correctlyantoine2016-11-131-2/+2 * Update to 1.35.1olivierd2016-11-132-5/+4 * Spell CHOSEN_COMPILER_TYPE correctlyantoine2016-11-131-1/+1 * audio/pulseaudio: simplify hw.snd.default_unit searchjbeich2016-11-102-6/+3 * audio/pulseaudio: respect hw.snd.default_unitjbeich2016-11-103-7/+52 * The 64-bit arm arch is actually spelled 'aarch64', not 'arm64'.linimon2016-11-091-1/+1 * Mark as broken on arm64.linimon2016-11-081-0/+1 * - Fix LICENSE handlingamdmi32016-11-071-1/+7 * Bump virtual_oss to 1.1.2.kwm2016-11-072-4/+4 * Fix build with gcc 4.2bapt2016-11-062-2/+16 * Update to 1.0.27bapt2016-11-063-5/+10 * Update to 0.1.9bapt2016-11-062-4/+4 * audio/lv2core: deprecate in favor of audio/lv2 (try#2)jbeich2016-11-054-8/+11 * audio/linuxsampler: rename LV2CORE to LV2 like in audio/calfjbeich2016-11-052-9/+9 * audio/lv2core: backout r425367 to re-land cleanlyjbeich2016-11-055-22/+20 * audio/lv2core: oops, November 31 doesn't existjbeich2016-11-051-1/+1 * audio/slv2: drop hack unnecessary after r425366jbeich2016-11-051-1/+0 * audio/lv2: oops, restore comment after r425366jbeich2016-11-051-0/+1 * audio/lv2core: deprecate in favor of audio/lv2jbeich2016-11-055-20/+23 * audio/lv2: fix substitution in lv2core.pcjbeich2016-11-052-30/+4 * Fix build with ffmpeg 3.xriggs2016-11-051-0/+47 * - Sync with Github 632e879 to allow building with upcoming ffmpeg 3.x [1]jhale2016-11-044-64/+8 * audio/libgroove: unbreak build with ffmpeg 3.xjbeich2016-11-041-0/+1 * audio/timidity: modernizejbeich2016-11-031-30/+25 * Pass maintainership of PEAR ports to the submitterjbeich2016-11-031-1/+1 * Cleanup no longer needed CHMOD usage after r424898.mat2016-11-0313-48/+0 * audio/lv2: oops, sort LICENSE fieldjbeich2016-11-011-1/+1 * audio/lv2: add new portjbeich2016-11-017-0/+292 * Bump port revision for last change. Change my email addressdeischen2016-10-311-2/+2 * Make this work with CAM again.deischen2016-10-311-0/+12 * Update to upstream version 3.0.13.5riggs2016-10-292-6/+6 * Do not redefine DEBUG_DESC when its meaning more or less matches the defaultdanfe2016-10-291-1/+0 * audio/lmms: remove wrongly used PLIST_SUB from pkg-plistpi2016-10-29