aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-filter-search.c
Commit message (Collapse)AuthorAgeFilesLines
* Take new session arg. Update callers. (symbols[]): changed get-source toNot Zed2002-09-191-32/+39
| | | | | | | | | | | | | | | | | | 2002-09-19 Not Zed <NotZed@Ximian.com> * camel-filter-search.c (camel_filter_search_match): Take new session arg. Update callers. (symbols[]): changed get-source to header-source (header_source): Chagned from get_source. Now a boolean, returns true if source matches one of the arguments. Uses the provider url comparison directly for accurate checking. Makes 'filter on source' work. * camel-filter-driver.c (camel_filter_driver_new): Take new arg, session. (camel_filter_driver_finalise): Free session. svn path=/trunk/; revision=18112
* Renamed from shell_exec(). Also, we now want to pass argc/argv on to theJeffrey Stedfast2002-07-251-7/+14
| | | | | | | | | | | | | 2002-07-25 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-driver.c (do_shell): Renamed from shell_exec(). Also, we now want to pass argc/argv on to the CamelFilterDriverShellFunc. (camel_filter_driver_set_shell_func): Renamed a bit. * camel-filter-search.c (pipe_message): Renamed from shell_exec(). svn path=/trunk/; revision=17583
* Use execv ("sh", "-c", command) rather than execing the command directly.Jeffrey Stedfast2002-07-251-11/+4
| | | | | | | | | 2002-07-25 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (run_command): Use execv ("sh", "-c", command) rather than execing the command directly. svn path=/trunk/; revision=17582
* Removed. (get_score): Removed. Labels & scores are stored in tags, weNot Zed2002-07-161-36/+6
| | | | | | | | | | | | | 2002-07-15 Not Zed <NotZed@Ximian.com> * camel-filter-search.c (get_label): Removed. (get_score): Removed. Labels & scores are stored in tags, we already have a function to get tags. (user_tag): Fail if we dont get valid arguments, it must be a string type. (system_flag): Same here. svn path=/trunk/; revision=17471
* New e-sexp callback function to get a user_tag label value.Jeffrey Stedfast2002-05-171-0/+13
| | | | | | | | | 2002-05-16 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (get_label): New e-sexp callback function to get a user_tag label value. svn path=/trunk/; revision=16937
* New filter function to pipe a message to another program. (run_command):Jeffrey Stedfast2002-05-101-13/+6
| | | | | | | | | | 2002-05-09 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (shell_exec): New filter function to pipe a message to another program. (run_command): Fixed some bugs to make this work. svn path=/trunk/; revision=16742
* New filter function to pipe a message to another program.Jeffrey Stedfast2002-05-101-0/+130
| | | | | | | | | 2002-05-09 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (shell_exec): New filter function to pipe a message to another program. svn path=/trunk/; revision=16740
* If the mbox file is a symlink, follow the symlink and get the One TrueJeffrey Stedfast2002-01-101-18/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-01-09 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-mbox-folder.c (camel_mbox_folder_new): If the mbox file is a symlink, follow the symlink and get the One True Path so that we can rewrite the mbox later without worrying about clobbering the symlink. 2002-01-08 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (TODO): There are a few sexp callbacks that could be modified to use fms->info rather than using a message object (like date and possibly mlist stuff) but *only* if the date exists on the CamelMessageInfo object (since it may be blank except for message flags). (camel_filter_search_get_message): New internal convenience function to make sure that the FilterMessageSearch has loaded the message (and to load the message if this isn't the case). (check_header): Call camel_filter_search_get_message(). (header_exists): Same. (header_regex): Here too. (header_full_regex): And here. (body_contains): Again here. (body_regex): Here too. (get_sent_date): Here also. (get_received_date): Same. (get_source): Here if we need to. (camel_filter_search_match): Now takes a callback function/data pair for on-demand message loading so that we don't necessarily have to load the message if the defined filter rules don't require it. * camel-filter-driver.c (camel_filter_driver_filter_folder): Don't bother fetching the message here, let camel_filter_driver_filter_message() worry about this. (get_message_cb): New utility callback to fetch a message. (camel_filter_driver_filter_message): Only fetch the message if we absolutely need it to get a CamelMessageInfo. Instead of passing a message object to camel_filter_search_match(), pass get_message_cb and some user_data so that the matching code can fetch the message on demand. svn path=/trunk/; revision=15276
* If we have no source string, then use undefined, which should always32001-11-141-3/+7
| | | | | | | | | | 2001-11-13 <NotZed@Ximian.com> * camel-filter-search.c (get_source): If we have no source string, then use undefined, which should always evaluate to FALSE. Fix for #15267. svn path=/trunk/; revision=14688
* More fixing of the license texts.Ettore Perazzoli2001-10-281-11/+11
| | | | svn path=/trunk/; revision=14216
* Use search_type_mlist for mailing list searches.Michael Zucci2001-10-231-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-filter-search.c, camel-folder-search.c (check_header): Use search_type_mlist for mailing list searches. * camel.c (camel_init): call camel-mime-utils-init func. * camel-mime-utils.c: Changed mail mail_list_magic to include a domain part, also pre-compile all the patterns. They are all backward compatible except List-Id: which now uses the mail-address-like <list-name.host.name> part rather than the plain-text part (which might've been blank anyway). (camel_mime_utils_init): Initialisation function to setup any static data required by camel-mime-utils at run-time. We now setup the base64/charset class tables here, so it doesn't need to be done statically. (camel_mime_special_table, camel_mime_base64_rank): No longer statically initialise these. (main): Removed + the tests at the end of the file. (header_raw_check_mailing_list): Dont compile regex's here, already compiled in utils_init. Use the regex patterns to remove leading <'s from addresses. Also, if there is a domain part matched, add that after a '@' is added. camel-search-private.c: (camel_search_header_match): Added SEARCH_TYPE_MLIST for mlist search types. It ignores the domain part if either (but not both) of the values dont have it. svn path=/trunk/; revision=13894
* Removed charset/locale charset lookup and iconv_open/close functions,12001-10-121-1/+3
| | | | | | | | | 2001-10-11 <NotZed@Ximian.com> * camel-charset-map.[ch]: Removed charset/locale charset lookup and iconv_open/close functions, moved to gal. Fixed all callers. svn path=/trunk/; revision=13602
* Added MATCH_NEWLINE flag, -> REG_NEWLINE.32001-10-041-7/+6
| | | | | | | | | | | | | | | | | | 2001-10-03 <NotZed@Ximian.com> * camel-search-private.c (camel_search_build_match_regex): Added MATCH_NEWLINE flag, -> REG_NEWLINE. * camel-lock-helper.c: Include <string.h> to kill some warnings. * camel-filter-search.c (get_full_header): Put \n's between each line we generate. (header_full_regex): Dont drop the first argument to the command -> empty matches! (header_full_regex): Set match_newline for building regex. (body_regex): And here too. These all fix #9877. svn path=/trunk/; revision=13392
* Same here.Jeffrey Stedfast2001-09-291-5/+12
| | | | | | | | | | | 2001-09-28 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (get_source): Same here. * camel-mime-message.c (camel_mime_message_set_source): Don't use the e_url_shroud hack, use CamelURL functions instead. svn path=/trunk/; revision=13240
* If the type is encoded, get the fallback charset from the message42001-09-251-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-09-24 <NotZed@Ximian.com> * camel-filter-search.c (check_header): If the type is encoded, get the fallback charset from the message content-type. * camel-mime-part-utils.c (check_html_charset): Dont check for charset==null before calling charset_to_iconv. (simple_data_wrapper_construct_from_parser): " * camel-mime-message.c (process_header): Try use content-type charset param as the fallback charset. * camel-charset-map.c (camel_charset_to_iconv): Handle name == NULL, return NULL. * camel-folder-summary.c (camel_folder_summary_format_address): (camel_folder_summary_format_string): Made private again, removed #warning about it. Renamed to s/camel_folder//. (summary_format_string): Take default charset param. (camel_message_info_new_from_header, message_info_new): Decode content-type field to get the charset parameter to use as the default charset for decoding strings. * camel-search-private.c (camel_search_header_match): Pass NULL as the charset, the locale charset is always tried. (camel_search_header_match): Supply a default_charset parameter to be used with TYPE_ENCODED params. * camel-mime-utils.c (header_param): get rid of the g_strcasecmp crap. (header_set_param): Same here. (header_decode_param_list): And here. (header_decode_text): Totally rewritten. 30% of its size. If the word is not rfc2047 encoded, always try default_charset if supplied, if that fails, try locale charset if it exists, if that fails then assume latin1/7 bit ascii. (append_8bit): Changed to return FALSE if we can't convert for whatever reason, and dont append anything. * camel-mime-part.h (struct _CamelMimePart): Move content_type and headers out of the 'private' section. * camel-mime-part.c (get_headers): Dont do any conversion on the header. (process_header): Get the content-type charset as the fallback charset for decode_string. (construct_from_parser): IF we have a content-type header, process it before doing anything else, so we have access to a fallback charset for invalid headers. svn path=/trunk/; revision=13096
* Don't reuse the exception if it has already been set.Jeffrey Stedfast2001-09-141-4/+15
| | | | | | | | | | | | | | 2001-09-13 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-driver.c (camel_filter_driver_filter_folder): Don't reuse the exception if it has already been set. (camel_filter_driver_filter_message): Same here. Also use the new return value from camel_filter_search_match(). * camel-filter-search.c (camel_filter_search_match): Return an integer (matched, no-match, or error). svn path=/trunk/; revision=12819
* Remove trailing stuff from URLs before returning. (Done in an evil way,Jon Trowbridge2001-08-091-2/+14
| | | | | | | | | | 2001-08-08 Jon Trowbridge <trow@ximian.com> * camel-filter-search.c (get_source): Remove trailing stuff from URLs before returning. (Done in an evil way, not in the good way suggested by fejj. :)) (Bug #4876) svn path=/trunk/; revision=11808
* Properly determine match type to pass to header_match.Not Zed2001-08-081-53/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-08-08 Not Zed <NotZed@Ximian.com> * camel-filter-search.c (check_header): Properly determine match type to pass to header_match. (address_matches_exactly): Removed, effectively added to camel_search_header_match. * camel-folder-search.c (check_header): Properly determine the match type to pass to header_match. * camel-search-private.c (camel_search_header_match): Add a new parameter 'type' which is the type of header we're matching against. ASIS means utf8 format, ADDRESS means an internet address ('formatted'), ADDRESS_ENCODED means a raw address header, ENCODED means rfc 2047 encoded text. (header_match): Move original logic here, have search_header_match call it as appropriate for the 'type' of match. 2001-08-07 Not Zed <NotZed@Ximian.com> * camel-session.c (camel_session_class_init): Only init the vee provider struct once (if we're subclassed this will get called multiple times). * camel-object.c (obj_finalize): Removed a bit of a debug that crept in with jacob's poolv patch (?). svn path=/trunk/; revision=11772
* New function to do danw's address "is" comparison (as specified in bugJeffrey Stedfast2001-08-081-44/+88
| | | | | | | | | | | 2001-08-07 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (address_matches_exactly): New function to do danw's address "is" comparison (as specified in bug #5886. (check_header): Special-case address-type headers when we are doing an exact match to use the address_matches_exactly function. svn path=/trunk/; revision=11738
* Implemented nntp_folder_search_by_expression and nntp_folder_search_free.Sam Creasey2001-07-031-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-02 Sam Creasey <sammy@oh.verio.com> * providers/nntp/camel-nntp-folder.c: Implemented nntp_folder_search_by_expression and nntp_folder_search_free. Basic search functionality e.g. unread marking now works for NNTP folders. * camel_filter_search.c (get_size): Added get-size sexp directive to get the size of a message for filters. * providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new): Always check with the NNTP server after summary load -- this function now always expires old summary entries and syncs with the news server. * providers/nntp/camel-nntp-utils.c (camel_nntp_get_headers): Only fetch headers for articles not already logged in the summary file. * providers/nntp/camel-nntp-grouplist.c (camel_nntp_get_grouplist_from_*): change from g_list_append() to g_list_prepend() + g_list_reverse. Traversing 40,000 element linked lists sucks. * providers/nntp/camel-nntp-store.c (camel_nntp_command): Should the NNTP connection die with CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, make a single retry attempt. Timing out the NNTP link is less painful this way. svn path=/trunk/; revision=10716
* g_strdup() the message source here or we will have problems later when weJeffrey Stedfast2001-06-261-32/+29
| | | | | | | | | | 2001-06-25 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (get_source): g_strdup() the message source here or we will have problems later when we go to free the result ;-) svn path=/trunk/; revision=10498
* Update the copyrights, replacing Helix Code with Ximian andEttore Perazzoli2001-06-231-2/+2
| | | | | | helixcode.com with ximian.com all over the place. svn path=/trunk/; revision=10440
* Make the (previously unused) get-source command actually do the rightJon Trowbridge2001-04-141-3/+14
| | | | | | | | | | | | | | | | | | | | | | 2001-04-13 Jon Trowbridge <trow@gnu.org> * camel-filter-search.c (get_source): Make the (previously unused) get-source command actually do the right thing, properly shrouding any passed-in source and falling back to use the source attached to the mime message. 2001-04-13 Jon Trowbridge <trow@gnu.org> * filtertypes.xml: Add XML specs for source account filtering. * filter-element.c (filter_element_new_type_name): Recognize type "source", construct a FilterSource. * filter-source.c: Added. A FilterElement for the account e-mail comes from. svn path=/trunk/; revision=9304
* Big header cleanups and nntp compile fixKjartan Maraas2001-03-301-0/+5
| | | | svn path=/trunk/; revision=9024
* Implement a pseudo-header "x-camel-mlist" which just looks up in theNot Zed2001-02-231-1/+7
| | | | | | | | | | | | | 2001-02-23 Not Zed <NotZed@Ximian.com> * camel-filter-search.c (check_header): Implement a pseudo-header "x-camel-mlist" which just looks up in the message info for a match. * camel-folder-search.c (check_header): Add pseudo-header "x-camel-mlist" which can be used to match on mailing list. svn path=/trunk/; revision=8355
* Changed the subject search to handle case sensitive when it is mixed case.Not Zed2001-01-251-230/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-01-25 Not Zed <NotZed@Ximian.com> * tests/folder/test3.c: Changed the subject search to handle case sensitive when it is mixed case. * Makefile.am (libcamel_la_SOURCES): Added camel-ssearch-private.c (noinst_HEADERS): Added camel-search-private.h * camel-folder-search.c (check_header): New function to do the work of the various header checks. (search_header_matches): (search_header_starts_with): (search_header_ends_with): (search_header_contains): Use check_header to do the work. (build_match_regex): Removed. * camel-search-private.c (header_soundex): New function to match words to phrases using soundex algorithm. * camel-filter-search.c (soundexcmp): Removed. (check_match): Moved to search-private.h 2001-01-24 Not Zed <NotZed@Ximian.com> * camel-search-private.c (camel_search_build_match_regex): Added extra flags, so the same function can be used for start/end/whole/partial matches. (camel_search_header_match): Convenience function to check a single header against all sorts of different matches. * providers/imap/camel-imap-search.c (imap_body_contains): Fix for e_sexp api changes. * camel-folder-search.c: Fix for e_sexp api changes. (search_header_contains): Free args/quit on unknown header. (search_header_matches): " (search_header_starts_with): " (search_header_ends_with): " (match_message): Add an exception argument. (search_body_contains): Free args/quit on fatal error. (message_body_contains): Removed (moved to camel-search-private.c), fixed callers. * camel-filter-search.c: Fix for e_sexp api changes. (build_match_regex, message_body_contains): Moved into camel-filter-private.c Fixed callers. (check_header): moved guts to camel-search-private, and changed to use regex's for everything. Just calls that with the right args. (check_header): GEts the header, decodes it, and checks for failure, and whatnot. (check_match): Removed. (header_soundex): Changed significantly. Now it soundexes each word in the header separately, and compares it to the first argument. * tests/folder/test9.c (main): Fix for api changes. (main): Added tests to see that invalid match and action rules are properly detected. * camel-filter-driver.c (camel_filter_driver_filter_mbox): Remove the 'finished message' bit. (camel_filter_driver_filter_message): Remove an accidentally checked in debug. (camel_filter_driver_filter_message): Fix for e-sexp api changes. svn path=/trunk/; revision=7796
* Perform error checking on parsing/execution.Not Zed2001-01-231-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-01-23 Not Zed <NotZed@Ximian.com> * camel-filter-search.c (camel_filter_search_match): Perform error checking on parsing/execution. * camel-folder-search.c (camel_folder_search_execute_expression): Perform error handling on search expression. (CamelFolderSearchPrivate): Add a camelexception for error returns. (camel_folder_search_execute_expression): Setup exception pointer. (search_match_all): Quit on error. * providers/imap/camel-imap-summary.c (message_info_load): Removed some debug 'warnings', as they should now be displayed at the toplevel loader, and just made the code match similar code elsewhere. * providers/local/camel-mbox-summary.c (message_info_load): Error handling. (message_info_save): more error handling. * camel-folder-summary.c (message_info_load): Add error handling and sanity checking. (camel_folder_summary_load): Add error checks. (perform_content_info_load): Error + sanity checks. (content_info_load): error + sanity checks. svn path=/trunk/; revision=7739
* Index: ChangeLogMichael Zucci2001-01-171-0/+630
Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evolution/camel/ChangeLog,v retrieving revision 1.684 diff -r1.684 ChangeLog 0a1,34 > 2001-01-17 Not Zed <NotZed@Ximian.com> > > * camel-folder.c (free_summary): Call > camel_folder_summary_array_free() to do the work. > (get_summary): Use camel_folder_summary_array() to get the array > atomically. These fixes allow folder/test8 to work again, and fix > a sort of race where the summary size can change while we were > making a copy of it. > > * camel-folder-summary.c (camel_folder_summary_array): Get the > summary array atomically, so it can't contain empty records. > (camel_folder_summary_array_free): And free it. > > * tests/lib/camel-test.c (die): If we are verbose & in threads, > then goto sleep so we can debug. > > * tests/folder/test8.c (worker): Add a missing pull() for > comnparing content. > > * camel-filter-search.c: Fix the symbol table, so match-all is an > immediate function, as it should be. > > * tests/folder/test9.c (main): New test, tests some filtering > things. > > * tests/message/test3.c (main): Dont use a boundary string with > spaces in it. Folding can corrupt it. Maybe the folding isn't > working entirely right, but anyway. > > * camel-session.c: Debug out the debug. > > * camel-filter-driver.c (camel_filter_driver_filter_folder): Plug > a messageinfo leak. > 1a36,94 > > * camel-filter-search.c (header_exists): Changed to support > multiple args (or'd together). > (header_contains): Cleaned up to match the search code. Why did > fejj change it? I'll never know. > (header_matches): > (header_starts_with): > (header_ends_with): Big cleanup of fejj's "i'm the cut & paste > king" code. Also properly handle or'ing of additional args to > match what the folder-search code should do. > (check_match): New function which does the annoying matching > stuff (for header matches). > (check_header): Similarly, handles or'ing of the matches together. > (header_contains): > (header_matches): > (header_starts_with): > (header_ends_with): Call check_header to do the actual work. > (header_soundex): And here too. > (match_all): Yeah like match-all isn't passed expression results, > its passed expression terms. Fix this so match-all works like it > should, by executing the contained expression. > (message_body_contains): Copied directly from > camel-folder-search.c, a more robust/faster/simpler body search > code. > (mime_part_matches): Removed entirely. > (handle_multipart): Removed entirely. > (build_match_regex): Copied from camel-folder-search. Builds a > set of simple strings into a regex pattern that matches any of > them (for faster & simpler matching). Expanded to accept regex > patterns itself, so it can merge them together. > (body_contains): Use build match/match message to match using a > built regex. > (body_regex): Likewise, this time we tell it we're building a > regex though. > (header_full_regex): Use build_match_regex to take the drudgery > out of it, and expand it to handle multiple regex's at once. > (get_full_header): slightly cleaner (well i dunno, the sprintf > stuff just got to me). > (header_regex): Cleaned up to use build_match_Regex too, and to > properly check types. > (filter_message_search): Just allocate 'fms' on the stack. > > * camel-filter-driver.c (camel_filter_driver_finalise): > (camel_filter_driver_init): > (camel_filter_driver_class_init): > (camel_filter_driver_get_type): Changed from gtk object to camel > object. > (camel_filter_driver_add_rule): New function to add a rule to be > processed in sexp form. > (camel_filter_driver_init): Init the rules list. > (camel_filter_driver_finalise): Clear the rules/rules list. > (camel_filter_driver_filter_message): Scan rules list directly > rather than creating on the fly. > > * Makefile.am (libcamelinclude_HEADERS): Added camel-filter-driver.h > (libcamel_la_SOURCES): Added camel-filter-driver.c, code taken > from filter-driver, which can drive, uh, filters based on sexp's. > (libcamelinclude_HEADERS): > (libcamel_la_SOURCES): Added camel-filter-search.[ch] svn path=/trunk/; revision=7560