email2trac-2.10.0/0000755007443000744420000000000013012623070011720 5ustar basbasemail2trac-2.10.0/.gitattributes0000644007443000744420000000002713012622127014614 0ustar basbasemail2trac.py.in ident email2trac-2.10.0/AUTHORS0000644007443000744420000000115313012622127012772 0ustar basbasThe email2trac package is written by: Bas van der Vlies Walter de Jong DiscussionPlugin support: Blackhex FullBlogPlugin support: initial support : lucas dot eisenzimmer at t-systems-mms dot com improvements and patches: Thomas Moschny < thomas dot moschny add gmx dot de> regular patch contributor(s): Ben Artin The 0.9 port: Michel Jouvin RPM spec file: Jon Topper Initial setup and ideas from: Daniel Lundin email2trac-2.10.0/ChangeLog0000644007443000744420000015317113012622127013504 0ustar basbas2.10.0 * Fixed mailto bug in email address, do not encode '@' character in %40 Reported by: Niek Bosch and Paul Reemeyer from SURFsara Fixed by: Bas van der Vlies * WHen each ticket has its own reply to address, subject line parsing can be skipped with: ticket_update_subject_skip: True Requested by: Lucas Slim from SURFsara Author: Bas van der Vlies * Detect auto response mails, RFC 3834 and some old headers like Precedence. This email are dropped due to mail loops. Detection can be turned on , default is off. by setting: - enable_automatic_response_check: True Closes #378 Requested by: email2trac dot aprogas dot net Author: Bas van der Vlies * Added support for trac 1.2 Requested by: Jacob Share Author: Bas van der Vlies 2.9.0: * email2trac now supports discussionplugin v0.9dev. The older vcersions are not supported anymore, closes #365 Author: Paul Emberson Applied by: Bas van der Vlies * Added support for the announcer plugin. The email settings are read from the [notification] or [anoouncer] section. Author: Bas van der Vlies * Added support for wildcard adresses. So each ticket get its own replyto address, You must check if your MTA supports it, closes #297 The webinterface can also handle this via the AnnouuncerPlugin and patch: - https://trac-hacks.org/ticket/10044#comment:5 - ftp:/ftp.surfsara.nl/pub/outgoing/announcer-surfsara.tar.gz Currently two options are supported: 1) notify_replyto_rewrite: use_mail_domain (email2trac.conf) - ticket_email_replyto = @email2trac.surfsara.nl (trac.ini announcer section) 2) notify_replyto_rewrite: use_trac_smtp_replyto (email2trac.conf) - ticket_email_replyto = email2trac+${ticket.id}@surfsara.nl (trac.ini announcer section) - recipient_delimiter:+ (email2trac.conf is the default value) Author: Bas van der Vlies * Added support for trac version 1.1 Author: Michela Ledwidge Applied by: Bas van der Vlies * Dropped support for trac versions 0.10 and 0.11 Author: Bas van der Vlies - Moved sources to gitlab: https://gitlab.com/surfsara/email2trac/ 2.8.9: * Added a new parameter only save email and removed some obsolete code in save_email_for_debug, - save_raw_message Author: Bas van der Vlies 2.8.8: * No properly applied the patch for ticket #364. 2.8.7: * notify_sender did not work due to wrong variable, closes #364 Author: kroseneg at schmidham dot net Applied by: Bas van der Vlies 2.8.6: * Fixed a bug for unicode strings in email_to_unicode, skip these kind of types. Author: Bas van der Vlies 2.8.5: * Improve error message when email2trac failse, closes #345 Author: quinn add strangecode dot com Applied by: Bas van der Vlies * Regular expression for ticket update by subject parsing is too eager, closes #346 Author: thomas.moschny add gmx dot de Applied by: Bas van der Vlies 2.8.4 * There was a case where the lower method on a string was referenced as an object instead of actually making a method call, closes #340 Author: ianyh Applied by: Bas van der Vlies * Custom ticket fields were not properly initialized, closes #338 Author: ivanelsonnunes add gmail dot com Applied by: Bas van der Vlies * fixed a format-security problem in run_email2trac.c, closes #341 Author: thomasdot moschny@gmx dot de Applied by: Bas van der Vlies * fixed Typo in variable assignment, closes #342 Author: Anonymous Applied by: Bas van der Vlies 2.8.0 * Also made delete_spam virtual env aware Fixed by: Bas van der Vlies * cc_fields ignored existing ticket CC field on ticket update, closes #324 Author: tboudreau add us dot ntt dot net Applied by: Bas van der Vlies * strip_quotes printed to stdout instead of using the logger function. Due this error run_email2trac will break, closes #325 Author: tboudreau add us dot ntt dot net Applied by: Bas van der Vlies * Added suppport for trac version 1.1, closes #322 Reported by: info add lcube dot de Fixed by: Bas van der Vlies * Added a new option cc_black_list. When an CC-address is in this list. It wil not be put in the ticket CC-field. Author: Bas van der Vlies * Fixed a bug with attachment filenames that contain unicode filenames, closes #327 Reported by: ivanelsonnunes add gmail dot com Author: Bas van der Vlies * Fixed an bug in get_sender_info function when we try to match the email address to an trac user, closes #333 Reported by: kshetriamrit add gmail dot com Fixed by: Bas van der Vlies * New version of trac agilo has changed the import for ticket model. First try new import statement and as fallback use old one, closes #330 Reported by: sebastian at djangsters dot de Fixed by: Bas van der Vlies * report run_email2trac errors to syslog (LOG_MAIL facility) instead of printf Author: Bas van der Vlies * Support added for Bloodhound project, closes #331 (Not tested) The bloodhound product can be specified by: * command line --> email2trac -B/ --bh_product * email2trac.conf {{{ [email2trac] project: /data/trac/test/project/e2t bh_product: development ..... }}} Author: gary dot martin add wandisco dot com Applied by: Bas van der Vlies 2.7.0 * use self.env.get_read_db for trac version > 0.11. self.env.get_db_cnx is obsolete. TRAC api documentation. Fixed by: Bas van der Vlies * fixed an UnicodeDecodeError when checking attachments filenames. Fixed by: Bas van der Vlies * Added support for installing trac in a virtual environment. You can set a default virtualenv path add configuration time, eg: - ./configure --with-virtualenv=/data/virtualenvs/trac Or set/override at runtime: eg: - ./email2trac.py --virtualenv=/data/virtualenvs/trac Author: Bas van der Vlies & Dennis Stam (Suggestion) * Added support for Trac Agilo installations, closes #316, #306 - email2trac.py -A or email2trac --agilo Author: smcclure add racemi dot com Applied by: Bas van der Vlies 2.6.2 * Removed '--Orignal message---' from strip_signature_regex. It is not a signature but a quote. Thanks to Walter Lioen (SARA) Fixed by: Bas van der Vlies * Added support fot trac 1.0, closes #302, #303 Reported by: thomas dot schabetsberger add webtek dot at Fixed by: Bas van der Vlies 2.6.0 (Dedicated to Ian Verhey (RIP) ) * License changed from GNU Public License to Apache License, Version 2.0. Now the software can be included in Apache projects like bloodhound, closes #292 Requested by: gary dot martin add wandisco dot com * Catch an error when no valid trac installation can be found, closes #294 Reported by: m dot frigui add cacom dot fr Fixed by: Bas van der Vlies * Ticket update honors the reply_all setting and sets the ticket cc field if there are cc-addresses in the email, closes #293 Reported by: Sergey V.Levin Fixed by: Bas van der Vlies * Reporter email address was not skipped and therefor added to cc field when reply_all was set. Author: Bas van der Vlies * Default setting for resolution can only be set in email2trac.conf. Skip the trac default setting, closes #299 Reported by: ruediger dot kupper add gmail dot com Fixed by: Bas van der Vlies * Attachments on Windows are not save due the fact that os.pathconf is not supported. Set filename max length to 240 chars on windows, closes #300 Reported by: Anonymous Fixed by: Bas van der Vlies * Added a new option 'only_strip_on_update', default value is False. Only call the functions strip_quotes and strip_signature for ticket updates, closes #192 Requested by, Patch: Konstantin Ryabitsev Appplied by: Bas van der Vlies * Added a new option 'strip_signature_regex', default value: * strip_signature_regex : ^-----Original Message-----$|^-- $ This will strip signatures form the email messages. People can set their own regular expressions, closes #296, #155 Author: steverweber add gmail dot com Applied by: Bas van der Vlies * email_quote can now handle regular expresions, default is: email_quote : ^> .* We now use the re.match function instead of line.startswith, closes #173 Suggested/Patch by: samuel add hoffstaetter dot com Applied by: Bas van der Vlies 2.5.0 * BLOG improvements by Thomas Moschny, closes #287,#235,#175: - Tries to use the 'Date:' email header to set the date of the blog post or comment. - Allows overriding author and categories via subject parameters or inline properties (see below). - Does not add the 'blog_' prefix to the default (short-) name of a blog entry anymore, as it would be rather redundant. - Allows selecting a custom short name for the blog entry instead of a default date-based short name. The custom short name may not contain spaces. (Note that the TracFullBlogPlugin imposes additional rules for valid short names.) - Bugfix: Fixes crash wile processing mails with attachments (#175). - Properly adds attachments to blog entries (#175). Author: Thomas Moschny Applied by: Bas van der Vlies * Added new parameters: - white_list_registered_users - white_list_file white_list_registered_users: This will allow registered user to create or update a ticket even when they are not added to the 'white_list' in the configuration file. white_list_file: This will read allowed users from a file. One email address per line. Suggested by: randy add psg dot com, closes ticket #288 Author: Bas van der Vlies 2.4.7 * Some blog improvements. Removes 'blog:' from subject line and honors the -n/--dry-run flag, closes #235 Author: Thomas Moschny Applied by: Bas van der Vlies * Added Astaro firewall spam handling. Check X-Spam-Flag and X-Spam-Result message header flags. see: * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=644916 Author: W. Martin Borgert" Applied by: Bas van der Vlies * mailto link contained the wrong encoded subject line, charset was not stripped. Reported by: Walter Lioen (SARA) Fixed by: Bas van der Vlies 2.4.5 * Allow regular expressions for recipient_list (multiple to-addresses), white_list and black_list. Each address is checked againt this regular expression, closes #272 examples: * recipient_list : sara.nl (to-address contains sara.nl) * recipient_list : ^basv@sara.nl$ (to-address equals basv@sara.nl) Reported by: anonymous Fixed by: Bas van der Vlies * Enhanced run_email2trac to support supplementary groups (initgroups). configure will check if the OS support initgroups function call, closes #274 Author: Dennis McRitchie Applied by: Bas van der Vlies * Fixed an error in parsing the From address. Email address was wrong if email name contained a charset definition. There error was triggered if 'mailto_link: 1' is set. Resulting in an unicode error. Author: Bas van der Vlies 2.4.2 * Fixed an error for text/plain attachments that are not specified as inline. These attachments were not attached to the ticket and were skipped, closes #270 Reported by: hju add jochenkuhl dot de Fixed by: Bas van der Vlies * Use all 'to-field' addresses in message for recipient_list instead of only one, closes #268 Reported by: anonymous Fixed by: Bas van der Vlies 2.4.0 * Fixed an error in ticket_update_fields. Always check if given ticket field is a valid ticket field for trac. The error could be triggered by: * ticket_update_by_subject * inline_properties Reported by: Maarten van Ingen (SARA) Fixed by: Bas van der Vlies * Fixed a typo in logging an error: email_to_unicode Fixed by: Bas van der Vlies * Closed tickets for trac version >= 0,12 where not re-opened if there was no workflow defined in email2trac.conf, see #247 Reported by: Sergey V.Levin Fixed by: Bas van der Vlies & Sergey V.Levin * enhanced save_email_for_debug(). Store also the project name in the filename and easily see the difference between the raw message and the body/attachments files. Author: Bas van der Vlies * Ticket update by subject did not work for trac version below 0.12 Reported by: naumann add tu-berlin dot de Fixed by: Bas van der Vlies * Fixed an error in the logging environment for Windows oses, closes #251 Reported by: kofal002 add umn dot edu Fixed by: Bas van der Vlies * Ticket_update_by_subject enhancement. If multiple tickets are found with the same subject then we try a author/reporter match. If fails use most recent ticket entry, closes #253 Reported by: kofal002 att umn dot edu Fixed by: Bas van der Vlies * Log trac error if opening of trac project environment failse, closes #256 Reported by: edward dot b dot matheson at nasa.gov Fixed by: Bas van der Vlies * If a status is using upper case character(s) (i.e waitingExternal) email2trac does not find the appropiate workflow entry in the email2trac.conf, closes #264 Author: hju add jochenkuhl dot de Applied by: Bas van der Vlies * Process all workflows not only the default trac workflow. Workflow is now enabled for new tickets and ticket updates. eg: AdvancedTicketWorkflowPlugin, closes #226,#252 Suggestion by: Holger Jürgs Reported by: Frédéric DUARTE kofal002 att umn dot edu Fixed by: Bas van der Vlies * permission check fails when PrivateTicketsPlugin is installed, closes #262 Reported by: glenn Fixed by: Bas van der Vlies * Added support for trac version 0.13, closes #250 Reported by: simeonov add gmail dot com Fixed by: Bas van der Vlies * Problem with long attachment's filenames on native language. This is a trac bug, see: * http://trac.edgewall.org/ticket/10313, The email2trac solution is to truncate the filename if it is longer then the allow NAME_MAX for the os (usually 255), closes #247. Reported by: Sergey V.Levin Fixed by: Bas van der Vlies & Sergey V.Levin * Replaced printing of subject line to repr() instead of unicode string. Some versions if python logging module could crash, closes #267 Reported by: hju add jochenkuhl dot de Fixed by: Bas van der Vlies 2.1.0 (2011-6-6) * Convert all email addresses and author names to lower case in compare functions. closes #242. Author: Dennis McRitchie Applied by: Bas van der Vlies * Added timestamp when log_file stderr or file is used. Move log level of reporting subject line to info instead of debug, closes #236 Author: Dennis McRitchie Applied by: Bas van der Vlies * Small fix in mailto link. Uses 'cc' instead of 'Cc' Author: Sil Westerveld (SARA) Applied by: Bas van der Vlies * The time format for subject mapping was wrong (ticket_update_by_subject). So all tickets matched. Converted it to use microseconds instead of seconds. Reported by: Walter Lioen (SARA) Author: Bas van der Vlies & Dennis Stam * Fixed an error in the setup the logging environment for Windows oses. Reported by: Mike Henke Author: Bas van der Vlies 2.0.2 (2011-02-13) * Use tempfile.mkstemp instead of tempfile.mktemp Reported by: Dennis Stam (SARA) Author: Bas van der Vlies 2.0.1 (2011-02-12) * An email address can match multiple trac accounts, closes #218 Author: Konstantin Ryabitsev * Added check to detect valid users when smtp_default_domain in trac.ini is set, closes #219 Author: sto add iti dot upv dot es Applied by: Bas van der Vlies with some minor changes * Support for parentdir. Can be used to avoid sections for each project or if all projects have a common parent directory, you can leave out the project directory setting for each project, eg: * parentdir: /data/trac/oss/projects If an section defines a project directory then this can NOT be overridden by the parendir declaration. This closes #217 Author: sto add iti dot upv dot es Applied by: Bas van der Vlies with some minor changes * email2trac: Used the wrong code to check number of ticket changes, closes #223. Author: stas dot agarkov add gmail dot com Applied by: Bas van der Vlies * email2trac: An enhancement to "update-by-subject", closes #188 Features: - Does a better job parsing out all the permutations of "Re: FW: Re: AW: Subject" - Modifies the subject to drop the prefixes Author: Konstantin Ryabitsev Applied by: Bas van der Vlies * When platform is Windows and log_type is not set, use 'eventlog' as default log_type instead of 'syslog', closes #225 Reported by: jkreider add clarkinc dot biz Author: Bas van der Vlies * Applied a patch so we allow more ticket fields to be used for inline properties, eg: - @custom_reports: vu closes #227 Author: thomas dot moschny add gmx dot de Applied by: Bas van der Vlies * Fixed some bugs in function update_ticket_fields: - Can not clear values, reported by thomas dot moschny add gmx dot de closes #228 - Values were updated regardless if there are not allowed for the ticket field. Author: Bas van der Vlies * Attachments without a name where named 'None' instead of 'untitled-part', closes #230 Reported by: hju add jochenkuhl dot de Author: Bas van der Vlies * Fixed some errors in Discussion plugin support, closes #231 Author: Dennis (dmcrxi add Princeton dot EDU) Applied by: Bas van der Vlies * Added html conversion via external command: eg email2trac.conf - html2text_cmd: /usr/bin/html2text -nobs - html2text_cmd: /usr/bin/w3m -dump - html2text_cmd: /usr/bin/lynx -dump - html2text_cmd: /usr/bin/links -dump closes #218 Author: Bas van der Vlies Applied by: Bas van der Vlies * Fixed mailto link for trac 0.11 and 0.12. Use the mailto tag in stead of an html tag. The html tag does not work for trac 0.12 Reported by: Wim Rijks Author: Bas van der Vlies * Added a notification function that always send an email to the reporter if the ticket is updated via email. This independent of trac.ini setting , closes: #178, #229 - notify_reporter: 1 (default: 0) - notify_reporter_black_list : basv@sara.nl (default: 0) Author: hju add jochenkuhl dot de Applied by: Bas van der Vlies * Added a new parameter for processing inline properties: (closes #216) - inline_properties_first_wins: 1 (default: 0) When an email has two of the same inline entries: {{{ @status: closed @status: accepted }}} Only the first one is used '@status: closed' Author: Konstantin Ryabitsev Applied by: Bas van der Vlies 1.6.0 (2010-8-10) * Fixed an Unicode error in strip_quotes Author: Bas van der Vlies * The attachment filename may not contain '\n' and '\r' characters. Reported by: Jean-Paul Duyx Fixed by; Bas van der Vlies * Applied a patch to support workflow for all transitions. It will also honour the permission model if set, closes #198 an example how to use it: email2trac.conf: [project] workflow_closed: reopen xworkflow_infoneeded: provideinfo trac.ini: [ticket-workflow] reopen = closed -> reopened reopen.permissions = TICKET_CREATE reopen.operations = del_resolution provideinfo = infoneeded -> moreinfo provideinfo.permissions = TICKET_CREATE provideinfo.name = info provided Authors: kroseneg add schmidham dot net and Bas van der Vlies * The trac default value for resolution is fixed. The trac.ini value for this is skipped and this resolution settings is only allowed in email2trac.conf, closes #84 Reported by: hju add jochenkuhl dot de Fixed by: Bas van der Vlies * Honor the trac permission model if set, Use TICKET_APPEND and TICKET_CHGPROP instead of TICKET_MODIFY. closes #214 Reported by: Konstantin Ryabitsev Fixed by: Bas van der Vlies 2010-07-23 * logging of spam message was wrong. Fixed it, - set.logger.info must be self.logger.info Author: Bas van der Vlies * logging of notification error was wrong. Fixed it, closes #212 - set.logger.error must be self.logger.error Reported by: adam dot lucke at srd-berlin dot de Author: Bas van der Vlies * Mail was lost when 'ticket_update' was disabled and a ticket reply was detected. Author: Bas van der Vlies * Removed a lot of obsolete code due to using UserDict Author: Bas van der Vlies 2010-07-21 * added a new option 'ticket_permission_system'. Can be set to: - trac: Then it will check if the report has the right trac permission to create or modify a ticket. closes #202 - update_restricted_to_participants: A ticket update is allowed only if: 1) the updater is the reporter, 2) the updater is in the CC 3) the updater has trac permission to update the ticket. If the update is denied, a new ticket will be generated instead as to not loose the issue . closes #203 Authors: kris add tsampa dot org & Bas van der Vlies * Switch for logging to the python logging module and add some new options to control the behaviour inspired by the trac logging module: - log_type, default syslog - log_level, default info - log_format, email2trac - log_file, none Can be set to the same values as trac logging Author: Bas van der Vlies * removed trac 0.9 support 2010-07-12 * Do not check if notification is enabled, let Trac determine if a notfication is enabled and which interface/plugin is used, eg: announcerplugin Author: Bas van der Vlies 2010-07-06 * Fixed several errors in ticket update: - Changed the regex expression. It must end with ':'. - The email was lost if the ticket id was unknown. If ticket id is unknown a new ticket will be created. Reported by: SARA grid team Fixed by: Bas van der Vlies 2010-06-28 * Ticket update for version 0.12 did not work, closes #209 Author: mark underscore kids add yahoo dot com Applied by: Bas van der Vlies * enabled workflow and notification for trac version 0.12 Author: Bas van der Vlies 2010-06-23 * A better fix for attachments with special characters, closes #206 Reported by: karsten dot rohrbach add wibas dot de Fixed by: Bas van der Vlies 2010-06-22 * When debug is enabled email2trac chokes on non-ascii (utf8) characters in ticket fields, closes #205 Reported by: eirik dot schwenke add nsd dot uib dot no Fixed by: Bas van der Vlies * Email2trac crashes when attachment filename contains non-ascii characters, closes #206 Reported by: karsten dot rohrbach add wibas dot de Fixed by: Bas van der Vlies 2010-06-09 * Support added for trac version 0.12, closes #201 Reported by: mark_kids add yahoo dot com Fixed by: Bas van der Vlies 2010-05-25 * delete_spam still used the trac_version in email2trac.comf Fixed by: Bas van der Vlies * email2trac crashed when ticket_update_by_subject was enabled. Fixed by: Bas van der Vlies 2010-05-20 * email2trac crashed if there are '/' and '\' characters in a filename. These characters are now being replace by '_', closes #196 Reported by: jcuppen add hethooghuis dot nl Fixed by: Bas van der Vlies * Problems with attachments were not reported for ticket updates Fixed by: Bas van der Vlies * delete_spam changes: - only support trac version greater then 0.10 - added -n/--dry-run option - added -v/--verbose option Author: Bas van der Vlies * Enhancement for ticket prefixes (email2trac.conf). The ticket fields status and resolution are not forbidden any more. closes #195 Author: Konstantin Ryabitsev Applied by: Bas van der Vlies * Added a new option. It is all in the name: * ticket_update_by_subject, default value is off * ticket_update_by_subject_lookback, default 30 days When this option is enabled and there is no ticket number found in a reply mail. It will try to find a ticket summary that matches the mail subject line. If found then append the mail to this ticket, closes #188 Author: Konstantin Ryabitsev & Bas van der Vlies Applied by: Bas van der Vlies * Added DiscussionPlugin support, closes 197. For description see: - https://trac-hacks.org/wiki/DiscussionPlugin Author: ibarton add fit dot vutbr dot cz (alias Blackhex) Applied by with some modification: Bas van der Vlies * Trac version is now automatically determined. No need anymore for trac_version in /etc/email2trac.conf Author: Bas van der Vlies 2010-03-20 * Fixed a bug reporter was always set to the default value specified in trac.ini. Reported by: Jean-Paul Duyx Fixed by: Bas van der Vlies * If reported field is overriden then use it for all trac functions including notification, closes #187 Reported by: shildebrand at venturebeat dot com Fixed by: Bas van der Vlies 2010-03-24 * Added configure option '--with-install_user=', default user is 'root'. The specified user is used for installation so we can install the package as non-root user, closes #182. Reported by: shildebrand at venturebeat dot com Fixed by: Bas van der Vlies * Re-arranged some code so that we can override ticket fields in email2trac.conf, eg: - default_reporter : email2trac Will set the reporter ticket field to email2trac for all mail, closes #182 Reported by: shildebrand at venturebeat dot com Fixed by: Bas van der Vlies * Fixed a bug when there is no subject field in the message, closes #179 The fix in the 1.2.0 version did not work. Reported by: xurizaemon and John Donners (SARA) Fixed by: Bas van der Vlies * We do not write any files when dry run mode is enabled. Fixed by: Bas van der Vlies * Fixed several issues when DEBUG is enabled with printing non-ascii characters, see #184 Reported by: hju add jochenkuhl dot de Fixed by: Bas van der Vlies 2010-02-24 * Added an option to run_email2trac to set the PYTHON_EGG_CACHE environment variable (-e|--eggcache), closes #174 Author: pepl at cpan dot org Applied by: Bas van der Vlies * Ticket fields can be set inline an email: closes #171, #88 - controlled by parameter 'inline_properties', default behaviour off - see https://subtrac.sara.nl/oss/email2trac/wiki/Email2tracParse#Updateticketfields Author: samuel at hoffstaetter dot com Applied by: Bas van der Vlies * Fixed a bug when there is no subject field in the message, closes #179 Reported by: xurizaemon Fixed by: Bas van der Vlies * Added unicode support attachment filenames, closes #177 Reported by: obwandner add concertare dot de Fixed by: Bas van der Vlies * Email to blog did not work at all. It works but it can not handle attachments. see #175. Reported by: oland dot wells add gmail.com Patches : Bas van der Vlies * Show errors when we can not include attachments in the ticket, see #165 Requested by: hju add jochenkuhl dot de and dereks add cool-st dot com Fixed by: Bas van der Vlies * Added a new option 'email_triggers_workflow'. When a ticket is closed and an update is received via email. The ticket will be reopened or triggers a ticket workflow. This action can be skipped if we set the email_triggers_workflow option to 0. The default value is 1, closes #180 Author: zac add sprackettd dot com Applied by: Bas van der Vlies 2010-01-11 * Workflow option did not work, closes #157 Reported by: thomas dot moschny at gmx dot de Fixed by: Bas van der Vlies & Thomas Moschny * When a ticket is updated via email. We must set a changelog id, closes #156 Reported by: Chris dot Nelson at SIXNET dot com Fixed by: Bas van der Vlies * Changed all 'str =' assignments to 's =' to solve conflicts with the builtin str function Fixed by: Bas van der Vlies * Python egg cache enviroment setting was ignored by email2trac. closes #163 Author: Dennis McRitchie ( dmcr at Princeton dot EDU ) Applied by: Bas van der Vlies * Disabled code so the following line will not be displayed anymore as comment in a ticket: - This message has x attachment(s) Suggested by: dereks at realloc dot net, closes ticket #165 Fixed by : Bas van der Vlies * Added a new parameter strip_content_types. So we can strip attachments based on content type, eg: - strip_content_types: application/pgp-signature, application/mac-binhex40 Will strip attachments that has these content_types. Authors: otto at bergerdata dot de and Bas van der Vlies * FIxed an error when files where added with characters that needed to be escaped. Both email2trac and trac escaped the filenames. We removed the code from email2trac an let trac handle the escaping, closes #149 Reported by: hju att jochenkuhl dot de Fixed by: Bas van der Vlies * Added a new parameter: - subject_field_separator, default value is & This is used to set tickets fields via the subject line. It used to be , .For backwards compatibility we introduced this parameter. closes #166 Suggested by: Dennis McRitchie ( dmcr at Princeton dot EDU ) Fixed by : Bas van der Vlies * Prevent mail loop. We could set the CC ticket field to the ticket email address. - For a new ticket and reply_all is set. - If the ticket CC field is updated via the subject line. Also prevent setting the reporter address to the ticket email address. closes #172 Reported by: otto at bergerdata dot de Fixed vy : Bas van der Vlies 2009-09-02 * Implemented a new feature to drop the HTML version of multipart/alternative message part. Such a message part contains the same info. The info is sent in different formats and the client can decide which version to use. closes #30 to enable in email2trac.conf: - drop_alternative_html_version: 1 Implemented by: Bas van der Vlies 2009-08-20 * updated aclocal.m4 to support python versions 2.5 and 2.6, closes #137 * use the email addres in the reporter field, closes #136 * Fixed an error in blog update function All Fixes by: Bas van der Vlies * if alternate notify template is set then also set ticket id. It will show up as ticket change, closes #142 Reported by: hju att jochenkuhl dot de Fixed by: Bas van der Vlies * Error in urllib.quote(filename) could not handle unicode filenames, closes #138 Reported by: debacle at debian dot org Applied by: Bas van der Vlies * Fixed an error when debug is on and the body message contains unicode strings, closes #144 Reported by: trumbitta at gmail dot com Applied by: Bas van der Vlies * default trac version for email2trac is now updated to 0.11 2009-04-09 * Fixed in parsing the reflow parameter, closes #123 Reported by: tomasz dot sterna at sensisoft dot com Fixed by: Bas van der Vlies * implemented workflow for tickets that are reopend, closes #70 Reported by: hju att jochenkuhl dot de Author by: Bas van der Vlies * added FullBlogPlugin support. So we can update/create the blogs via email, #116 mail with subject line: will create/update a blog entry. Authors: Bas van der Vlies & lucas dot eisenzimmer at t-systems-mms dot com * email2trac require at least python version 2.4, closes #131 Reported by: otto at bergerdata dot de Fixed by: Bas van der Vlies * We can now set ticket fields for a new ticket via the 'subject' line: - Subject: #?[,]* closes #130 Requested by: Steve Implemented by: Bas van der Vlies 2009-01-30 * applied patch exit with non-zero return code on failure, closes #117 Author: admin-egon at ikw dot uos dot de Applied by : Bas van der Vlies * Ticket update with attachments did not work, closes #120 Reported by: Alexander Verkooijen (alexander at sara dot nl) Fixed by: Bas van der Vlies * Removed obsolete code Author : Bas van der Vlies * When email address is known then the author name and email address is used from the preference tab. The match is case insensitive, closes #118 Reported by: Pusateri, Matthew (default: 0) mail_quote: (default: "> ") Author: nicolasm @ opera dot com Implemented by: Bas van der Vlies * Added patch to make notify email work with trac 0.11 dev. Author: tbaschak add ktc dot mb dot ca Author: andrei2102 add gmail dot com Implemented by: Bas van der Vlies * greedy matching in Subject line, We must stop after the first ':' else we get wrong values for ticket fields when we update a ticket via mail, closes ticket #37 Reported by: dmaziuk at bmrb dot wisc dot edu Fixed by: Bas van der Vlies * added IGNORECASE flag to regular expression for black list. This is a quick fix, still want to implement this as configuration option, closed bug #39 Reported By: jodok at lovelysystems dot com Fixed by : Bas van der Vlies * When a known user mails a ticket. We will set the Reporter to its login name, closes bug #33, #41 Also add configuration option: ignore_trac_user_settings : 0 (default value) This option will skip the email address to trac user login name mapping. Reported by: anonymous Fixed by : Bas van der Vlies * SPAM detection was only for new mails not for ticket updates, closed ticket #44 Reported by: Bas van der Vlies Fixed by : Bas van der Vlies 2007-07-18 * Implemented python_egg_cache environment variable. Some trac installations may depend on it, closes ticket #10, eg: python_egg_cache : /var/cache/eggcache Reported By: Anonymous Fixed by : Bas van der Vlies * Implemented update ticket fields via email subject line, eg: Re: [email2trac] #7?owner=bas,priority=minor: Error in parsing - Sets the owner of the ticket to: bas - Sets the priority of the ticket to: minor For some ticket fields there are only a limited number of allowed values. The supplied value will be checked against this list. If it is not vaild value the field update will be ignored. Requested by : trac at yadan dotnet, Jan Parchmann, see ticket #7 Implemented by: Bas van der Vlies * Dropped support for version trac version 0.8. Removed all 0.8 specific code. Fixed by: Bas van der Vlies * Added a new config parameter: tmpdir: /var/tmp, default is '/tmp' All functions now use this new parameter and use OS independent path functions. Implemented by: Bas van der Vlies * fixed and a creating directory problem email2trac.spec file Fixed by: artrus at netzero dot net * set_owner function is obsolete. When component is set the trac code will set the owner to the component owner. Fixed by : Bas van der Vlies * Also show email headers in a ticket update. Requested by: Ramon Bastiaans Fixed by : Bas van der Vlies * A date patch so it works with trac version 0.11 for ticket updates. Also applied for other trac versions. Thanks to: tbaschak at ktc dot mb dot ca 2007-04-27 * Added check to catch an error when attachment size is too large, bug #1153 Author: Bas van der Vlies * Wrap long line into user given length, use_textwrap: 72. Wraps lines greater then 72 chars, #1123 Author: Bas van der Vlies & Rainer Sokoll (r.sokoll at intershop dot de) * Fixed a dutch spelling, #1295 Author: Rainer Sokoll (r.sokoll at intershop dot de) * email2trac.py : blacklist (don't create ticket) mail from MAILER-DAEMON to avoid loops Author: Michel Jouvin * msg.bad.txt : add an example of message from MAILER-DAEMON Author: Michel Jouvin 2006-12-08 * email2trac.py: - Added verbatim_format option default is: 1 Added by : Bas van der Vlies - Added strip_signature option default is: 0 Added by : Bas van der Vlies - Fixed some unicode errors, thanks to japanes SPAM. If we can not unicode email message then display which charset must be installed in ticket description. Else we trac crashed with unicode errors ;-( Fixed by: Bas van der Vlies - Fixed statements: str + unicode, raises an exception if non-ascii value in unicode object. - Forgot to unicode the author. So we got an error if we use the mailto_link option in email2trac.conf. Fixed by: Bas van der Vlies * delete_spam.py: - Now works for version 0.10 with new API-functions Fixed by: Bas van der Vlies * Makefile.in - Added install-conf. Install email2trac.conf if there is none installed. Fixed by: Bas van der Vlies 2006-10-27 * run_email2trac.c. - Setgid() must be called before setuid(). Reported by: Anonymous Fixed by: Bas van der Vlies * email2trac.py, - Fixed an error in Ticket Update. When ticket does not exists, proceed as if it is a new ticket Fixed by: Bas van der Vlies - Fixed a strang bug in 0.9 version, if ticket update is enabled and email has attachment(s). We are not allowed to set the description and author field of the attachment else the comment text is lost ;-( Fixed by: Bas van der Vlies - Fixed an error if enable_syslog and drop_spam is set. We get an exception in the syslog if we use sys.exit(0), replaced by return. Fixed by: Bas van der Vlies * delete_spam.py. - Trac version 0.10 made it easier to delete tickets. Fixed by: Bas van der Vlies 2006-10-10 * Fixed race conditions in delete_spam.py and added some debug code. Fixed by : Bas van der Vlies * Added author and description field when attachment is added to ticket. This is for trac version greater than 0.8. Fixed by : Bas van der Vlies Thanks to Matthew Good for the hint * Added drop_spam option, default = 0. If set then mail marked as Spam is not accepted. Added by : Bas van der Vlies * Do not send notification if message is marked as Spam and drop_spam is not set. Fixed by : Bas van der Vlies 2006-10-02 * Fixes possible segmentation faults in run_email2trac.c Reported by: bcornec Fixed by : Bas van der Vlies * Can set DEBUG level while configuring package, eg: DEBUG=1 ./configure ( default : 0) Reported by: syd at plug dot ca Fixed By : Bas van der Vlies * delete_spam.py did not delete everything from the SQL tables Reported by: brent at rcfile dot org Fixed by : Bas van der Vlies * Do not send notification when message is marked as Spam Fixed by : Bas van der Vlies 2006-08-28 * fixes an error in the 'reply_all' setting Thanks to and Patch by: ncarlson@ibsys.com * Added RPM spec file Thanks to: Jon Topper 2006-07-14 * Use X11R5 install-sh to install email2trac components to hide native install program differences. Author: Michel Jouvin * Fixed an error in saving attachments for new tickets for trac versions greater then 0.9. Fixed by: Bas van der Vlies * When something went wrong save the offending email for debug purposes. Fixed by: Bas van der Vlies * delete_spam.py - did not clean up the attachment table. So we got nasty new mails with fake attachments. - It works now for versions higher then 0.8 * Finally understand the unicode/encode functions and hopefully fixed the errors. Fixed by: Bas van der Vlies * Remove the temporarly created attachment files. Fixed by: Bas van der Vlies 2006-07-06 * Fixed an error in already added attachments. Do not close the database connection. Fixed by: Walter de Jong en Bas van der Vlies * Added enable_syslog option. If enabled log errors to syslog instead of stderr. If enabled no errors are send back to the user. Implemented by: Bas van der Vlies * Fixed an error with updating tickets with attachments for trac versions 0.9 and 0.10. Field "id" is not known when a existing ticket is fetched (Error = KeyError: 'id') Fixed By: See tickets #258 and #449 on trac-hacks * Fixed and spell error, self.mail_addr must be self.email_addr Fixed by: Bas van der Vlies * Catch a LookupError in unicode/encode conversion in function get_body_text() Fixed by: Bas van der Vlies * Description field was always changed when updating the ticket via the web. Asked the mailing list for a solution and got one ;-) Patch/Suggestion by: Christian Boos Applied by: Bas van der Vlies * Fixed an encoding problem when email_header is set to 1 Fixed by: Bas van der Vlies * Fixed a bug in to_unicode() function. Fixed by: Bas van der Vlies * Fixed an unicodedata.normalize TypeError bug for filenames in the attachment function Fixed by: Bas van der Vlies 2006-06-02 * Added ticketing merging. To enable it there are two options for both options enable 'ticket_update' in email2trac.conf 1 - Configure trac notification, eg: * (ticket address: ticket@test.nl) [notification] smtp_enabled = true smtp_always_cc = test@test.nl smtp_server = localhost smtp_from = ticket@test.nl always_notify_reporter = true 2 - Use the mailto_cc in email2trac.conf if you want to sent an email to the user and the trac ticket email address. With both options you get the right format of the subject line. * Use the short options for the install command. So it works for MacOSx Reported by: Nathaniel Irons. * Updated inline documentation by Nathaniel Irons. 2006-05-16 * Fixed a bug when there was no plain text body. Reported by: Greg Deakyne * Fixed a small bug if default component owner is unknown. Just fill in some bogus info. * Use the short options for the install command. So it works for MacOSx Reported by: Nathaniel Irons * Messages that has X-Virus-found in header are marked as SPAM Implemented by: Walter de Jong * Some modules are changed for version 0.10, Added and made some minor changes: Patch supplied by: Markus Tacker * Ported delete_spam.py to version 0.9 and higher: Reported by: Nathaniel Irons 2006-03-08 - Fixed an bug for 0.9, there was a space in front of the ' ticket' directory. removed it. Reported by: mi-trachacks@moensolutions.com Fixed by: Bas van der Vlies * Fixed an exception error in delete_spam.py when shutil has not enough priveledges to remove the attachments it is reported Fixed by: Bas van der Vlies * email2trac.py: When you include the body tag, some mailers (like Thunderbird) will leave out the signature. Therefore this version leaves out the body tag. Fixed by: Walter de Jong * Added msg.txt for testing Fixed by: Bas van der Vlies 2006-02-01 Bas van der Vlies : * Added Tikcet notification, send email when there is a new ticket. Depends on notification setting in trac.ini. Implemented by: Kilian Cavalotti * Can use different template for ticket notification, eg: alternate_notify_template: "a_tkt.css" Implemented by: Kilian Cavalotti * Added reply_all config parameter. If set put all CC-addresses from orginal mail in ticket CC-field. Suggested by: Kilian Cavalotti * Text in ticket description is also properly UTF-8 encoded Implemented by: Kilian Cavalotti * Removed reply_address from config file. Is not necessary anymore. See Ticket notification. * Added support for known users. If email address is known then use the trac known username instead of the email-address (only for trac version > 0.9) Implemented by: Kilian Cavalotti * Fixed an error in saving attachments for version < 0.9. Sometimes we got bogus attachments. Fixed by: Walter de Jong * Added support to make an debian package Implemented by: Bas van der Vlies 2006-01-21 Bas van der Vlies : * Fixed run_email2trac.c, did not work * Added TRAC_SCRIPT_NAME to Makefile.in to solve run_email2trac problem Both errors reported by: kilian.cavalotti@lip6.fr 2006-01-20 Bas van der Vlies : * A warning error is fixed by kilian.cavalotti@lip6.fr * Several errors in make install ;-(, reported by tacker 2006-01-15 Bas van der Vlies : * Added configure script. 2006-01-10 Bas van der Vlies : * Removed project_root from source and config file * Adjust code so we can use mulitple stanza's in config file, eg: [bas] project: /data/trac/bas spam_level: 3 use option "-p|--project bas" to select the stanza 2006-01-04 Bas van der Vlies : * Fixed getopt for -f option * Added suppport for different TRAC versions (0.8 and 0.9) 2006-01-03 Michel Jouvin * email2trac.py (ReadConfig) : allow project name relative to project root in configuration file * email2trac.py (TicketEmailParser.parse): save entire email for debugging only if debug >= 2 * run_email2trac.c: pass wrapper arguments to Python script, filtering out --file * email2trac.py (TicketEmailParser.debug_attachments): set tmp file created for debugging writable by anybody (to avoid problem if the script is run with a different uid during tests) * email2trac.py (TicketEmailParser.parse): set tmp file created for debugging writable by anybody (to avoid problem if the script is run with a different uid during tests) 2005-12-22 Michel Jouvin * Makefile: add a Makefile to build and install email2trac * email2trac.py: migrate to Trac 0.9 API 2005-12-21 Michel Jouvin * run_email2trac.c: add error messages if DEBUG macro defined * run_email2trac.c: add error testing and specific return values for each error * run_email2trac.c: Move site specific paramaters to run_email2trac.h * run_email2trac.h: include file to define site specific paramaters 0.2.4 01/11/2005 Added email_header option if set then show TO/CC fields in description of the ticket. Fixed an error in the mailto URL. This was an old error that supposed to be fixed but reoccured in this version. 0.2.3 31/10/2005 Fixed a bug with base64 encoded attachments/emails Fixed by: Walter de Jong 0.2.2 10/10/2005 according to RFC 2368 (titled "the mailto URL scheme") the mailto URL can only work with short &body messages. It fails with long messages and the link won't work. Therefore the mail body is no longer copied into the mail reply. 0.2.1 10/07/2005 body of reply email looks better 0.2 10/07/2005 mailto is replaced by a html mailto to line. If you reply to the ticket via this link then an email client is started with some default values: To: Subject: Re: Body: email_comment email2trac.conf: email_comment: # (default: >) email2trac-2.10.0/INSTALL0000644007443000744420000000016113012622127012751 0ustar basbas= Installation and Configuration of email2trac = See for installation: https://subtrac.sara.nl/oss/email2trac email2trac-2.10.0/LICENSE0000644007443000744420000002613613012622127012737 0ustar basbas Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. email2trac-2.10.0/Makefile.in0000644007443000744420000000251613012622127013773 0ustar basbas# Authors: Bas van der Vlies & Michel Jouvin # Date : 13 Jan 2005 # Desc. : Simple Makefile # # SVN INFO: # $Id$ # # prefix=@prefix@ EXEC_PREFIX=@exec_prefix@/bin PYTHON_BIN=@PYTHON@ CONFIG=@sysconfdir@ # User names # TRAC_USER=@trac_user@ MTA_USER=@mta_user@ INSTALL_USER=@install_user@ DEBUG=@DEBUG@ TRAC_SCRIPT_NAME=email2trac CC=@CC@ INSTALL=./install-sh CFLAGS=-DMTA_USER=\"$(MTA_USER)\" -DTRAC_USER=\"$(TRAC_USER)\" -DTRAC_SCRIPT_NAME=\"$(TRAC_SCRIPT_NAME)\" -DTRAC_SCRIPT_PATH=\"$(EXEC_PREFIX)\" -DDEBUG=$(DEBUG) PYTHON_FILES=delete_spam.py email2trac.py WRAPPER_SRC=run_email2trac.c run_email2trac.h all: run_email2trac run_email2trac: $(WRAPPER_SRC) Makefile $(CC) $(CFLAGS) -o $@ run_email2trac.c install: all install-conf $(INSTALL) -d $(DESTDIR)$(EXEC_PREFIX) for script in $(PYTHON_FILES) ; \ do \ name=`basename $$script '.py'` ;\ $(INSTALL) -m 755 -o $(INSTALL_USER) $$script $(DESTDIR)$(EXEC_PREFIX)/$$name ;\ done $(INSTALL) -m 4111 -o $(INSTALL_USER) run_email2trac $(DESTDIR)$(EXEC_PREFIX) install-conf: if [ ! -f $(DESTDIR)/$(CONFIG)/email2trac.conf ] ; \ then \ $(INSTALL) -c -m 644 -o $(INSTALL_USER) email2trac.conf $(DESTDIR)/$(CONFIG)/email2trac.conf ;\ fi clean: rm run_email2trac distclean: rm run_email2trac email2trac.py delete_spam.py config.log config.status Makefile config.h email2trac-2.10.0/NOTICE0000644007443000744420000000025013012622127012623 0ustar basbas email2trac is released under the Apache License, Version 2.0. Copyright 2002 SURFsara This product includes software developed at SURFsara (http://www.surfsara.nl) email2trac-2.10.0/README0000644007443000744420000000151513012622127012604 0ustar basbasemail2trac - utilities ---------------------- This is a release of the SURFsara package email2trac that contains utilities that we use to convert emails to trac tickets. The initial setup was made by Daniel Lundin from Edgewall Software. SURFsara has extend the initial setup, with the following extensions: - HTML message conversion - Attachments - Tickets can be updated via email - Use command-line options - Configuration file to control the behavior. - Unicode support - SPAM detection - Workflow support - FullBlogPlugin support - DiscussionPlugin support See INSTALL for the how to setup the utilities Documentation is available at: - https://oss.trac.surfsara.nl/email2trac Comments or Suggestions mail them to: email2trac http://www.surfsara.nl for more info about SURFsara.email2trac-2.10.0/aclocal.m40000644007443000744420000002212413012622127013563 0ustar basbas# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(too old)]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) email2trac-2.10.0/config.h.in0000644007443000744420000000130513012622127013744 0ustar basbas/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Full path for the system-wide email2trac.conf file. */ #undef SYSTEM_EMAIL2TRAC_CONF email2trac-2.10.0/configure0000755007443000744420000040741113012622127013640 0ustar basbas#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="email2trac.py.in" ac_subst_vars='LTLIBOBJS LIBOBJS SYSTEM_EMAIL2TRAC_CONF email2trac_conf DEBUG EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC pkgpyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON virtualenv install_user mta_user trac_user pyexecdir target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_install_user with_trac_user with_mta_user with_virtualenv ' ac_precious_vars='build_alias host_alias target_alias PYTHON CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-install_user=USER Specify the name of the user that we must use for installation, default=root --with-trac_user=USER Specify the name of the user that trac use, default=www-data --with-mta_user=USER Specify the name of the user that your MTA use, default=nobody --with-virtualenv=path Specify the default virtualenv path to use for trac, default="" Some influential environment variables: PYTHON the Python interpreter CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" #DEBUG=0 #AM_PATH_PYTHON if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.4" >&5 $as_echo_n "checking whether $PYTHON version >= 2.4... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.4'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "too old" "$LINENO" 5 fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.4" >&5 $as_echo_n "checking for a Python interpreter with version >= 2.4... " >&6; } if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.4'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi if test "x$DEBUG" = "x";then DEBUG=0 fi # What user must be used for installation (default: root) # # Check whether --with-install_user was given. if test "${with_install_user+set}" = set; then : withval=$with_install_user; case "${withval}" in *) install_user="${withval}" ;; esac else install_user="root" fi # Now a user can specify the TRAC user # # Check whether --with-trac_user was given. if test "${with_trac_user+set}" = set; then : withval=$with_trac_user; case "${withval}" in *) trac_user="${withval}" ;; esac else trac_user="www-data" fi # Now a user can specify MTA TRAC user # # Check whether --with-mta_user was given. if test "${with_mta_user+set}" = set; then : withval=$with_mta_user; case "${withval}" in *) mta_user="${withval}" ;; esac else mta_user="nobody" fi # We can specify a default virtual env path for trac # # Check whether --with-virtualenv was given. if test "${with_virtualenv+set}" = set; then : withval=$with_virtualenv; case "${withval}" in *) virtualenv="${withval}" ;; esac else virtualenv="" fi if test "$sysconfdir" = '${prefix}/etc'; then if test "x$prefix" = xNONE; then email2trac_conf="$ac_default_prefix/etc/email2trac.conf" else email2trac_conf="$prefix/etc/email2trac.conf" fi else email2trac_conf="$sysconfdir/email2trac.conf" fi cat >>confdefs.h <<_ACEOF #define SYSTEM_EMAIL2TRAC_CONF "$email2trac_conf" _ACEOF for ac_func in initgroups do : ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups" if test "x$ac_cv_func_initgroups" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INITGROUPS 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile email2trac.py delete_spam.py" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "email2trac.py") CONFIG_FILES="$CONFIG_FILES email2trac.py" ;; "delete_spam.py") CONFIG_FILES="$CONFIG_FILES delete_spam.py" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi email2trac-2.10.0/configure.in0000644007443000744420000000471613012622127014243 0ustar basbas# # Author: Bas van der Vlies # Desc. : Simple configure script for email2trac package # SVN INFO: # $Id$ # # AC_INIT(email2trac.py.in) AC_CONFIG_HEADER(config.h) AC_SUBST(prefix) AC_SUBST(exec_prefix) AC_SUBST(pyexecdir) AC_SUBST(trac_user) AC_SUBST(mta_user) AC_SUBST(install_user) AC_SUBST(sysconfdir) AC_SUBST(virtualenv) #DEBUG=0 #AM_PATH_PYTHON AM_PATH_PYTHON(2.4) AC_PROG_GCC_TRADITIONAL if test "x$DEBUG" = "x";then DEBUG=0 fi AC_SUBST(DEBUG) # What user must be used for installation (default: root) # AC_ARG_WITH(install_user, [ --with-install_user=USER Specify the name of the user that we must use for installation, default=root], [case "${withval}" in *) install_user="${withval}" ;; esac], [install_user="root"] )dnl # Now a user can specify the TRAC user # AC_ARG_WITH(trac_user, [ --with-trac_user=USER Specify the name of the user that trac use, default=www-data], [case "${withval}" in *) trac_user="${withval}" ;; esac], [trac_user="www-data"] )dnl # Now a user can specify MTA TRAC user # AC_ARG_WITH(mta_user, [ --with-mta_user=USER Specify the name of the user that your MTA use, default=nobody], [case "${withval}" in *) mta_user="${withval}" ;; esac], [mta_user="nobody"] )dnl # We can specify a default virtual env path for trac # AC_ARG_WITH(virtualenv, [ --with-virtualenv=path Specify the default virtualenv path to use for trac, default=""], [case "${withval}" in *) virtualenv="${withval}" ;; esac], [virtualenv=""] )dnl dnl ##### Path to email2trac.conf dnl This ugly kludge to get the sysconfdir path is needed because dnl autoconf doesn't actually set the prefix variable until later. if test "$sysconfdir" = '${prefix}/etc'; then if test "x$prefix" = xNONE; then email2trac_conf="$ac_default_prefix/etc/email2trac.conf" else email2trac_conf="$prefix/etc/email2trac.conf" fi else email2trac_conf="$sysconfdir/email2trac.conf" fi AC_DEFINE_UNQUOTED(SYSTEM_EMAIL2TRAC_CONF, "$email2trac_conf", [Full path for the system-wide email2trac.conf file.]) AC_SUBST(email2trac_conf) AC_SUBST(SYSTEM_EMAIL2TRAC_CONF) dnl ##### Check for presence of initgroups() function AC_CHECK_FUNCS([initgroups]) AC_OUTPUT( Makefile email2trac.py delete_spam.py ) email2trac-2.10.0/debian/0000755007443000744420000000000013012623076013150 5ustar basbasemail2trac-2.10.0/debian/changelog0000755007443000744420000006746213012622127015040 0ustar basbasemail2trac (2.10.0-1) UNRELEASED; urgency=low * See Changelog -- Bas van der Vlies Tue, 15 Nov 2016 16:04:34 +0100 email2trac (2.9.1-2) UNRELEASED; urgency=low * See Changelog -- Bas van der Vlies Mon, 21 Mar 2016 10:50:51 +0100 email2trac (2.9.1-1) UNRELEASED; urgency=low * See Changelog -- Bas van der Vlies Mon, 21 Mar 2016 10:15:35 +0100 email2trac (2.9.0-2) UNRELEASED; urgency=low * See Changelog -- Bas van der Vlies Mon, 19 Oct 2015 11:52:35 +0200 email2trac (2.8.9-1) UNRELEASED; urgency=low * See Changelog -- Bas van der Vlies Tue, 28 Apr 2015 10:44:27 +0200 email2trac (2.8.8-1) UNRELEASED; urgency=low * See Changelog -- Bas van der Vlies Tue, 28 Apr 2015 08:55:36 +0200 email2trac (2.8.7.1) UNRELEASED; urgency=low * see Changelog -- Bas van der Vlies Fri, 24 Apr 2015 23:01:58 +0200 email2trac (2.8.6.1) UNRELEASED; urgency=low * See Changelog -- Bas van der Vlies Mon, 26 Jan 2015 16:40:17 +0100 email2trac (2.8.4-1) stable; urgency=low * See Changelog -- Bas van der Vlies Tue, 08 Apr 2014 10:01:51 +0200 email2trac (2.8.0-1) stable; urgency=low * See Changelog -- Bas van der Vlies Thu, 09 Jan 2014 12:47:59 +0100 email2trac (2.7.6-1) stable; urgency=low * See Changelog -- Bas van der Vlies Fri, 20 Sep 2013 11:45:29 +0200 email2trac (2.7.5-1) stable; urgency=low * See Changelog -- Bas van der Vlies Fri, 13 Sep 2013 12:13:24 +0200 email2trac (2.7.4-1) stable; urgency=low * See Changelog, bug fixes -- Bas van der Vlies Thu, 15 Aug 2013 16:29:55 +0200 email2trac (2.7.0-2) stable; urgency=low * See Changelog -- Bas van der Vlies Mon, 17 Jun 2013 21:16:32 +0200 email2trac (2.6.3-1) stable; urgency=low * See Changelog -- Bas van der Vlies Wed, 03 Oct 2012 13:44:57 +0200 email2trac (2.6.2-1) stable; urgency=low * Removed --Orignal message--- from strip_signature_regex. It is not a signature but a quote. Thanks to Walter Lioen (SARA) * See Changelog -- Bas van der Vlies Fri, 21 Sep 2012 15:49:35 +0200 email2trac (2.6.0-2) stable; urgency=low * See Changelog -- Bas van der Vlies Thu, 30 Aug 2012 15:59:52 +0200 email2trac (2.6.0-1) stable; urgency=low * New Release 2.6.0, See Changelog -- Bas van der Vlies Tue, 31 Jul 2012 14:44:14 +0200 email2trac (2.5.0-2) stable; urgency=low * New release 2.5.0, see ChangeLog -- Bas van der Vlies Mon, 06 Feb 2012 12:02:58 +0100 email2trac (2.4.7-1) stable; urgency=low * New release 2.4.7, see ChangeLog -- Bas van der Vlies Mon, 02 Jan 2012 09:41:19 +0100 email2trac (2.4.6-2) stable; urgency=low * See Changelog -- Bas van der Vlies Tue, 06 Dec 2011 16:38:49 +0100 email2trac (2.4.5-1) stable; urgency=low * See Changelog -- Bas van der Vlies Thu, 20 Oct 2011 12:28:56 +0200 email2trac (2.4.3-2) stable; urgency=low * See Changelog -- Bas van der Vlies Thu, 20 Oct 2011 09:20:24 +0200 email2trac (2.4.3-1) stable; urgency=low * See Changelog -- Bas van der Vlies Wed, 21 Sep 2011 11:57:55 +0200 email2trac (2.4.2-1) stable; urgency=low * See Changelog -- Bas van der Vlies Mon, 22 Aug 2011 10:54:20 +0200 email2trac (2.4.0-4) stable; urgency=low * See Changelog, fixed unicode subject problems -- Bas van der Vlies Mon, 22 Aug 2011 09:59:11 +0200 email2trac (2.4.0-3) stable; urgency=low * changed workflow implementation -- Bas van der Vlies Mon, 15 Aug 2011 12:52:57 +0200 email2trac (2.4.0-2) stable; urgency=low * See Changelog -- Bas van der Vlies Fri, 12 Aug 2011 11:51:33 +0200 email2trac (2.4.0-1) stable; urgency=low * See Changelog -- Bas van der Vlies Wed, 10 Aug 2011 12:34:38 +0200 email2trac (2.1.8-1) stable; urgency=low * See Changelog -- Bas van der Vlies Wed, 10 Aug 2011 10:24:51 +0200 email2trac (2.1.7-1) stable; urgency=low * see Changelog -- Bas van der Vlies Tue, 09 Aug 2011 11:38:09 +0200 email2trac (2.1.6) stable; urgency=low * see Changelog -- Bas van der Vlies Mon, 08 Aug 2011 12:29:47 +0200 email2trac (2.1.5-1) stable; urgency=low * see Changelog -- Bas van der Vlies Thu, 28 Jul 2011 14:22:45 +0200 email2trac (2.1.3-1) stable; urgency=low * See Changelog -- bas van der Vlies Thu, 30 Jun 2011 10:41:30 +0200 email2trac (2.1.2-1) stable; urgency=low * See Changelog -- bas van der Vlies Thu, 23 Jun 2011 13:34:13 +0200 email2trac (2.1.1-2) stable; urgency=low * See Changelog -- bas van der Vlies Thu, 23 Jun 2011 11:43:30 +0200 email2trac (2.1.1-1) stable; urgency=low * See Changelog -- bas van der Vlies Wed, 15 Jun 2011 10:06:32 +0200 email2trac (2.1.0-1) stable; urgency=low * See Changelog -- bas van der Vlies Mon, 06 Jun 2011 10:43:18 +0200 email2trac (2.0.3-2) stable; urgency=low * see Changelog -- bas van der Vlies Thu, 21 Apr 2011 10:54:37 +0200 email2trac (2.0.3-1) stable; urgency=low * See ChangeLog -- bas van der Vlies Wed, 23 Mar 2011 10:06:56 +0100 email2trac (2.0.2-1) stable; urgency=low * see Changelog -- bas van der Vlies Fri, 14 Jan 2011 16:04:21 +0100 email2trac (2.0.1-4) stable; urgency=low * added info message for syslog of charset not found -- bas van der Vlies Wed, 12 Jan 2011 15:32:16 +0100 email2trac (2.0.1-3) stable; urgency=low * See Changelog -- Bas van der Vlies Wed, 12 Jan 2011 10:37:45 +0100 email2trac (2.0.1-2) stable; urgency=low * See Changelog -- Bas van der Vlies Tue, 11 Jan 2011 16:39:49 +0100 email2trac (2.0.1-1) stable; urgency=low * mailto fix for trac 0.12 -- Bas van der Vlies Mon, 10 Jan 2011 11:12:01 +0100 email2trac (2.0.0-1) stable; urgency=low * See Changelog -- bas van der Vlies Fri, 07 Jan 2011 15:45:20 +0100 email2trac (1.7.0-6) stable; urgency=low * html conversion bug fixes -- bas van der Vlies Tue, 04 Jan 2011 12:00:32 +0100 email2trac (1.7.0-5) stable; urgency=low * html conversion -- bas van der Vlies Tue, 04 Jan 2011 09:45:47 +0100 email2trac (1.7.0-4) stable; urgency=low * See Changelog -- bas van der Vlies Tue, 28 Dec 2010 13:00:48 +0100 email2trac (1.7.0-3) stable; urgency=low * See Changelog -- bas van der Vlies Mon, 20 Dec 2010 17:08:59 +0100 email2trac (1.7.0-2) stable; urgency=low * See Changlog -- bas van der Vlies Mon, 13 Dec 2010 11:22:15 +0100 email2trac (1.7.0-1) stable; urgency=low * see Changelog -- Bas van der Vlies Tue, 12 Oct 2010 08:21:23 +0200 email2trac (1.6.0-4) stable; urgency=low * some reformating of comments -- root Tue, 10 Aug 2010 09:28:21 +0200 email2trac (1.6.0-3) stable; urgency=low * see Changelog -- Bas van der Vlies Mon, 09 Aug 2010 14:28:08 +0200 email2trac (1.6.0-2) stable; urgency=low * see Changelog -- Bas van der Vlies Fri, 06 Aug 2010 13:40:50 +0200 email2trac (1.6.0-1) stable; urgency=low * see Changelog -- Bas van der Vlies Thu, 05 Aug 2010 12:26:00 +0200 email2trac (1.5.3-2) stable; urgency=low * See Changelog -- bas van der Vlies Tue, 27 Jul 2010 10:16:19 +0200 email2trac (1.5.3-1) stable; urgency=low * See ChangeLog -- bas van der Vlies Mon, 26 Jul 2010 10:08:23 +0200 email2trac (1.5.2-3) stable; urgency=low * See Changelog -- Bas van der Vlies Fri, 23 Jul 2010 11:52:39 +0200 email2trac (1.5.2-1) stable; urgency=low * logging of notification error was wrong. Fixed it, closes #212 - set.logger.error must be self.logger.error Reported by: adam dot lucke at srd-berlin dot de Author: Bas van der Vlies -- Bas van der Vlies Thu, 22 Jul 2010 13:18:25 +0200 email2trac (1.5.1-1) stable; urgency=low * logging of spam message was wrong. Fixed it, - set.logger.info must be self.logger.info Author: Bas van der Vlies -- Bas van der Vlies Thu, 22 Jul 2010 08:30:16 +0200 email2trac (1.5.0-4) stable; urgency=low * added a new option 'ticket_permission_system'. Can be set to: - trac: Then it will check if the report has the right trac permission to create or modify a ticket. closes #202 - update_restricted_to_participants: A ticket update is allowed only if: 1) the updater is the reporter, 2) the updater is in the CC 3) the updater has trac permission to update the ticket. If the update is denied, a new ticket will be generated instead as to not loose the issue . closes #203 Authors: kris add tsampa dot org & Bas van der Vlies * Switch for logging to the python logging module and add some new options to control the behaviour inspired by the trac logging module: - log_type,, default syslog - log_level, default info - log_format, email2trac - log_file, none Can be set to the same values as trac logging Author: Bas van der Vlies * removed suppport for trac version 0.9 Author: Bas van der Vlies -- Bas van der Vlies Thu, 15 Jul 2010 14:17:24 +0200 email2trac (1.4.9-1) stable; urgency=low * Do not check if notification is enabled, let Trac determine if a notfication is enabled and which interface/plugin is used, eg: announcerplugin Author: Bas van der Vlies -- Bas van der Vlies Mon, 12 Jul 2010 13:18:19 +0200 email2trac (1.4.8-1) stable; urgency=low * Fixed several errors in ticket update: - Changed the regex expression. It must end with ':'. - The email was lost if the ticket id was unknown. If ticket id is unknown a new ticket will be created. Reported by: SARA grid team Fixed by: Bas van der Vlies -- Bas van der Vlies Tue, 06 Jul 2010 13:55:43 +0200 email2trac (1.4.7-1) stable; urgency=low * Ticket update for version 0.12 did not work, closes #209 Author: mark underscore kids add yahoo dot com Applied by: Bas van der Vlies * enabled workflow and notification for trac version 0.12 Author: Bas van der Vlies -- Bas van der Vlies Mon, 28 Jun 2010 07:56:18 +0200 email2trac (1.4.6-1) stable; urgency=low * A better fix for attachments with special characters, closes #206 -- Bas van der Vlies Wed, 23 Jun 2010 11:52:19 +0200 email2trac (1.4.5-1) stable; urgency=low * When debug is enabled email2trac chokes on non-ascii (utf8) characters in ticket fields, closes #205 Reported by: eirik dot schwenke add nsd dot uib dot no Fixed by: Bas van der Vlies * Email2trac crashes when attachment filename contains non-ascii characters, closes #206 Reported by: karsten dot rohrbach add wibas dot de Fixed by: Bas van der Vlies -- Bas van der Vlies Tue, 22 Jun 2010 13:23:00 +0200 email2trac (1.4.3-1) stable; urgency=low * support added for trac version 0.12 -- Bas van der Vlies Tue, 08 Jun 2010 16:26:52 +0200 email2trac (1.4.2-1) stable; urgency=low * delete_spam still used trac_version in /etc/email2trac.conf * fixed an error in ticket_update_by_subject function. -- Bas van der Vlies Thu, 20 May 2010 15:40:20 +0200 email2trac (1.4.0-3) stable; urgency=low * Automatically determine trac version -- Bas van der Vlies Thu, 20 May 2010 14:43:05 +0200 email2trac (1.4.0-2) stable; urgency=low * See Changelog -- Bas van der Vlies Thu, 15 Apr 2010 14:13:24 +0200 email2trac (1.3.5-1) stable; urgency=low * See Changes -- Bas van der Vlies Thu, 15 Apr 2010 09:14:14 +0200 email2trac (1.3.2-1) stable; urgency=low * Fixed a bug reporter was always set to the default value specified in trac.ini. Reported by: Jean-Paul Duyx Fixed by: Bas van der Vlies -- Bas van der Vlies Tue, 30 Mar 2010 13:22:00 +0200 email2trac (1.3.1-1) stable; urgency=low * If reported field is overriden then use it for all trac functions including notification, closes #187 Reported by: shildebrand at venturebeat dot com Fixed by: Bas van der Vlies -- Bas van der Vlies Tue, 30 Mar 2010 10:27:44 +0200 email2trac (1.3.0-3) stable; urgency=low * Added configure option '--with-install_user=', default user is 'root'. The specified user is used for installation so we can install the package as non-root user, closes #182. Reported by: shildebrand at venturebeat dot com Fixed by: Bas van der Vlies * Re-arranged some code so that we can override ticket fields in email2trac.conf, eg: - default_reporter : email2trac Will set the reporter ticket field to email2trac for all mail, closes #182 Reported by: shildebrand at venturebeat dot com Fixed by: Bas van der Vlies * Fixed a bug when there is no subject field in the message, closes #179 The fix in the 1.2.0 version did not work. Reported by: xurizaemon and John Donners (SARA) Fixed by: Bas van der Vlies * We do not write any files when dry run mode is enabled. Fixed by: Bas van der Vlies * Fixed several issues when DEBUG is enabled with printing non-ascii characters, see #184 Reported by: hju add jochenkuhl dot de Fixed by: Bas van der Vlies -- Bas van der Vlies Wed, 03 Mar 2010 15:50:35 +0100 email2trac (1.2.0-1) stable; urgency=low * Added an option to run_email2trac to set the PYTHON_EGG_CACHE environment variable (-e|--eggcache), closes #174 Author: pepl at cpan dot org Applied by: Bas van der Vlies * Ticket fields can be set inline an email: closes #171, #88 - controlled by parameter 'inline_properties', default behaviour off - see https://subtrac.sara.nl/oss/email2trac/wiki/Email2tracParse#Updateticketfields Author: samuel at hoffstaetter dot com Applied by: Bas van der Vlies * Fixed a bug when there is no subject field in the message, closes #179 Reported by: xurizaemon Fixed by: Bas van der Vlies * Added unicode support attachment filenames, closes #177 Reported by: obwandner add concertare dot de Fixed by: Bas van der Vlies * Email to blog did not work at all. It works but it can not handle attachments. see #175. Reported by: oland dot wells add gmail.com Patches : Bas van der Vlies * Show errors when we can not include attachments in the ticket, see #165 Requested by: hju add jochenkuhl dot de and dereks add cool-st dot com Fixed by: Bas van der Vlies * Added a new option 'email_triggers_workflow'. When a ticket is closed and an update is received via email. The ticket will be reopened or triggers a ticket workflow. This action can be skipped if we set the email_triggers_workflow option to 0. The default value is 1, closes #180 Author: zac add sprackettd dot com Applied by: Bas van der Vlies -- Bas van der Vlies Wed, 27 Jan 2010 16:17:41 +0100 email2trac (1.1.0-6) stable; urgency=low * Workflow option did not work, closes #157 Reported by: thomas dot moschny at gmx dot de Fixed by: Bas van der Vlies & Thomas Moschny * When a ticket is updated via email. We must set a changelog id, closes #156 Reported by: Chris dot Nelson at SIXNET dot com Fixed by: Bas van der Vlies * Changed all 'str =' assignments to 's =' to solve conflicts with the builtin str function Fixed by: Bas van der Vlies * Python egg cache enviroment setting was ignored by email2trac. closes #163 Author: Dennis McRitchie ( dmcr at Princeton dot EDU ) Applied by: Bas van der Vlies * Disabled code so the following line will not be displayed anymore as comment in a ticket: - This message has x attachment(s) Suggested by: dereks at realloc dot net, closes ticket #165 Fixed by : Bas van der Vlies * Added a new parameter strip_content_types. So we can strip attachments based on content type, eg: - strip_content_types: application/pgp-signature, application/mac-binhex40 Will strip attachments that has these content_types. Authors: otto at bergerdata dot de and Bas van der Vlies * FIxed an error when files where added with characters that needed to be escaped. Both email2trac and trac escaped the filenames. We removed the code from email2trac an let trac handle the escaping, closes #149 Reported by: hju att jochenkuhl dot de Fixed by: Bas van der Vlies * Added a new parameter: - subject_field_separator, default value is & This is used to set tickets fields via the subject line. It used to be , .For backwards compatibility we introduced this parameter. closes #166 Suggested by: Dennis McRitchie ( dmcr at Princeton dot EDU ) Fixed by : Bas van der Vlies * Prevent mail loop. We could set the CC ticket field to the ticket email address. - For a new ticket and reply_all is set. - If the ticket CC field is updated via the subject line. Also prevent setting the reporter address to the ticket email address. closes #172 Reported by: otto at bergerdata dot de Fixed vy : Bas van der Vlies -- Bas van der Vlies Thu, 22 Oct 2009 17:47:50 +0200 email2trac (1.0.0-1) stable; urgency=low * Implemented a new feature to drop the HTML version of multipart/alternative message part. Such a message part contains the same info. The info is sent in different formats and the client can decide which version to use. closes #30 to enable in email2trac.conf: - drop_alternative_html_version: 1 Implemented by: Bas van der Vlies -- Bas van der Vlies Tue, 25 Aug 2009 11:50:40 +0200 email2trac (0.90-1) stable; urgency=low * updated aclocal.m4 to support python versions 2.5 and 2.6, closes #137 * use the email addres in the reporter field, closes #136 * Fixed an error in blog update function All Fixes by: Bas van der Vlies * if alternate notify template is set then also set ticket id. It will show up as ticket change, closes #142 Reported by: hju att jochenkuhl dot de Fixed by: Bas van der Vlies * Error in urllib.quote(filename) could not handle unicode filenames, closes #138 Reported by: debacle at debian dot org Applied by: Bas van der Vlies * Fixed an error when debug is on and the body message contains unicode strings, closes #144 Reported by: trumbitta at gmail dot com Applied by: Bas van der Vlies * default trac version for email2trac is now updated to 0.11 -- Bas van der Vlies Thu, 04 Jun 2009 14:48:11 +0200 email2trac (0.80-1) stable; urgency=low * Fixed in parsing the reflow parameter, closes #123 Reported by: tomasz dot sterna at sensisoft dot com Fixed by: Bas van der Vlies * implemented workflow for tickets that are reopend, closes #70 Reported by: hju at jochenkuhl dot de Author by: Bas van der Vlies * added FullBlogPlugin support. So we can update/create the blogs via email, #116 Authors: Bas van der Vlies & lucas dot eisenzimmer at t-systems-mms dot com * email2trac require at least python version 2.4, closes #131 Reported by: otto at bergerdata dot de Fixed by: Bas van der Vlies * We can now set ticket fields for a new ticket via the 'subject' line: - Subject: #?[,]* closes #130 Requested by: Steve Implemented by: Bas van der Vlies -- Bas van der Vlies Tue, 24 Mar 2009 15:26:08 +0100 email2trac (0.70-1) stable; urgency=low * New stable version -- Bas van der Vlies Tue, 27 Jan 2009 15:42:32 +0100 email2trac (0.60-1) stable; urgency=low * New stable version -- Bas van der Vlies Thu, 20 Nov 2008 11:29:59 +0100 email2trac (0.40-1) stable; urgency=low * New Version, see ChangeLog -- Bas van der Vlies Fri, 10 Oct 2008 17:24:09 +0200 email2trac (0.30-3) stable; urgency=low * Non-maintainer upload. * Reopen ticket if an email update is received -- Bas van der Vlies Mon, 04 Aug 2008 16:14:12 +0200 email2trac (0.30-2) stable; urgency=low * Fixed an error in formating email_header. -- Bas van der Vlies Thu, 03 Jul 2008 12:53:39 +0200 email2trac (0.30-1) stable; urgency=low * a lot improvements and fixes, see Changelog -- Bas van der Vlies Tue, 3 Jun 2008 23:00:27 +0200 email2trac (0.20-1) stable; urgency=low * New version, see Changelog -- Bas van der Vlies Tue, 27 May 2008 23:12:54 +0200 email2trac (0.13.0-1) stable; urgency=low * New version with a lot of improvements -- Bas van der Vlies Mon, 4 Feb 2008 11:27:27 +0100 email2trac (0.10.0-2) stable; urgency=low * Added extra info to syslog when exception occurs -- Bas van der Vlies Fri, 3 Aug 2007 09:45:26 +0200 email2trac (0.10.0-1) stable; urgency=low * New release, see ChangeLog -- bas Tue, 17 Jul 2007 14:15:14 +0200 email2trac (0.9.5-1) stable; urgency=low * New version with some new features see ChangeLog -- bas Tue, 24 Apr 2007 14:27:25 +0200 email2trac (0.9.0-2) stable; urgency=low * add email2trac.conf to conffiles -- bas Wed, 6 Dec 2006 14:28:04 +0100 email2trac (0.9.0-1) stable; urgency=low * New version nothing changed -- bas Mon, 4 Dec 2006 18:57:16 +0100 email2trac (0.8.2-2) stable; urgency=low * Try new version with unicode fixes -- bas Mon, 4 Dec 2006 12:04:30 +0100 email2trac (0.8.2-1) stable; urgency=low * New release version -- bas Thu, 26 Oct 2006 08:19:56 +0200 email2trac (0.8.1-6) stable; urgency=low * Fixed a strang bug in 0.9 version, if ticket update and email has attachment we are not allowed to set the description and author field of the attachment else the comment text is lost -- bas Fri, 20 Oct 2006 13:06:28 +0200 email2trac (0.8.1-5) stable; urgency=low * Adjust delete_spam.py for version 0.10 -- bas Thu, 19 Oct 2006 10:57:30 +0200 email2trac (0.8.1-4) stable; urgency=low * Fixed an error in ticket update, when a ticket does not exists proceed if it is a new ticket. -- bas Wed, 18 Oct 2006 09:50:36 +0200 email2trac (0.8.1-3) stable; urgency=low * setgid() must be called before setuid() -- bas Tue, 17 Oct 2006 11:17:13 +0200 email2trac (0.8.1-2) stable; urgency=low * Replace sys.exit(0) bij return else there is an exception -- bas Wed, 11 Oct 2006 14:08:50 +0200 email2trac (0.8.1-1) stable; urgency=low * Fixed some errors in delete_spam.py * added drop_spam option * add author and description field when adding a attachment -- bas Thu, 5 Oct 2006 15:03:23 +0200 email2trac (0.8.0-2) stable; urgency=low * Do not send notification when message is marked as Spam -- bas Mon, 2 Oct 2006 10:57:09 +0200 email2trac (0.8.0-1) stable; urgency=low * See ChangeLog -- bas Fri, 29 Sep 2006 12:29:30 +0200 email2trac (0.7.7-1) stable; urgency=low * added RPM specfile -- bas Mon, 28 Aug 2006 10:11:30 +0200 email2trac (0.7.6-5) stable; urgency=low * Fixed reply_all bug, thanks to ncarlson@ibsys.com -- Bas van der Vlies Fri, 21 Jul 2006 14:45:14 +0200 email2trac (0.7.6-4) stable; urgency=low * Remove the temporarly create files by trac for attachment insertion -- Bas van der Vlies Mon, 17 Jul 2006 10:46:29 +0200 email2trac (0.7.6-3) stable; urgency=low * Hopefully now fixed the unicode/encode problems -- Bas van der Vlies Fri, 14 Jul 2006 10:59:25 +0200 email2trac (0.7.6-2) stable; urgency=low * Fixed delete_spam.py for versions higher then 0.8 -- Bas van der Vlies Thu, 13 Jul 2006 14:28:55 +0200 email2trac (0.7.6-1) stable; urgency=low * Fixes delete_spam.py also delete from attachment table Fixes: Jaap Dijkshoorn -- bas Thu, 13 Jul 2006 12:33:41 +0200 email2trac (0.7.5-1) stable; urgency=low * Fix for release greater than 0.8, now attachments where saved when a new ticket was inserted -- bas Thu, 13 Jul 2006 10:23:27 +0200 email2trac (0.7.4-2) stable; urgency=low * New bug fixes for unicode support -- bas Tue, 11 Jul 2006 14:52:58 +0200 email2trac (0.7.4-1) stable; urgency=low * Unicode bug fixes -- bas Tue, 11 Jul 2006 09:24:00 +0200 email2trac (0.7.3-7) stable; urgency=low * removed some unicode data conversions -- bas Thu, 6 Jul 2006 09:04:35 +0200 email2trac (0.7.3-6) stable; urgency=low * Fixed an encoding problem when email_header is set to 1 -- bas Fri, 30 Jun 2006 13:42:38 +0200 email2trac (0.7.3-5) stable; urgency=low * Description always changed when accesing the ticket via the web. Suggestion/Patch by: Christian Boos -- bas Fri, 30 Jun 2006 09:50:32 +0200 email2trac (0.7.3-4) stable; urgency=low * Fixed a LookupError -- bas Mon, 26 Jun 2006 09:58:07 +0200 email2trac (0.7.3-3) stable; urgency=low * Fixed and spell error, self.mail_addr must be self.email_addr -- bas Thu, 22 Jun 2006 15:17:55 +0200 email2trac (0.7.3-1) stable; urgency=low * Enabled syslog option -- bas Thu, 22 Jun 2006 12:45:37 +0200 email2trac (0.7.2-0) stable; urgency=low * Added new try/except statement and fixed LookupError -- bas Thu, 22 Jun 2006 09:59:02 +0200 email2trac (0.7.1-3) stable; urgency=low * Fixed an error for already added attachments. Do not close the database connection -- bas Fri, 16 Jun 2006 13:52:26 +0200 email2trac (0.7.0-2) stable; urgency=low * Fixed some language errors by Nathaniel Irons -- bas Fri, 2 Jun 2006 09:27:22 +0200 email2trac (0.7.0-1) stable; urgency=low * Added Ticket merging -- bas Fri, 26 May 2006 15:01:03 +0200 email2trac (0.6.0-1) stable; urgency=low * New Version 0.6 -- bas Tue, 16 May 2006 11:14:11 +0200 email2trac (0.5.7-1) stable; urgency=low * New version that fixes serveral bugs -- bas Wed, 12 Apr 2006 15:54:30 +0200 email2trac (0.5.0-4) stable; urgency=low * Continue instead of going on -- bas Fri, 17 Feb 2006 14:29:48 +0100 email2trac (0.5.0-3) stable; urgency=low * Fixed delete_spam.py if there are not enough permissions to delete tickets -- bas Fri, 17 Feb 2006 12:38:19 +0100 email2trac (0.5.0-2) stable; urgency=low * leave out the body tag for email urls -- bas Thu, 16 Feb 2006 16:01:02 +0100 email2trac (0.5.0-1) stable; urgency=low * First package -- Bas van der Vlies Thu, 29 Dec 2005 14:40:11 +0100 email2trac-2.10.0/debian/compat0000755007443000744420000000000213012622127014345 0ustar basbas5 email2trac-2.10.0/debian/conffiles0000644007443000744420000000002513012622127015034 0ustar basbas/etc/email2trac.conf email2trac-2.10.0/debian/control0000755007443000744420000000054313012622127014554 0ustar basbasSource: email2trac Section: misc Priority: optional Maintainer: Bas van der Vlies Build-Depends: debhelper (>> 4.0.0), cdbs, chrpath, python Standards-Version: 3.2.1 Package: email2trac Section: misc Architecture: any Depends: ${slibs:Depends}, python, cdbs Description: Converts email to a trac ticket Name says it All email2trac-2.10.0/debian/copyright0000644007443000744420000002613613012622127015107 0ustar basbas Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. email2trac-2.10.0/debian/postinst0000644007443000744420000000032313012622127014750 0ustar basbas#!/bin/sh # # Authors: Bas van der Vlies # # SVN Info: # $Id$ dpkg-statoverride --remove /usr/bin/run_email2trac >/dev/null 2>&1 || true dpkg-statoverride --update --add root root 04111 /usr/bin/run_email2trac email2trac-2.10.0/debian/postrm0000644007443000744420000000021213012622127014406 0ustar basbas#!/bin/sh # # Authors: Bas van der Vlies # # SVN Info: # $Id$ dpkg-statoverride --remove /usr/bin/run_email2trac >/dev/null 2>&1 || true email2trac-2.10.0/debian/rules0000755007443000744420000000140413012622127014223 0ustar basbas#!/usr/bin/make -f # Copyrignt 2006 Bas van der Vlies # # # DEB_AUTO_UPDATE_DEBIAN_CONTROL := yes # # include /usr/share/cdbs/1/rules/buildcore.mk include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/class/makefile.mk #include /usr/share/cdbs/1/class/makefile-vars.mk # Example to set the trac_user id to other value # #DEB_CONFIGURE_EXTRA_FLAGS := --enable-python --with-trac_user=bas DEB_CONFIGURE_EXTRA_FLAGS := --enable-python --with-virtualenv=/data/virtualenvs/trac # does on package by package bases so doesn't work :-/ # #DEB_DH_INSTALL_ARGS := --list-missing # # #DEB_CONFIGURE_EXTRA_FLAGS := --enable-debug # # # tight versioning # #DEB_DH_MAKESHLIBS_ARGS := -V # ~ email2trac-2.10.0/delete_spam.py.in0000755007443000744420000001164013012622127015170 0ustar basbas#!@PYTHON@ # # Copyright (C) 2002 # # This file is part of the email2trac utils # # Copyright 2002 SURFsara # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # vi: # set ts=4 """ Author: Bas van der Vlies Date : 29 September 2205 Desc. : Delete Spam tickets from database. Else we get an lot of tickets Usage : delete_spam [ -f/--file -n/--dry-run -p/--project -v/--verbose] defaults: configfile = /etc/email2trac.conf SVN Info: $Id$ """ import os import sys import getopt import shutil import ConfigParser def ReadConfig(file, name): """ Parse the config file """ if not os.path.isfile(file): print 'File %s does not exists' %file sys.exit(1) config = ConfigParser.ConfigParser() try: config.read(file) except ConfigParser.MissingSectionHeaderError,detail: print detail sys.exit(1) # Use given project name else use defaults # if name: if not config.has_section(name): print "Not an valid project name: %s" %name print "Valid names: %s" %config.sections() sys.exit(1) project = dict() for option in config.options(name): project[option] = config.get(name, option) else: project = config.defaults() return project def new_delete_spam(parameters): """ This only works for trac versions higher or equal then 0.10 """ debug = int(parameters['debug']) DRY_RUN = parameters['DRY_RUN'] VERBOSE = parameters['VERBOSE'] project = parameters['project'] env = Environment(project, create=0) db = env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT id FROM ticket WHERE component = 'Spam';") while 1: row = cursor.fetchone() if not row: break spam_id = row[0] if debug or DRY_RUN or VERBOSE: print "Deleting ticket %s" %spam_id try: tkt = Ticket(env, spam_id, db) except util.TracError, detail: print detail continue if DRY_RUN: print 'DRY_RUN: tkt.delete()' else: tkt.delete() if __name__ == '__main__': # Default config file # configfile = '@email2trac_conf@' virtualenv = '@virtualenv@' try: opts, args = getopt.getopt(sys.argv[1:], 'hf:np:v', ['help', 'file=', 'dry-run', 'project=', 'verbose']) except getopt.error,detail: print __doc__ print detail sys.exit(1) DRY_RUN = False VERBOSE = False project_name = None for opt,value in opts: if opt in [ '-h', '--help']: print __doc__ sys.exit(0) elif opt in ['-f', '--file']: configfile = value elif opt in ['-n', '--dry-run']: DRY_RUN = True elif opt in ['-p', '--project']: project_name = value elif opt in ['-v', '--verbose']: VERBOSE = True if virtualenv and os.path.exists(virtualenv): activate_this = os.path.join(virtualenv, 'bin/activate_this.py') if os.path.exists(activate_this): execfile(activate_this, dict(__file__=activate_this)) try: from trac import __version__ as trac_version from trac import config as trac_config from trac.env import Environment from trac.ticket import Ticket from trac import util except ImportError, detail: print "Can not find a a valid trac installation, solutions could be:" print "\tset PYTHONPATH" print "\tuse the --virtualenv option" sys.exit(1) # Determine major trac version used to be in email2trac.conf # Quick hack for 0.12 # l = trac_version.split('.') version = '.'.join(l[0:2]) if VERBOSE: print "Found trac version: %s" %version ## We only support versions 0.11 and 0.12 # if not version in ['0.11', '0.12', '1.0', '1,1']: print 'Trac version %s is not suported' %(version) settings = ReadConfig(configfile, project_name) if not settings.has_key('project'): print __doc__ print 'No project defined in config file, eg:\n\t project: /data/trac/bas' sys.exit(1) settings['DRY_RUN'] = DRY_RUN settings['VERBOSE'] = VERBOSE new_delete_spam(settings) print 'Spam is deleted succesfully..' # EOB email2trac-2.10.0/email2trac.conf0000644007443000744420000000061313012622127014614 0ustar basbas[DEFAULT] project: /data/trac/hpcv/project/test debug: 0 black_list: MAILER-DAEMON@ drop_spam : 1 drop_alternative_html_version: 1 email_quote: > html2text_cmd: ignore_trac_user_settings: 0 inline_properties: 1 reply_all : 0 spam_level: 5 strip_quotes: 0 strip_signature: 0 ticket_update: 1 ticket_update_by_subject: 1 umask: 022 verbatim_format: 1 [bas] project: /data/trac/bas spam_level: 1 email2trac-2.10.0/email2trac.py.in0000755007443000744420000030153313012622127014734 0ustar basbas#!@PYTHON@ # # This file is part of the email2trac utils # # Copyright 2002 SURFsara # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # For vi/emacs or other use tabstop=4 (vi: set ts=4) # """ email2trac.py -- Email -> TRAC tickets A MTA filter to create Trac tickets from inbound emails. first proof of concept from: Copyright 2005, Daniel Lundin Copyright 2005, Edgewall Software Authors: Bas van der Vlies Walter de Jong How to use ---------- * See https://oss.trac.surfsara.nl/email2trac/ * Commandline opions: -h,--help -A, --agilo -B, --bh_product -d, --debug -E, --virtualenv -f,--file -n,--dry-run -p, --project -t, --ticket_prefix -v, --verbose Git email2trac version: $Id: f651aac38c25341b99d3e963efed27c3732d6989 $ """ import os import sys import string import getopt import time import email import email.Iterators import email.Header import re import urllib import unicodedata import mimetypes import traceback import logging import logging.handlers import UserDict import tempfile from datetime import timedelta, datetime from stat import * ## Some global variables # m = None class SaraDict(UserDict.UserDict): def __init__(self, dictin = None): UserDict.UserDict.__init__(self) self.name = None if dictin: if dictin.has_key('name'): self.name = dictin['name'] del dictin['name'] self.data = dictin def get_value(self, name): if self.has_key(name): return self[name] else: return None def __repr__(self): return repr(self.data) def __str__(self): return str(self.data) def __getattr__(self, name): """ override the class attribute get method. Return the value from the dictionary """ if self.data.has_key(name): return self.data[name] else: return None def __setattr__(self, name, value): """ override the class attribute set method only when the UserDict has set its class attribute """ if self.__dict__.has_key('data'): self.data[name] = value else: self.__dict__[name] = value def __iter__(self): return iter(self.data.keys()) class TicketEmailParser(object): env = None comment = '> ' def __init__(self, env, parameters, logger, version): self.env = env # Database connection # self.db = None # Save parameters # self.parameters = parameters self.logger = logger # Some useful mail constants # self.email_name = None self.email_addr = None self.email_from = None self.author = None self.id = None ## Will be set to True if the user has ben registered # self.allow_registered_user = False self.STRIP_CONTENT_TYPES = list() ## fields properties via body_text # self.properties = dict() self.VERSION = version self.get_config = self.env.config.get ## init function ## # self.setup_parameters() def setup_parameters(self): if self.parameters.umask: os.umask(self.parameters.umask) if not self.parameters.spam_level: self.parameters.spam_level = 0 if self.parameters.enable_automatic_response_check in [ 1, 'True', 'TRUE', 'on' ]: self.parameters.enable_automatic_response_check = True if not self.parameters.spam_header: self.parameters.spam_header = 'X-Spam-Score' if not self.parameters.recipient_delimiter: self.parameters.recipient_delimiter = '+' if not self.parameters.email_quote: self.parameters.email_quote = '^> .*' self.parameters.skip_line_regex = '^> .*' if not self.parameters.ticket_update_by_subject_lookback: self.parameters.ticket_update_by_subject_lookback = 30 if self.parameters.verbatim_format == None: self.parameters.verbatim_format = 1 if self.parameters.reflow == None: self.parameters.reflow = 1 if self.parameters.binhex: self.STRIP_CONTENT_TYPES.append('application/mac-binhex40') if self.parameters.applesingle: self.STRIP_CONTENT_TYPES.append('application/applefile') if self.parameters.appledouble: self.STRIP_CONTENT_TYPES.append('application/applefile') if self.parameters.strip_content_types: items = self.parameters.strip_content_types.split(',') for item in items: self.STRIP_CONTENT_TYPES.append(item.strip()) if self.parameters.tmpdir: self.parameters.tmpdir = os.path.normcase(str(self.parameters['tmpdir'])) else: self.parameters.tmpdir = os.path.normcase('/tmp') if self.parameters.email_triggers_workflow == None: self.parameters.email_triggers_workflow = 1 if not self.parameters.subject_field_separator: self.parameters.subject_field_separator = '&' else: self.parameters.subject_field_separator = self.parameters.subject_field_separator.strip() if not self.parameters.strip_signature_regex: self.parameters.strip_signature_regex = '^-- $' self.parameters.cut_line_regex = '^-- $' if self.get_config('components', 'announcer.*') in ['enabled']: self.trac_smtp_from = self.get_config('announcer', 'email_from') self.smtp_default_domain = self.get_config('announcer', 'email_default_domain') self.smtp_replyto = self.get_config('announcer', 'email_replyto') self.trac_smtp_always_cc = self.get_config('announcer', 'email_always_cc') self.trac_smtp_always_bcc = self.get_config('announcer', 'email_always_bcc') else: self.trac_smtp_from = self.get_config('notification', 'smtp_from') self.smtp_default_domain = self.get_config('notification', 'smtp_default_domain') self.smtp_replyto = self.get_config('notification', 'smtp_replyto') self.trac_smtp_always_cc = self.get_config('notification', 'smtp_always_cc') self.trac_smtp_always_bcc = self.get_config('notification', 'smtp_always_bcc') self.system = None ########## Email Header Functions ########################################################### def automatic_mail_response(self, message): """ Detect automatic mail response: rfc3834 values - Auto-Submitted: * auto-generated --> Indicates that a message was generated by an automatic process, and is not a direct response to another message. * auto-replied --> Indicates that a message was automatically generated as a direct response to another message. * auto-notified --> Indicates that a message was generated by a Sieve notification system. * no --> Human message - Precedence: * "bulk", "junk", or "list"; used to indicate that automated "vacation" or "out of office" responses should not be returned for this mail. This header field is obsolete but still used a lot """ self.logger.debug('function automatic_mail_response') if message.has_key('Auto-Submitted'): if not message['Auto-Submitted'].lower() in [ 'no' ]: self.logger.info('Message rejected : Auto-Submitted = %s' %(message['Auto-Submitted'])) return True else: return False if message.has_key('Precedence'): if message['Precedence'].lower() in [ 'bulk', 'junk', 'list' ]: self.logger.info('Message rejected : Precedence = %s' %(message['Precedence'])) return True else: return False def spam(self, message): """ # X-Spam-Score: *** (3.255) BAYES_50,DNS_FROM_AHBL_RHSBL,HTML_ # Note if Spam_level then '*' are included """ self.logger.debug('function spam') spam = False if message.has_key(self.parameters.spam_header): spam_l = string.split(message[self.parameters.spam_header]) #self.logger.info('Spam header: %s' %(message[self.parameters.spam_header])) try: number = spam_l[0].count('*') except IndexError, detail: number = 0 if number >= self.parameters.spam_level: spam = True ## treat virus mails as spam # elif message.has_key('X-Virus-found'): spam = True ## Astaro firewall spam handling # elif message.get('X-Spam-Flag') == "YES" and message.get('X-Spam-Result') == "Spam": spam = True ## How to handle SPAM messages # if self.parameters.drop_spam and spam: self.logger.info('Message is a SPAM. Automatic ticket insertion refused (SPAM level > %d)' %self.parameters.spam_level) return 'drop' elif spam: return 'Spam' else: return False def email_header_acl(self, keyword, message_field, default): """ This function wil check if the email address is allowed or denied to send mail to the ticket list """ self.logger.debug('function email_header_acl: %s' %keyword) try: mail_addresses = self.parameters[keyword] # Check if we have an empty string # if not mail_addresses: return default except KeyError, detail: self.logger.debug('\t %s not defined, all messages are allowed.' %(keyword)) return default mail_addresses = string.split(mail_addresses, ',') message_addresses = string.split(message_field, ',') for entry in mail_addresses: entry = entry.strip() TO_RE = re.compile(entry, re.VERBOSE|re.IGNORECASE) for addr in message_addresses: addr = addr.strip() if self.parameters.compare_function_list in [ 'matches', 'match']: s = '\t%s matches %s' %(addr, entry) result = TO_RE.match(addr) else: s = '\t%s contains %s' %(addr, entry) result = TO_RE.search(addr) if result: self.logger.debug(s) return True return False def email_header_txt(self, m): """ Display To and CC addresses in description field """ s = '' if m['To'] and len(m['To']) > 0: s = "'''To:''' %s\r\n" %(m['To']) if m['Cc'] and len(m['Cc']) > 0: s = "%s'''Cc:''' %s\r\n" % (s, m['Cc']) return self.email_to_unicode(s) def get_sender_info(self, message): """ Get the default author name and email address from the message """ self.logger.debug('function get_sender_info') to_addrs = email.Utils.getaddresses( message.get_all('to', []) ) self.email_to_addrs = list() for n,e in to_addrs: self.email_to_addrs.append(e) self.email_to_addrs = ','.join(self.email_to_addrs) self.email_name, self.email_addr = email.Utils.parseaddr(message['from']) ## decode email name can contain charset # self.email_name = self.email_to_unicode(self.email_name) dstr = '\t email name: %s, email address: %s' %(self.email_name, self.email_addr) self.logger.debug(dstr) ## Trac can not handle author's name that contains spaces # if self.email_addr.lower() == self.trac_smtp_from.lower(): if self.email_name: self.author = self.email_name else: self.author = "email2trac" else: self.author = self.email_addr if self.parameters.ignore_trac_user_settings: return # Is this a registered user, use email address as search key: # result: # u : login name # n : Name that the user has set in the settings tab # e : email address that the user has set in the settings tab # #users = [ (u,n,e) for (u, n, e) in self.env.get_known_users(self.db) users = [ (u,n,e) for (u, n, e) in self.env.get_known_users() if ( (e and (e.lower() == self.email_addr.lower())) or (u and (u.lower() + '@' + self.smtp_default_domain.lower() == self.email_addr.lower())) ) ] if len(users) >= 1: self.email_from = users[0][2] self.author = users[0][0] self.logger.debug('\tget_sender_info: found registered user: %s' %(self.author) ) if self.parameters.white_list_registered_users: self.logger.debug('\tget_sender_info: added registered user to white list') self.allow_registered_user = True def set_cc_fields(self, ticket, message, update=False): """ Set all the right fields for a new ticket """ self.logger.debug('function set_cc_fields') # Put all CC-addresses in ticket CC field # if self.parameters.reply_all: ticket_cc = '' msg_cc_addrs = email.Utils.getaddresses( message.get_all('cc', []) ) if not msg_cc_addrs: return if update: self.logger.debug("\tupdate ticket cc-field") ticket_cc = ticket['cc'] ticket_cc_list = ticket_cc.split(',') for name,addr in msg_cc_addrs: ## Prevent mail loop # if addr == self.trac_smtp_from: self.logger.debug("\tSkipping %s email address for CC-field, same as smtp_from address in trac.ini " %(addr)) continue ## Alwyas remove reporter email address # elif addr == self.email_addr: self.logger.debug("\tSkipping reporter email address for CC-field") continue ## Always remove the always_cc address # elif addr == self.trac_smtp_always_cc: self.logger.debug("\tSkipping smtp_always_cc email address for CC-field") continue ## Always remove the always_bcc address # elif addr == self.trac_smtp_always_bcc: self.logger.debug("\tSkipping smtp_always_bcc email address for CC-field") continue ## Skip also addr in cc_black_list (email2trac.conf) # if self.email_header_acl('cc_black_list', addr, False): self.logger.debug("\tSkipping address for CC-field due to cc_black_list") continue else: ## On update, prevent adding duplicates # if update: if addr in ticket_cc_list: continue if ticket_cc: ticket_cc = '%s, %s' %(ticket_cc, addr) else: ticket_cc = addr if ticket_cc: self.logger.debug('\tCC fields: %s' %ticket_cc) ticket['cc'] = self.email_to_unicode(ticket_cc) def acl_list_from_file(self, f, keyword): """ Read the email address from a file """ self.logger.debug('function acl_list_from_file %s : %s' %(f, keyword)) if not os.path.isfile(f): self.logger.error('%s_file: %s does not exists' %(keyword, f) ) else: ## read whole file and replace '\n' with '' # addr_l = open(f, 'r').readlines() s = ','.join(addr_l).replace('\n','') try: self.parameters[keyword] = "%s,%s" %(self.parameters[keyword], s) except KeyError, detail: self.parameters[keyword] = s ########## DEBUG functions ########################################################### def debug_body(self, message_body, temp_file): """ """ self.logger.debug('function debug_body:') body_file = "%s.body" %(temp_file) fx = open(body_file, 'wb') if self.parameters.dry_run: self.logger.info('DRY-RUN: not saving body to %s' %(body_file)) return self.logger.debug('writing body to %s' %(body_file)) if not message_body: message_body = '(None)' message_body = message_body.encode('utf-8') fx.write(message_body) fx.close() try: os.chmod(body_file,S_IRWXU|S_IRWXG|S_IRWXO) except OSError: pass def debug_attachments(self, message_parts, temp_file): """ """ self.logger.debug('function debug_attachments') n = 0 for item in message_parts: ## Skip inline text parts # if not isinstance(item, tuple): continue (original, filename, part) = item self.logger.debug('\t part%d: Content-Type: %s' % (n, part.get_content_type()) ) dummy_filename, ext = os.path.splitext(filename) n = n + 1 part_name = 'part%d%s' %(n, ext) part_file = "%s.%s" %(temp_file, part_name) s = 'writing %s: filename: %s' %(part_file, filename) self.print_unicode(s) ## Forbidden chars, just write part files instead of names # #filename = filename.replace('\\', '_') #filename = filename.replace('/', '_') #filename = filename + '.att_email2trac' # part_file = os.path.join(self.parameters.tmpdir, filename) #part_file = util.text.unicode_quote(part_file) #self.print_unicode(part_file) if self.parameters.dry_run: self.logger.info('DRY_RUN: NOT saving attachments') continue fx = open(part_file, 'wb') text = part.get_payload(decode=1) if not text: text = '(None)' fx.write(text) fx.close() try: os.chmod(part_file,S_IRWXU|S_IRWXG|S_IRWXO) except OSError: pass def save_email_for_debug(self, message, project_name, save_only_raw_message=False): if self.parameters.dry_run: self.logger.debug('DRY_RUN: NOT saving email message') return (fd, tmp_file) = tempfile.mkstemp('.email2trac', project_name, self.parameters.tmpdir) fx = os.fdopen(fd, 'wb') self.logger.debug('saving email to %s' %(tmp_file)) fx.write('%s' % message) fx.close() try: os.chmod(tmp_file, S_IRWXU|S_IRWXG|S_IRWXO) except OSError: pass if not save_only_raw_message: message_parts = self.get_message_parts(message) message_parts = self.unique_attachment_names(message_parts) body_text = self.get_body_text(message_parts) self.debug_body(body_text, tmp_file) self.debug_attachments(message_parts, tmp_file) ########## Conversion functions ########################################################### def email_to_unicode(self, message_str): """ Email has 7 bit ASCII code, convert it to unicode with the charset that is encoded in 7-bit ASCII code and encode it as utf-8 so Trac understands it. """ self.logger.debug("function email_to_unicode") self.logger.debug("\t repr:%s type:%s" %(repr(message_str), type(message_str))) ## Skip unicode strings, there are already converted # if type(message_str) is unicode: return message_str results = email.Header.decode_header(message_str) s = None for text,format in results: if format: try: temp = unicode(text, format) except UnicodeError, detail: # This always works # msg = 'ERROR: Could not find charset: %s, please install' %format self.logger.error(msg) temp = unicode(text, 'iso-8859-15') except LookupError, detail: msg = 'ERROR: Could not find charset: %s, please install' %format self.logger.error(msg) #temp = unicode(text, 'iso-8859-15') temp = message_str else: temp = string.strip(text) temp = unicode(text, 'iso-8859-15') if s: s = '%s %s' %(s, temp) else: s = '%s' %temp return s def str_to_dict(self, s): """ Transfrom a string of the form [=]+ to dict[] = """ self.logger.debug("function str_to_dict") fields = string.split(s, self.parameters.subject_field_separator) result = dict() for field in fields: try: index, value = string.split(field, '=') # We can not change the description of a ticket via the subject # line. The description is the body of the email # if index.lower() in ['description']: continue if value: result[index.lower()] = value except ValueError: pass return result def print_unicode(self,s): """ This function prints unicode strings if possible else it will quote it """ try: self.logger.debug(s) except UnicodeEncodeError, detail: self.logger.debug(util.text.unicode_quote(s)) def html_2_txt(self, data): """ Various routines to convert html syntax to valid trac wiki syntax """ self.logger.debug('function html_2_txt') ## This routine make an safe html that can be include # in trac, but no further text processing can be done # # try: # from lxml.html.clean import Cleaner # tags_rm = list() # tags_rm.append('body') # # cleaner = Cleaner(remove_tags=tags_rm ) # parsed_data = cleaner.clean_html(data) # parsed_data = '\n{{{\n#!html\n' + parsed_data + '\n}}}\n' # # return parsed_data # # except ImportError:: # pass parsed_data = None if self.parameters.html2text_cmd: (fd, tmp_file) = tempfile.mkstemp('email2trac.html') f = os.fdopen(fd, 'w') cmd = '%s %s' %(self.parameters.html2text_cmd, tmp_file) self.logger.debug('\t html2text conversion %s'%(cmd)) if self.parameters.dry_run: self.logger.info('DRY_RUN: html2text conversion command: %s\n' %(cmd)) else: f.write(data) f.close() lines = os.popen(cmd).readlines() parsed_data = ''.join(lines) os.unlink(tmp_file) else: self.logger.debug('\t No html2text conversion tool specified in email2trac.conf') return parsed_data def check_filename_length(self, name): """ To bypass a bug in Trac check if the filename length is not larger then OS limit. yes : return truncated filename no : return unmodified filename """ self.logger.debug('function check_filename_length: ') if not name: return 'None' dummy_filename, ext = os.path.splitext(name) ## Trac uses this format # try: quote_format = util.text.unicode_quote(dummy_filename) except UnicodeDecodeError, detail: ## last resort convert to unicode # dummy_filename = util.text.to_unicode(dummy_filename) quote_format = util.text.unicode_quote(dummy_filename) ## Determine max filename length # try: filemax_length = os.pathconf('/', 'PC_NAME_MAX') except AttributeError, detail: filemax_length = 240 if len(quote_format) <= filemax_length: return name else: ## Truncate file to filemax_length and reserve room for extension # We must break on a boundry # length = filemax_length - 6 for i in range(0,10): truncated = quote_format[ : (length - i)] try: unqoute_truncated = util.text.unicode_unquote(truncated) unqoute_truncated = unqoute_truncated + ext self.print_unicode('\t ' + unqoute_truncated) break except UnicodeDecodeError, detail: continue return unqoute_truncated ########## TRAC ticket functions ########################################################### def mail_workflow(self, tkt): """ """ self.logger.debug('function mail_workflow: ') req = Mock(authname=self.author, perm=MockPerm(), args={}) ticket_system = TicketSystem(self.env) try: workflow = self.parameters['workflow_%s' %tkt['status'].lower()] except KeyError: ## fallback for compability (Will be deprecated) # workflow can be none. # workflow = None if tkt['status'] in ['closed']: workflow = self.parameters.workflow if workflow: ## process all workflow implementations # tkt_module = TicketModule(self.env) field_changes, problems = tkt_module.get_ticket_changes(req, tkt, workflow) for field in field_changes.keys(): ## We have already processed these fields # if not field in ['summary', 'description']: s = 'workflow : %s, field %s : %s, by %s' \ %(workflow, field, field_changes[field]['new'],field_changes[field]['by'] ) self.logger.debug(s) tkt[field] = field_changes[field]['new'] return True else: return False def check_permission_participants(self, tkt, action): """ Check if the mailer is allowed to update the ticket """ self.logger.debug('function check_permission_participants %s') if tkt['reporter'].lower() in [self.author.lower(), self.email_addr.lower()]: self.logger.debug('ALLOW, %s is the ticket reporter' %(self.email_addr)) return True perm = PermissionSystem(self.env) if perm.check_permission(action, self.author): self.logger.debug('ALLOW, %s has trac permission to update the ticket' %(self.author)) return True # Is the updater in the CC? try: cc_list = tkt['cc'].split(',') for cc in cc_list: if self.email_addr.lower() in cc.lower().strip(): self.logger.debug('ALLOW, %s is in the CC' %(self.email_addr)) return True except KeyError: pass return False def check_permission(self, tkt, action): """ check if the reporter has the right permission for the action: - TICKET_CREATE - TICKET_MODIFY - TICKET_APPEND - TICKET_CHGPROP There are three models: - None : no checking at all - trac : check the permission via trac permission model - email2trac: .... """ self.logger.debug("function check_permission: %s" %(action)) if self.parameters.ticket_permission_system in ['trac']: perm = PermissionCache(self.env, self.author) if perm.has_permission(action): return True else: return False elif self.parameters.ticket_permission_system in ['update_restricted_to_participants']: return (self.check_permission_participants(tkt, action)) ## Default is to allow everybody ticket updates and ticket creation # else: return True def update_ticket_fields(self, ticket, user_dict, new=None): """ This will update the ticket fields. It will check if the given fields are known and if the right values are specified It will only update the ticket field value: - If the field is known - If the value supplied is valid for the ticket field. If not then there are two options: 1) Skip the value (new=None) 2) Set default value for field (new=1) """ self.logger.debug("function update_ticket_fields") if self.parameters.bh_product: if 'product' in user_dict: if user_dict['product'] != ticket.env.product.prefix: self.logging.warning("bloodhound products cannot be changed " "- ignoring") user_dict.pop('product') ## Check only permission model on ticket updates # if not new: if self.parameters.ticket_permission_system: if not self.check_permission(ticket, 'TICKET_CHGPROP'): self.logger.info('Reporter: %s has no permission to change ticket properties' %self.author) return False ## Build a system dictionary from the ticket fields # with field as index and option as value # sys_dict = dict() for field in ticket.fields: try: sys_dict[field['name']] = field['options'] except KeyError: sys_dict[field['name']] = None pass ## Check user supplied fields an compare them with the # system one's # for field,value in user_dict.items(): s = 'user_field\t %s = %s' %(field,value) self.print_unicode(s) if not field in sys_dict.keys(): self.logger.debug('%s is not a valid field for tickets' %(field)) continue ## To prevent mail loop # if field == 'cc': cc_list = user_dict['cc'].split(',') if self.trac_smtp_from in cc_list: self.logger.debug('MAIL LOOP: %s is not allowed as CC address' %(self.trac_smtp_from)) cc_list.remove(self.trac_smtp_from) value = ','.join(cc_list) ## Check if every value is allowed for this field # if sys_dict[field]: if value in sys_dict[field]: ticket[field] = value else: ## Must we set a default if value is not allowed # if new: value = self.get_config('ticket', 'default_%s' %(field) ) else: ticket[field] = value s = 'ticket_field\t %s = %s' %(field, ticket[field]) self.print_unicode(s) def ticket_update(self, m, id, spam): """ If the current email is a reply to an existing ticket, this function will append the contents of this email to that ticket, instead of creating a new one. """ self.logger.debug("function ticket_update") if not self.parameters.ticket_update: self.logger.debug("ticket_update disabled") return False ## Must we update ticket fields # update_fields = dict() try: id, keywords = string.split(id, '?') update_fields = self.str_to_dict(keywords) ## Strip '#' # self.id = int(id[1:]) except ValueError: ## Strip '#' # self.id = int(id[1:]) self.logger.debug("\tticket id: %s" %id) ## When is the change committed # when = datetime.now(util.datefmt.utc) try: tkt = Ticket(self.env, self.id, self.db) except util.TracError, detail: ## Not a valid ticket # self.logger.info("\tCreating a new ticket, ticket id: %s does not exists" %id) self.id = None return False ## Check the permission of the reporter # if self.parameters.ticket_permission_system: if not self.check_permission(tkt, 'TICKET_APPEND'): self.logger.info('Reporter: %s has no permission to add comments or attachments to tickets' %self.author) return False ## How many changes has this ticket # #grouped = TicketModule(self.env).grouped_changelog_entries(tkt, self.db) grouped = TicketModule(self.env).grouped_changelog_entries(tkt) cnum = sum(1 for e in grouped) + 1 ## reopen the ticket if it is was closed # We must use the ticket workflow framework # if self.parameters.email_triggers_workflow: if not self.mail_workflow(tkt): if tkt['status'] in ['closed']: tkt['status'] = 'reopened' tkt['resolution'] = '' else: self.logger.debug('\temail triggers workflow disabled') ## Must we update some ticket fields properties via subject line # if update_fields: self.update_ticket_fields(tkt, update_fields) message_parts = self.get_message_parts(m) message_parts = self.unique_attachment_names(message_parts) ## Must we update some ticket fields properties via inline comments # in body_text # if self.properties: self.update_ticket_fields(tkt, self.properties) ## Must we update the CC ticket field # self.set_cc_fields(tkt, m, update=True) if self.parameters.email_header: message_parts.insert(0, self.email_header_txt(m)) body_text = self.get_body_text(message_parts) error_with_attachments = self.attach_attachments(message_parts) if body_text.strip() or update_fields or self.properties: if self.parameters.dry_run: s = 'DRY_RUN: tkt.save_changes(self.author, body_text, ticket_change_number) %s %s' %(self.author, cnum) self.logger.info(s) else: if error_with_attachments: body_text = '%s\\%s' %(error_with_attachments, body_text) self.logger.debug('\ttkt.save_changes(%s, %d)' %(self.author, cnum)) tkt.save_changes(self.author, body_text, when, None, str(cnum)) if not spam: self.notify(tkt, False, when) return True def set_ticket_fields(self, ticket): """ set the ticket fields to value specified - /etc/email2trac.conf with _ - trac default values, trac.ini """ self.logger.debug('function set_ticket_fields') user_dict = dict() for field in ticket.fields: name = field['name'] ## default trac value # CUSTOM_FIELD = False if not field.get('custom'): value = self.get_config('ticket', 'default_%s' %(name) ) ## skip this field can only be set by email2trac.conf # if name in ['resolution']: value = None else: ## Else get the default value for custom fields # CUSTOM_FIELD = True value = field.get('value') options = field.get('options') if value and options and (value not in options): value = options[int(value)] s = 'trac[%s] = %s' %(name, value) self.print_unicode(s) ## email2trac.conf settings # prefix = self.parameters.ticket_prefix try: value = self.parameters['%s_%s' %(prefix, name)] s = 'email2trac[%s] = %s ' %(name, value) self.print_unicode(s) except KeyError, detail: pass if value: user_dict[name] = value s = 'used %s = %s' %(name, value) self.print_unicode(s) else: ## custom fields need some initialisation # if CUSTOM_FIELD: user_dict[name] = '' self.update_ticket_fields(ticket, user_dict, new=1) if 'status' not in user_dict.keys(): ticket['status'] = 'new' def ticket_update_by_subject(self, subject): """ This list of Re: prefixes is probably incomplete. Taken from wikipedia. Here is how the subject is matched - Re: - Re: (:)+ So we must have the last column """ self.logger.debug('function ticket_update_by_subject') found_id = None if self.parameters.ticket_update and self.parameters.ticket_update_by_subject: SUBJECT_RE = re.compile(r'^(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE) result = SUBJECT_RE.search(subject) if result: ## This is a reply # orig_subject = result.group(1) self.logger.debug('subject search string: %s' %(orig_subject)) cursor = self.db.cursor() summaries = [orig_subject, '%%: %s' % orig_subject] ## Time resolution is in micoseconds # search_date = datetime.now(util.datefmt.utc) - timedelta(days=self.parameters.ticket_update_by_subject_lookback) if self.VERSION < 0.12: lookback = util.datefmt.to_timestamp(search_date) else: lookback = util.datefmt.to_utimestamp(search_date) for summary in summaries: self.logger.debug('Looking for summary matching: "%s"' % summary) sql = """SELECT id, reporter FROM ticket WHERE changetime >= %s AND summary LIKE %s ORDER BY changetime DESC""" cursor.execute(sql, [lookback, summary.strip()]) for row in cursor: (matched_id, sql_reporter) = row ## Save first entry. # if not found_id: found_id = matched_id ## If subject and reporter are the same. The we certainly have found the right ticket # if sql_reporter == self.author: self.logger.debug('Found matching reporter: %s with ticket id: %d' %(sql_reporter, matched_id)) found_id = matched_id break if found_id: self.logger.debug('Found matching ticket id: %d' % found_id) found_id = '#%d' % found_id return (found_id, orig_subject) return (found_id, subject) def new_ticket(self, msg, subject, spam, set_fields = None): """ Create a new ticket """ self.logger.debug('function new_ticket') tkt = Ticket(self.env) ## self.author can be email address of an username # tkt['reporter'] = self.author self.set_cc_fields(tkt, msg) self.set_ticket_fields(tkt) ## Check the permission of the reporter # if self.parameters.ticket_permission_system: if not self.check_permission(tkt, 'TICKET_CREATE'): self.logger.info('Reporter: %s has no permission to create tickets' %self.author) return False ## Old style setting for component, will be removed # if spam: tkt['component'] = 'Spam' elif self.parameters.has_key('component'): tkt['component'] = self.parameters['component'] if not msg['Subject']: tkt['summary'] = u'(No subject)' else: tkt['summary'] = subject if set_fields: rest, keywords = string.split(set_fields, '?') if keywords: update_fields = self.str_to_dict(keywords) self.update_ticket_fields(tkt, update_fields) message_parts = self.get_message_parts(msg, True) ## Must we update some ticket fields properties via body_text # if self.properties: self.update_ticket_fields(tkt, self.properties) message_parts = self.unique_attachment_names(message_parts) ## produce e-mail like header # head = '' if self.parameters.email_header: head = self.email_header_txt(msg) message_parts.insert(0, head) body_text = self.get_body_text(message_parts) tkt['description'] = body_text ## When is the change committed # when = datetime.now(util.datefmt.utc) if self.parameters.dry_run: self.logger.info('DRY_RUN: tkt.insert()') else: self.id = tkt.insert() changed = False comment = '' ## some routines in trac are dependend on ticket id # like alternate notify template # if self.parameters.alternate_notify_template: tkt['id'] = self.id changed = True ## Rewrite the description if we have mailto enabled # if self.parameters.mailto_link: changed = True comment = u'\nadded mailto line\n' #mailto = self.html_mailto_link( m['Subject']) mailto = self.html_mailto_link(subject) tkt['description'] = u'%s\r\n%s%s\r\n' \ %(head, mailto, body_text) ## Save the attachments to the ticket # error_with_attachments = self.attach_attachments(message_parts) if error_with_attachments: changed = True comment = '%s\n%s\n' %(comment, error_with_attachments) if self.parameters.email_triggers_workflow: if self.mail_workflow(tkt): changed = True if changed: if self.parameters.dry_run: s = 'DRY_RUN: tkt.save_changes(%s, comment) real reporter = %s' %( tkt['reporter'], self.author) self.logger.info(s) else: tkt.save_changes(tkt['reporter'], comment) if not spam: self.notify(tkt, True) def attach_attachments(self, message_parts, update=False): ''' save any attachments as files in the ticket's directory ''' self.logger.debug('function attach_attachments()') if self.parameters.dry_run: self.logger.debug("DRY_RUN: no attachments attached to tickets") return '' count = 0 ## Get Maxium attachment size # max_size = int(self.get_config('attachment', 'max_size')) status = None for item in message_parts: ## Skip body parts # if not isinstance(item, tuple): continue (original, filename, part) = item ## We have to determine the size so we use this temporary solution. # path, fd = util.create_unique_file(os.path.join(self.parameters.tmpdir, 'email2trac_tmp.att')) text = part.get_payload(decode=1) if not text: text = '(None)' fd.write(text) fd.close() ## get the file_size # stats = os.lstat(path) file_size = stats[ST_SIZE] ## Check if the attachment size is allowed # if (max_size != -1) and (file_size > max_size): status = '%s\nFile %s is larger then allowed attachment size (%d > %d)\n\n' \ %(status, original, file_size, max_size) os.unlink(path) continue else: count = count + 1 ## Insert the attachment # fd = open(path, 'rb') if self.system == 'discussion': att = attachment.Attachment(self.env, 'discussion', 'topic/%s' % (self.id,)) elif self.system == 'blog': att = attachment.Attachment(self.env, 'blog', '%s' % (self.id,)) else: s = 'Attach %s to ticket %d' %(filename, self.id) self.print_unicode(s) att = attachment.Attachment(self.env, 'ticket', self.id) ## This will break the ticket_update system, the body_text is vaporized # ;-( # if not update: att.author = self.author att.description = self.email_to_unicode('Added by email2trac') try: self.logger.debug('Insert atachment') att.insert(filename, fd, file_size) except OSError, detail: self.logger.info('%s\nFilename %s could not be saved, problem: %s' %(status, filename, detail)) status = '%s\nFilename %s could not be saved, problem: %s' %(status, filename, detail) ## Remove the created temporary filename # fd.close() os.unlink(path) ## return error # return status ########## Fullblog functions ################################################# def blog(self, msg, subject, id, params): """ The blog create/update function """ ## import the modules # from tracfullblog.core import FullBlogCore from tracfullblog.model import BlogPost, BlogComment ## instantiate blog core # blog = FullBlogCore(self.env) req = Mock(authname='anonymous', perm=MockPerm(), args={}) ## parameters from the subject # params = self.str_to_dict((params or '').lstrip('?')) ## preferably get the time from the email date header, or else # use current date and time date = email.Utils.parsedate_tz(msg.get('date')) if date: dt = util.datefmt.to_datetime(email.Utils.mktime_tz(date), util.datefmt.utc) else: self.logger.warn("No valid date header found") dt = util.datefmt.to_datetime(None, util.datefmt.utc) ## blog entry affected # self.id = id or util.datefmt.format_datetime(dt, "%Y%m%d%H%M%S", util.datefmt.utc) ## check wether a blog post exists # post = BlogPost(self.env, self.id) force_update = self.properties.get('update', params.get('update')) ## message parts # message_parts = self.get_message_parts(msg) message_parts = self.unique_attachment_names(message_parts) if post.get_versions() and not force_update: ## add comment to blog entry # comment = BlogComment(self.env, self.id) comment.author = self.properties.get('author', params.get('author', self.author)) comment.comment = self.get_body_text(message_parts) comment.time = dt if self.parameters.dry_run: self.logger.info('DRY-RUN: not adding comment for blog entry "%s"' % id) return warnings = blog.create_comment(req, comment) else: ## create or update blog entry # post.author = self.properties.get('author', params.get('author', self.author)) post.categories = self.properties.get('categories', params.get('categories', '')) post.title = subject.strip() post.publish_time = dt post.body = self.get_body_text(message_parts) if self.parameters.dry_run: self.logger.info('DRY-RUN: not creating blog entry "%s"' % post.title) return warnings = blog.create_post(req, post, self.author, u'Created by email2trac', False) ## check for problems # if warnings: raise TracError(', '.join('blog:%s:%s' % (w[0], w[1]) for w in warnings)) ## all seems well, attach attachments # self.attach_attachments(message_parts) ########## Discussion functions ############################################## def discussion_topic(self, content, subject): ## Import modules. # from tracdiscussion.api import DiscussionApi from trac.util.datefmt import to_timestamp, utc self.logger.debug('Creating a new topic in forum:', self.id) ## Get dissussion API component. # api = self.env[DiscussionApi] args = {'forum' : self.id} context = self._create_context(api, args, content, subject) ## Get forum for new topic. # forum = context.forum if not forum: self.logger.error("ERROR: Replied forum doesn't exist") ## Prepare topic. # topic = {'forum' : forum['id'], 'subject' : context.subject, 'time': to_timestamp(datetime.now(utc)), 'author' : self.author, 'subscribers' : [self.email_addr], 'body' : self.get_body_text(context.content_parts)} ## Add topic to DB and commit it. # self._add_topic(api, context, topic) def discussion_topic_reply(self, content, subject): ## Import modules. # from tracdiscussion.api import DiscussionApi from trac.util.datefmt import to_timestamp, utc self.logger.debug('Replying to discussion topic', self.id) ## Get dissussion API component. # api = self.env[DiscussionApi] args = {'topic' : self.id} context = self._create_context(api, args, content, subject) ## Get replied topic. # topic = context.topic if not topic: self.logger.error("ERROR: Replied topic doesn't exist") ## Prepare message. # message = {'forum' : topic['forum'], 'topic' : topic['id'], 'replyto' : -1, 'time' : to_timestamp(datetime.now(utc)), 'author' : self.author, 'body' : self.get_body_text(context.content_parts)} ## Add message to DB and commit it. # self._add_message(api, context, message) def discussion_message_reply(self, content, subject): ## Import modules. # from tracdiscussion.api import DiscussionApi from trac.util.datefmt import to_timestamp, utc self.logger.debug('Replying to discussion message', self.id) ## Get dissussion API component. # api = self.env[DiscussionApi] args = {'message' : self.id} context = self._create_context(api, args, content, subject) ## Get replied message. # message = context.message if not message: self.logger.error("ERROR: Replied message doesn't exist") ## Prepare message. # message = {'forum' : message['forum'], 'topic' : message['topic'], 'replyto' : message['id'], 'time' : to_timestamp(datetime.now(utc)), 'author' : self.author, 'body' : self.get_body_text(context.content_parts)} ## Add message to DB and commit it. # self._add_message(api, context, message) def _create_context(self, api, args, content, subject): ## Import modules. # from trac.mimeview import Context from trac.web.api import Request from trac.web.session import Session from trac.perm import PermissionCache ## TODO: Read server base URL from config. # Create request object to mockup context creation. # environ = {'SERVER_PORT' : 80, 'SERVER_NAME' : 'test', 'REQUEST_METHOD' : 'POST', 'wsgi.url_scheme' : 'http', 'wsgi.input' : sys.stdin} chrome = {'links': {}, 'scripts': [], 'ctxtnav': [], 'warnings': [], 'notices': []} if self.env.base_url_for_redirect: environ['trac.base_url'] = self.env.base_url req = Request(environ, None) req.chrome = chrome req.tz = 'missing' req.authname = self.author req.perm = PermissionCache(self.env, self.author) req.locale = None req.args = args req.session = Session(env, req) ## Create and return context. # context = Context.from_request(req) context.realm = 'discussion-email2trac' context.db = self.env.get_db_cnx() context.content = content context.subject = subject ## Read content parts from content. # context.content_parts = self.get_message_parts(content) context.content_parts = self.unique_attachment_names( context.content_parts) api._prepare_context(context) return context def _add_topic(self, api, context, topic): context.req.perm.assert_permission('DISCUSSION_APPEND') ## Filter topic. # for discussion_filter in api.discussion_filters: accept, topic_or_error = discussion_filter.filter_topic( context, topic) if accept: topic = topic_or_error else: raise TracError(topic_or_error) ## Add a new topic. # new_topic_id = api.add_topic(context, topic) ## Get inserted topic with new ID. # topic = api.get_topic(context, new_topic_id) ## Attach attachments. # self.id = topic['id'] self.attach_attachments(context.content_parts, True) ## Notify change listeners. # for listener in api.topic_change_listeners: listener.topic_created(context, topic) def _add_message(self, api, context, message): context.req.perm.assert_permission('DISCUSSION_APPEND') ## Filter message. # for discussion_filter in api.discussion_filters: accept, message_or_error = discussion_filter.filter_message( context, message) if accept: message = message_or_error else: raise TracError(message_or_error) ## Add message. # new_msg_id = api.add_message(context, message) ## Get inserted message with new ID. # message = api.get_message(context, new_msg_id) ## Attach attachments. # self.attach_attachments(context.content_parts, True) ## Notify change listeners. # for listener in api.message_change_listeners: listener.message_created(context, message) ########## MAIN function ###################################################### def parse(self, fp): """ """ self.logger.debug('Main function parse') global m m = email.message_from_file(fp) if not m: self.logger.debug('This is not a valid email message format') return ## Work around lack of header folding in Python; see http://bugs.python.org/issue4696 # try: m.replace_header('Subject', m['Subject'].replace('\r', '').replace('\n', '')) except AttributeError, detail: pass if self.parameters.debug: # save email + try to decode message part self.save_email_for_debug(m, self.parameters.project_name) elif self.parameters.save_raw_message: # save only the raw e-mail message text self.save_email_for_debug(m, self.parameters.project_name, True) self.db = self.env.get_read_db() self.get_sender_info(m) if not m['Subject']: subject = 'No Subject' else: subject = self.email_to_unicode(m['Subject']) if self.parameters.enable_automatic_response_check: if self.automatic_mail_response(m): self.logger.info('Message rejected : It is an automatic response from: %s (Subject: %s)' \ %(self.email_to_addrs, repr(subject))) #return False if self.parameters.white_list_file: self.acl_list_from_file(self.parameters.white_list_file, 'white_list') if not ( self.email_header_acl('white_list', self.email_addr, True) or self.allow_registered_user ) : self.logger.info('Message rejected : %s not in white list' %(self.email_addr)) return False if self.email_header_acl('black_list', self.email_addr, False): self.logger.info('Message rejected : %s in black list' %(self.email_addr)) return False if not self.email_header_acl('recipient_list', self.email_to_addrs, True): self.logger.info('Message rejected : %s not in recipient list' %(self.email_to_addrs)) return False ## If spam drop the message # if self.spam(m) == 'drop': return False elif self.spam(m) == 'spam': spam_msg = True else: spam_msg = False ## Check if unique reply address for tickets is set. If this is not a reply then fail back to # subject parsing. This can be skipped if: # ticket_update_subject_skip: True if self.parameters.notify_replyto_rewrite in [ 'use_trac_smtp_replyto', 'use_mail_domain' ]: if not self.parse_delivered_to_field(m, subject, spam_msg): if self.parameters.ticket_update_subject_skip: self.new_ticket(m, subject, spam_msg) else: self.logger.info('subject parsing: %s' %repr(subject)) self.parse_subject_field(m, subject, spam_msg) else: self.logger.info('subject parsing: %s' %repr(subject)) self.parse_subject_field(m, subject, spam_msg) def parse_delivered_to_field(self, m, subject, spam_msg): """ See if we have replied to an existing ticket """ self.logger.debug('function parse_delivered_to_field') ## Ticket id is in Delivered-To Field: # eg: example+390@surfsara.nl or 390@example.surfsara.nl try: self.logger.debug('\t Delivered To: %s' %m['Delivered-To']) id = m['Delivered-To'] ## # This is for example+123@surfsara.nl # if self.parameters.notify_replyto_rewrite in ['use_trac_smtp_replyto']: id = id.split(self.parameters.recipient_delimiter)[1] id = id.split('@')[0] self.logger.debug('\t Found ticket id: %s' %id) ## The ticket_update expects a # in front of the ticket id # id = "#%s" %(id) ## true if ticket update # return self.ticket_update(m, id, spam_msg) except KeyError, detail: pass except IndexError, detail: pass return False def parse_subject_field(self, m, subject, spam_msg): """ """ self.logger.debug('function parse_subject_header') ## [hic] #1529: Re: LRZ # [hic] #1529?owner=bas,priority=medium: Re: LRZ # ticket_regex = r''' (?P[#][?].*) |(?P(?P[#][\d]+)(?P\?[^:]*)?:) ''' ## Check if FullBlogPlugin is installed # blog_enabled = None blog_regex = '' if self.get_config('components', 'tracfullblog.*') in ['enabled']: self.logger.debug('Trac BLOG support enabled') blog_enabled = True blog_regex = '''|(?Pblog(?P[?][^:]*)?:(?P\S*))''' ## Check if DiscussionPlugin is installed # discussion_enabled = None discussion_regex = '' if self.get_config('components', 'tracdiscussion.api.discussionapi') in ['enabled']: self.logger.debug('Trac Discussion support enabled') discussion_enabled = True discussion_regex = r''' |(?PForum[ ][#](?P\d+)[ ]-[ ]?) |(?PTopic[ ][#](?P\d+)[ ]-[ ]?) |(?PMessage[ ][#](?P\d+)[ ]-[ ]?) ''' regex_str = ticket_regex + blog_regex + discussion_regex SYSTEM_RE = re.compile(regex_str, re.VERBOSE) ## Find out if this is a ticket, a blog or a discussion # result = SYSTEM_RE.search(subject) if result: ## update ticket + fields # if result.group('reply'): self.system = 'ticket' ## Skip the last ':' character # if self.parameters.ticket_update_subject_skip: self.new_ticket(m, subject, spam_msg) elif not self.ticket_update(m, result.group('reply')[:-1], spam_msg): self.new_ticket(m, subject, spam_msg) ## New ticket + fields # elif result.group('new_fields'): self.system = 'ticket' self.new_ticket(m, subject[:result.start('new_fields')], spam_msg, result.group('new_fields')) if blog_enabled: if result.group('blog'): self.system = 'blog' self.blog(m, subject[result.end('blog'):], result.group('blog_id'), result.group('blog_params')) if discussion_enabled: ## New topic. # if result.group('forum'): self.system = 'discussion' self.id = int(result.group('forum_id')) self.discussion_topic(m, subject[result.end('forum'):]) ## Reply to topic. # elif result.group('topic'): self.system = 'discussion' self.id = int(result.group('topic_id')) self.discussion_topic_reply(m, subject[result.end('topic'):]) ## Reply to topic message. # elif result.group('message'): self.system = 'discussion' self.id = int(result.group('message_id')) self.discussion_message_reply(m, subject[result.end('message'):]) else: self.system = 'ticket' (matched_id, subject) = self.ticket_update_by_subject(subject) if matched_id: if not self.ticket_update(m, matched_id, spam_msg): self.new_ticket(m, subject, spam_msg) else: ## No update by subject, so just create a new ticket # self.new_ticket(m, subject, spam_msg) ########## BODY TEXT functions ########################################################### def strip_signature(self, text): """ Strip signature from message, inspired by Mailman software """ self.logger.debug('function strip_signature: %s' %self.parameters.strip_signature_regex) body = [] STRIP_RE = re.compile( self.parameters.strip_signature_regex ) for line in text.splitlines(): match = STRIP_RE.match(line) if match: self.logger.debug('\t"%s " matched, skiping rest of message' %line) break body.append(line) return ('\n'.join(body)) def reflow(self, text, delsp = 0): """ Reflow the message based on the format="flowed" specification (RFC 3676) """ flowedlines = [] quotelevel = 0 prevflowed = 0 for line in text.splitlines(): from re import match ## Figure out the quote level and the content of the current line # m = match('(>*)( ?)(.*)', line) linequotelevel = len(m.group(1)) line = m.group(3) ## Determine whether this line is flowed # if line and line != '-- ' and line[-1] == ' ': flowed = 1 else: flowed = 0 if flowed and delsp and line and line[-1] == ' ': line = line[:-1] ## If the previous line is flowed, append this line to it # if prevflowed and line != '-- ' and linequotelevel == quotelevel: flowedlines[-1] += line ## Otherwise, start a new line # else: flowedlines.append('>' * linequotelevel + line) prevflowed = flowed return '\n'.join(flowedlines) def strip_quotes(self, text): """ Strip quotes from message by Nicolas Mendoza """ self.logger.debug('function strip_quotes: %s' %self.parameters.email_quote) body = [] STRIP_RE = re.compile( self.parameters.email_quote ) for line in text.splitlines(): try: match = STRIP_RE.match(line) if match: self.logger.debug('\t"%s " matched, skipping rest of message' %line) continue except UnicodeDecodeError: tmp_line = self.email_to_unicode(line) match = STRIP_RE.match(tmp_line) if match: self.logger.debug('\t"%s " matched, skipping rest of message' %line) continue body.append(line) return ('\n'.join(body)) def inline_properties(self, text): """ Parse text if we use inline keywords to set ticket fields """ self.logger.debug('function inline_properties') properties = dict() body = list() INLINE_EXP = re.compile('\s*[@]\s*(\w+)\s*:(.*)$') for line in text.splitlines(): match = INLINE_EXP.match(line) if match: keyword, value = match.groups() if self.parameters.inline_properties_first_wins: if keyword in self.properties.keys(): continue self.properties[keyword] = value.strip() self.logger.debug('\tinline properties: %s : %s' %(keyword,value)) else: body.append(line) return '\n'.join(body) def wrap_text(self, text, replace_whitespace = False): """ Will break a lines longer then given length into several small lines of size given length """ import textwrap LINESEPARATOR = '\n' reformat = '' for s in text.split(LINESEPARATOR): tmp = textwrap.fill(s, self.parameters.use_textwrap) if tmp: reformat = '%s\n%s' %(reformat,tmp) else: reformat = '%s\n' %reformat return reformat # Python2.4 and higher # #return LINESEPARATOR.join(textwrap.fill(s,width) for s in str.split(LINESEPARATOR)) # ########## EMAIL attachements functions ########################################################### def inline_part(self, part): """ """ self.logger.debug('function inline_part()') return part.get_param('inline', None, 'Content-Disposition') == '' or not part.has_key('Content-Disposition') def get_message_parts(self, msg, new_email=False): """ parses the email message and returns a list of body parts and attachments body parts are returned as strings, attachments are returned as tuples of (filename, Message object) """ self.logger.debug('function get_message_parts()') message_parts = list() ALTERNATIVE_MULTIPART = False for part in msg.walk(): content_maintype = part.get_content_maintype() content_type = part.get_content_type() self.logger.debug('\t Message part: Main-Type: %s' % content_maintype) self.logger.debug('\t Message part: Content-Type: %s' % content_type) ## Check content type # if content_type in self.STRIP_CONTENT_TYPES: self.logger.debug("\t A %s attachment named '%s' was skipped" %(content_type, part.get_filename())) continue ## Catch some mulitpart execptions # if content_type == 'multipart/alternative': ALTERNATIVE_MULTIPART = True continue ## Skip multipart containers # if content_maintype == 'multipart': self.logger.debug("\t Skipping multipart container") continue ## Check if this is an inline part. It's inline if there is co Cont-Disp header, # or if there is one and it says "inline" # inline = self.inline_part(part) ## Drop HTML message # if ALTERNATIVE_MULTIPART and self.parameters.drop_alternative_html_version: if content_type == 'text/html': self.logger.debug('\t Skipping alternative HTML message') ALTERNATIVE_MULTIPART = False continue #if self.VERSION < 1.0: # filename = part.get_filename() ## convert 7 bit filename to 8 bit unicode # raw_filename = part.get_filename() filename = self.email_to_unicode(raw_filename); s = '\t unicode filename: %s' %(filename) self.print_unicode(s) self.logger.debug('\t raw filename: %s' %repr(raw_filename)) if self.VERSION < 1.0: filename = self.check_filename_length(filename) ## Save all non plain text message as attachment # if not content_type in ['text/plain']: message_parts.append( (filename, part) ) ## We only convert html messages # if not content_type == 'text/html': self.logger.debug('\t Appending %s (%s)' %(repr(filename), content_type)) continue ## We have an text or html message # if not inline: self.logger.debug('\t Appending %s (%s), not an inline messsage part' %(repr(filename), content_type)) message_parts.append( (filename, part) ) continue ## Try to decode message part. We have a html or plain text messafe # body_text = part.get_payload(decode=1) if not body_text: body_text = part.get_payload(decode=0) ## Try to convert html message # if content_type == 'text/html': body_text = self.html_2_txt(body_text) if not body_text: continue format = email.Utils.collapse_rfc2231_value(part.get_param('Format', 'fixed')).lower() delsp = email.Utils.collapse_rfc2231_value(part.get_param('DelSp', 'no')).lower() if self.parameters.reflow and not self.parameters.verbatim_format and format == 'flowed': body_text = self.reflow(body_text, delsp == 'yes') if new_email and self.parameters.only_strip_on_update: self.logger.debug('Skip signature/quote stripping for new messages') else: if self.parameters.strip_signature: body_text = self.strip_signature(body_text) if self.parameters.strip_quotes: body_text = self.strip_quotes(body_text) if self.parameters.inline_properties: body_text = self.inline_properties(body_text) if self.parameters.use_textwrap: body_text = self.wrap_text(body_text) ## Get contents charset (iso-8859-15 if not defined in mail headers) # charset = part.get_content_charset() if not charset: charset = 'iso-8859-15' try: ubody_text = unicode(body_text, charset) except UnicodeError, detail: ubody_text = unicode(body_text, 'iso-8859-15') except LookupError, detail: ubody_text = 'ERROR: Could not find charset: %s, please install' %(charset) if self.parameters.verbatim_format: message_parts.append('{{{\r\n%s\r\n}}}' %ubody_text) else: message_parts.append('%s' %ubody_text) return message_parts def unique_attachment_names(self, message_parts): """ Make sure we have unique names attachments: - check if it contains illegal characters - Rename "None" filenames to "untitled-part" """ self.logger.debug('function unique_attachment_names()') renamed_parts = [] attachment_names = set() for item in message_parts: ## If not an attachment, leave it alone # if not isinstance(item, tuple): renamed_parts.append(item) continue (filename, part) = item ## If filename = None, use a default one # if filename in [ 'None']: filename = 'untitled-part' self.logger.info('\t Rename filename "None" to: %s' %filename) ## Guess the extension from the content type, use non strict mode # some additional non-standard but commonly used MIME types # are also recognized # ext = mimetypes.guess_extension(part.get_content_type(), False) if not ext: ext = '.bin' filename = '%s%s' % (filename, ext) ## Discard relative paths for windows/unix in attachment names # filename = filename.replace('\\', '_') filename = filename.replace('/', '_') ## remove linefeed char # for forbidden_char in ['\r', '\n']: filename = filename.replace(forbidden_char,'') ## We try to normalize the filename to utf-8 NFC if we can. # Files uploaded from OS X might be in NFD. # Check python version and then try it # #if sys.version_info[0] > 2 or (sys.version_info[0] == 2 and sys.version_info[1] >= 3): # try: # filename = unicodedata.normalize('NFC', unicode(filename, 'utf-8')).encode('utf-8') # except TypeError: # pass ## Make the filename unique for this ticket # num = 0 unique_filename = filename dummy_filename, ext = os.path.splitext(filename) while (unique_filename in attachment_names) or self.attachment_exists(unique_filename): num += 1 unique_filename = "%s-%s%s" % (dummy_filename, num, ext) s = '\t Attachment with filename %s will be saved as %s' % (filename, unique_filename) self.print_unicode(s) attachment_names.add(unique_filename) renamed_parts.append((filename, unique_filename, part)) return renamed_parts def attachment_exists(self, filename): self.logger.debug("function attachment_exists") s = '\t check if attachment already exists: Id : %s, Filename : %s' %(self.id, filename) self.print_unicode(s) ## Do we have a valid ticket id # if not self.id: return False try: if self.system == 'discussion': att = attachment.Attachment(self.env, 'discussion', 'ticket/%s' % (self.id,), filename) elif self.system == 'blog': att = attachment.Attachment(self.env, 'blog', '%s' % (self.id,), filename) else: att = attachment.Attachment(self.env, 'ticket', self.id, filename) return True except attachment.ResourceNotFound: return False ########## TRAC Ticket Text ########################################################### def get_body_text(self, message_parts): """ """ self.logger.debug('function get_body_text()') body_text = [] for part in message_parts: ## Plain text part, append it # if not isinstance(part, tuple): body_text.extend(part.strip().splitlines()) body_text.append("") continue (original, filename, part) = part inline = self.inline_part(part) ## Skip generation of attachment link if html is converted to text # if part.get_content_type() == 'text/html' and self.parameters.html2text_cmd and inline: s = 'Skipping attachment link for html part: %s' %(filename) self.print_unicode(s) continue if part.get_content_maintype() == 'image' and inline: if self.system != 'discussion': s = 'wiki image link for: %s' %(filename) self.print_unicode(s) body_text.append('[[Image(%s)]]' % filename) body_text.append("") else: if self.system != 'discussion': s = 'wiki attachment link for: %s' %(filename) self.print_unicode(s) body_text.append('[attachment:"%s"]' % filename) body_text.append("") ## Convert list body_texts to string # body_text = '\r\n'.join(body_text) return body_text def html_mailto_link(self, subject): """ This function returns a HTML mailto tag with the ticket id and author email address """ self.logger.debug("function html_mailto_link") if not self.author: author = self.email_addr else: author = self.author if not self.parameters.mailto_cc: self.parameters.mailto_cc = '' ## Bug in urllib.quote function # if isinstance(subject, unicode): subject = subject.encode('utf-8') ## use urllib to escape the chars # s = '%s?Subject=%s&cc=%s' %( self.email_addr, urllib.quote('Re: #%s: %s' %(self.id, subject)), urllib.quote(self.parameters.mailto_cc) ) s = '[mailto:"%s" Reply to: %s]' %(s, author) self.logger.debug("\tmailto link %s" %s) return s ########## TRAC notify section ########################################################### def notify(self, tkt, new=True, modtime=0): """ A wrapper for the TRAC notify function. So we can use templates """ self.logger.debug('function notify()') class Email2TracNotifyEmail(TicketNotifyEmail): def __init__(self, env): TicketNotifyEmail.__init__(self, env) self.email2trac_notify_reporter = None self.email2trac_replyto = None def send(self, torcpts, ccrcpts): #print 'Yes this works' dest = self.reporter or 'anonymous' hdrs = {} hdrs['Message-ID'] = self.get_message_id(dest, self.modtime) hdrs['X-Trac-Ticket-ID'] = str(self.ticket.id) hdrs['X-Trac-Ticket-URL'] = self.data['ticket']['link'] if not self.newticket: msgid = self.get_message_id(dest) hdrs['In-Reply-To'] = msgid hdrs['References'] = msgid if self.email2trac_notify_reporter: if not self.email2trac_notify_reporter in torcpts: torcpts.append(self.email2trac_notify_reporter) if self.email2trac_replyto: # use to rewrite reply to # hdrs does not work, multiple reply addresses #hdrs['Reply-To'] = 'bas.van.der.vlies@gmail.com' self.replyto_email = self.email2trac_replyto NotifyEmail.send(self, torcpts, ccrcpts, hdrs) if self.parameters.dry_run : self.logger.info('DRY-RUN: self.notify(tkt, True) reporter = %s' %tkt['reporter']) return try: tn = Email2TracNotifyEmail(self.env) ## additionally append sender (regardeless of settings in trac.ini) # if self.parameters.notify_reporter: self.logger.debug('\t Notify reporter set') if not self.email_header_acl('notify_reporter_black_list', self.email_addr, False): tn.email2trac_notify_reporter = self.email_addr if self.parameters.notify_replyto_rewrite: self.logger.debug('\t Notify replyto rewrite set to:%s' %self.parameters.notify_replyto_rewrite) if self.parameters.notify_replyto_rewrite in ['use_mail_domain']: self.logger.debug('\t\t use_mail_domain:%s' %self.smtp_default_domain) tn.email2trac_replyto = '%s@%s' %(self.id, self.smtp_default_domain ) elif self.parameters.notify_replyto_rewrite in ['use_trac_smtp_replyto']: self.logger.debug('\t\t use_trac_smtp_replyto delimiter:%s' %self.parameters.recipient_delimiter) ## handle addres with @ and without # dummy = self.smtp_replyto.split('@') if len(dummy) > 1: tn.email2trac_replyto = '%s%s%s@%s' %(dummy[0], self.parameters.recipient_delimiter, self.id, dummy[1]) else: tn.email2trac_replyto = '%s%s%s' %(dummy[0], self.parameters.recipient_delimiter, self.id) if self.parameters.alternate_notify_template: if self.VERSION >= 0.12: from trac.web.chrome import Chrome if self.parameters.alternate_notify_template_update and not new: tn.template_name = self.parameters.alternate_notify_template_update else: tn.template_name = self.parameters.alternate_notify_template tn.template = Chrome(tn.env).load_template(tn.template_name, method='text') else: tn.template_name = self.parameters.alternate_notify_template tn.notify(tkt, new, modtime) except Exception, e: self.logger.error('Failure sending notification on creation of ticket #%s: %s' %(self.id, e)) ########## END Class Definition ######################################################## ########## Parse Config File ########################################################### def ReadConfig(file, name): """ Parse the config file """ if not os.path.isfile(file): print 'File %s does not exist' %file sys.exit(1) config = trac_config.Configuration(file) parentdir = config.get('DEFAULT', 'parentdir') sections = config.sections() ## use some trac internals to get the defaults # tmp = config.parser.defaults() project = SaraDict() for option, value in tmp.items(): try: project[option] = int(value) except ValueError: project[option] = value if name: if name in sections: project = SaraDict() for option, value in config.options(name): try: project[option] = int(value) except ValueError: project[option] = value elif not parentdir: print "Not a valid project name: %s, valid names are: %s" %(name, sections) print "or set parentdir in the [DEFAULT] section" sys.exit(1) ## If parentdir then set project dir to parentdir + name # if not project.has_key('project'): if not parentdir: print "You must set project or parentdir in your configuration file" sys.exit(1) elif not name: print "You must configure a project section in your configuration file" else: project['project'] = os.path.join(parentdir, name) ## # Save the project name # project['project_name'] = os.path.basename(project['project']) return project ########## Setup Logging ############################################################### def setup_log(parameters, project_name, interactive=None): """ Setup logging Note for log format the usage of `$(...)s` instead of `%(...)s` as the latter form would be interpreted by the ConfigParser itself. """ logger = logging.getLogger('email2trac %s' %project_name) if interactive: parameters.log_type = 'stderr' if not parameters.log_type: if sys.platform in ['win32', 'cygwin']: parameters.log_type = 'eventlog' else: parameters.log_type = 'syslog' if parameters.log_type == 'file': if not parameters.log_file: parameters.log_file = 'email2trac.log' if not os.path.isabs(parameters.log_file): parameters.log_file = os.path.join(tempfile.gettempdir(), parameters.log_file) log_handler = logging.FileHandler(parameters.log_file) elif parameters.log_type in ('winlog', 'eventlog', 'nteventlog'): ## Requires win32 extensions # logid = "email2trac" log_handler = logging.handlers.NTEventLogHandler(logid, logtype='Application') elif parameters.log_type in ('syslog', 'unix'): log_handler = logging.handlers.SysLogHandler('/dev/log') elif parameters.log_type in ('stderr'): log_handler = logging.StreamHandler(sys.stderr) else: log_handler = logging.handlers.BufferingHandler(0) if parameters.log_format: parameters.log_format = parameters.log_format.replace('$(', '%(') else: parameters.log_format = '%(name)s: %(message)s' if parameters.log_type in ('file', 'stderr'): parameters.log_format = '%(asctime)s ' + parameters.log_format log_formatter = logging.Formatter(parameters.log_format) log_handler.setFormatter(log_formatter) logger.addHandler(log_handler) if (parameters.log_level in ['DEBUG', 'ALL']) or (parameters.debug > 0): logger.setLevel(logging.DEBUG) parameters.debug = 1 elif parameters.log_level in ['INFO'] or parameters.verbose: logger.setLevel(logging.INFO) elif parameters.log_level in ['WARNING']: logger.setLevel(logging.WARNING) elif parameters.log_level in ['ERROR']: logger.setLevel(logging.ERROR) elif parameters.log_level in ['CRITICAL']: logger.setLevel(logging.CRITICAL) else: logger.setLevel(logging.INFO) return logger ########## Debug functions ########################################################################### def debug_trac_email_settings(parameters, logger): """ Print the various values found in trac.ini, notification/announcer section """ logger.debug("This email settings are set via trac.ini") logger.debug("\t trac_smtp_from : %s" %parameters.trac_smtp_from) logger.debug("\t smtp_default_domain : %s" %parameters.smtp_default_domain) logger.debug("\t smtp_replyto : %s" %parameters.smtp_replyto) logger.debug("\t trac_smtp_always_cc : %s" %parameters.trac_smtp_always_cc) logger.debug("\t trac_smtp_always_bcc : %s" %parameters.trac_smtp_always_bcc) ########## Own TicketNotifyEmail class ############################################################### if __name__ == '__main__': ## Default config file # agilo = False bh_product = None configfile = '@email2trac_conf@' project = '' component = '' ticket_prefix = 'default' dry_run = None verbose = None debug_interactive = None virtualenv = '@virtualenv@' SHORT_OPT = 'AB:cdE:hf:np:t:v' LONG_OPT = ['agilo', 'bh_product=', 'component=', 'debug', 'dry-run', 'help', 'file=', 'project=', 'ticket_prefix=', 'virtualenv=', 'verbose'] try: opts, args = getopt.getopt(sys.argv[1:], SHORT_OPT, LONG_OPT) except getopt.error,detail: print __doc__ print detail sys.exit(1) project_name = None for opt,value in opts: if opt in [ '-h', '--help']: print __doc__ sys.exit(0) elif opt in ['-A', '--agilo']: agilo = True elif opt in ['-B', '--bh_product']: bh_product = value elif opt in ['-c', '--component']: component = value elif opt in ['-d', '--debug']: debug_interactive = 1 elif opt in ['-E', '--virtualenv']: virtualenv = value elif opt in ['-f', '--file']: configfile = value elif opt in ['-n', '--dry-run']: dry_run = True elif opt in ['-p', '--project']: project_name = value elif opt in ['-t', '--ticket_prefix']: ticket_prefix = value elif opt in ['-v', '--verbose']: verbose = True if virtualenv and os.path.exists(virtualenv): activate_this = os.path.join(virtualenv, 'bin/activate_this.py') if os.path.exists(activate_this): execfile(activate_this, dict(__file__=activate_this)) try: from trac import __version__ as trac_version from trac import config as trac_config except ImportError, detail: print detail print "Can not find a a valid trac installation, solutions could be:" print "\tset PYTHONPATH" print "\tuse the --virtualenv option" sys.exit(1) settings = ReadConfig(configfile, project_name) ## The default prefix for ticket values in email2trac.conf # settings.ticket_prefix = ticket_prefix settings.dry_run = dry_run settings.verbose = verbose if bh_product: settings.bh_product = bh_product if not settings.debug and debug_interactive: settings.debug = debug_interactive if not settings.project: print __doc__ print 'No Trac project is defined in the email2trac config file.' sys.exit(1) logger = setup_log(settings, os.path.basename(settings.project), debug_interactive) if component: settings['component'] = component ## We are only interested in the major versions # 0.12.3 --> 0.12 # 1.0.2 --> 1.0 # l = trac_version.split('.') version = '.'.join(l[0:2]) logger.debug("Found trac version: %s" %(version)) try: if version in ['0.12', '0.13', '1.0', '1.1', '1,2' ]: from trac import attachment from trac import config as trac_config from trac import util from trac.core import TracError from trac.env import Environment from trac.perm import PermissionSystem from trac.perm import PermissionCache from trac.test import Mock, MockPerm from trac.ticket.api import TicketSystem from trac.ticket.web_ui import TicketModule from trac.web.href import Href try: import pkg_resources pkg = pkg_resources.get_distribution('BloodhoundMultiProduct') bloodhound = pkg.version.split()[:2] except pkg_resources.DistributionNotFound: # assume no bloodhound bloodhound = None if bloodhound: from multiproduct.env import Environment, ProductEnvironment from multiproduct.ticket.web_ui import (ProductTicketModule as TicketModule) logger.debug("Found Bloodhound Distribution") if not settings.bh_product: print __doc__ print 'No Bloodhound project defined (bh_project) in section:%s email2trac config file.' %(settings.project) sys.exit(1) if agilo: try: from agilo.ticket.model import AgiloTicket as Ticket except ImportError, detail: try: from agilo.ticket.model import Ticket except ImportError, detail: logger.error('Could not find Trac Agilo environemnt') sys.exit(0) else: from trac.ticket import Ticket # # return util.text.to_unicode(str) # # see http://projects.edgewall.com/trac/changeset/2799 from trac.ticket.notification import TicketNotifyEmail from trac.notification import NotifyEmail else: logger.error('TRAC version %s is not supported' %version) sys.exit(0) ## Must be set before environment is created # if settings.has_key('python_egg_cache'): python_egg_cache = str(settings['python_egg_cache']) os.environ['PYTHON_EGG_CACHE'] = python_egg_cache if settings.debug > 0: logger.debug('Loading environment %s', settings.project) try: env = Environment(settings['project'], create=0) if bloodhound: ## possibly overkill testing if the multiproduct schema is a # new enough version # from multiproduct.env import MultiProductSystem mps = MultiProductSystem(env) if mps.get_version() > 4: try: env = ProductEnvironment(env, settings.bh_product, create=0) except LookupError: logger.error('%s is not a valid Bloodhound' %settings.bh_product) sys.exit(0) except IOError, detail: logger.error("trac error: %s" %detail) sys.exit(0) except TracError, detail: logger.error("trac error: %s" %detail) sys.exit(0) tktparser = TicketEmailParser(env, settings, logger, float(version)) if settings.debug > 0: debug_trac_email_settings(tktparser, logger) tktparser.parse(sys.stdin) ## Catch all errors and use the logging module # except Exception, error: etype, evalue, etb = sys.exc_info() for e in traceback.format_exception(etype, evalue, etb): logger.critical(e) if m: tktparser.save_email_for_debug(m, settings.project_name) sys.exit(1) # EOB email2trac-2.10.0/email2trac.spec0000644007443000744420000000227613012622127014630 0ustar basbasSummary: Utilities for converting emails to trac tickets Name: email2trac Version: 2.10.0 Release: 1 License: Apache License 2.0 Group: Applications/Internet URL: https://oss.trac.surfsara.nl/email2trac Packager: Jon Topper Source: ftp://ftp.surfsara.nl/pub/outgoing/email2trac.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires: trac %description This is a release of the SURFsara package email2trac that contains utilities that we use to convert emails to trac tickets. The initial setup was made by Daniel Lundin from Edgewall Software. SURFsara has extend the initial setup, with the following extensions: * HTML messages * Attachments * Use commandline options * Use config file to change the behaviour of the email2trac.py program * Some unicode support for special characters in the headers of an email message %prep rm -rf $RPM_BUILD_ROOT %setup %configure %build mkdir -p $RPM_BUILD_ROOT make %install make DESTDIR="$RPM_BUILD_ROOT" install %files /usr/bin/delete_spam /usr/bin/email2trac /usr/bin/run_email2trac %config /etc/email2trac.conf %changelog * Thu Aug 03 2006 Jon Topper - 0.7.6-1 - Initial RPM build email2trac-2.10.0/install-sh0000755007443000744420000001124413012622127013730 0ustar basbas#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 email2trac-2.10.0/msg.txt0000755007443000744420000000307613012622127013262 0ustar basbasFrom bas.vandervlies@surfsara.nl Wed Mar 8 15:29:17 2006 Return-Path: X-Original-To: test@subtrac.sara.nl Delivered-To: test@subtrac.sara.nl Received: from surfboard.ka.sara.nl (surfboard.ka.sara.nl [145.100.6.3]) by localhost.localdomain (Postfix) with ESMTP id 506702800682 for ; Wed, 8 Mar 2006 15:29:17 +0100 (CET) Received: from [145.100.6.134] ([145.100.6.134] RDNS failed) by surfboard.ka.sara.nl with Microsoft SMTPSVC(6.0.3790.1830); Wed, 8 Mar 2006 15:29:17 +0100 Message-ID: <440EEA39.6070200@sara.nl> Date: Wed, 08 Mar 2006 15:29:13 +0100 From: Bas van der Vlies User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: test@subtrac.sara.nl Subject: Test123 Content-Type: multipart/mixed; boundary="------------070800080005060203060809" X-OriginalArrivalTime: 08 Mar 2006 14:29:17.0140 (UTC) FILETIME=[AE40B940:01C642BC] This is a multi-part message in MIME format. --------------070800080005060203060809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Test1234 Test1234 --- As of 1 January 2013, SARA has a new name: SURFsara. Bas van der Vlies | Operations, Support & Development | SURFsara | Science Park 140 | 1098 XG Amsterdam | T +31 (0) 20 592 30 00 | bas.vandervlies@surfsara.nl | www.surfsara.nl | --------------070800080005060203060809 Content-Type: text/plain; name="basje.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="basje.txt" test123 test1234 --------------070800080005060203060809-- email2trac-2.10.0/release.json0000644007443000744420000000062413012622127014237 0ustar basbas{ "version": "2.9.0", "changes": "Support for discussionplugin 0.9dev and drop support for earlier versions, Added support for trac 1.1 and dropped support for trac version 0.10 and 0.11. Added suppport for announcer plugin and that each ticket has its own replyto address", "state": "stable", "scope": "bug fixes", "download": "ftp://ftp.surfsara.nl/pub/outgoing/email2trac-2.9.0.tar.gz" } email2trac-2.10.0/run_email2trac.c0000644007443000744420000001150513012622127014777 0ustar basbas/* run_email2trac.c Authors: Bas van der Vlies, Walter de Jong and Michel Jouvin SVN Info: $Id$ Only nobody can become the user www-data. Postfix uses this user to start an program Copyright 2002 SURFsara Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "config.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_INITGROUPS #include #endif #include "run_email2trac.h" #ifndef DEBUG #define DEBUG 0 #endif void check_username(char *name) { if ( strlen(name) > 30 ) { openlog("run_email2trac", LOG_PID, LOG_MAIL); syslog(LOG_ERR, "MTA_USERNAME is to large; %s\n", name); closelog(); exit(-1); } } void email2trac_log(char *message) { openlog("run_email2trac", LOG_PID, LOG_MAIL); syslog(LOG_ERR, "%s", message); closelog(); } int main(int argc, char** argv) { int i,j; int caller = getuid(); int status; char **trac_script_args; char *python_egg_cache = NULL; struct passwd *TRAC; struct passwd *MTA; struct stat script_attrs; const char *trac_script = TRAC_SCRIPT_PATH "/" TRAC_SCRIPT_NAME; char error_msg[1024]; /* printf("trac_script = %s\n", trac_script); */ /* First copy arguments passed to the wrapper as scripts arguments aft er filtering out some of the possible script options */ trac_script_args = (char**) malloc((argc+1)*sizeof(char*)); if (trac_script_args == NULL) { snprintf(error_msg, sizeof(error_msg), "malloc failed"); email2trac_log(error_msg); return 1; } trac_script_args[0] = TRAC_SCRIPT_NAME; for (i=j=1; ipw_uid ) { snprintf(error_msg, sizeof(error_msg), "Invalid caller UID (%d)", caller); email2trac_log(error_msg); return -2; /* 254 : Invalid caller */ } /* set UID/GID and supplementary groups to be Trac (or apache) user */ check_username(TRAC_USER); if ( TRAC = getpwnam(TRAC_USER) ) { #ifdef HAVE_INITGROUPS if (initgroups(TRAC_USER, TRAC->pw_gid)) { snprintf(error_msg, sizeof(error_msg), "initgroups failed"); email2trac_log(error_msg); return -7; /* 249 : Can't set supplementary groups */ } #endif if (setgid(TRAC->pw_gid) || setuid(TRAC->pw_uid)) { snprintf(error_msg, sizeof(error_msg), "setgid or setuid failed"); email2trac_log(error_msg); return -5; /* 251: Can't set gid or uid */ } } else { snprintf(error_msg, sizeof(error_msg), "Invalid Trac user (%s)", TRAC_USER); email2trac_log(error_msg); return -6; /* 250 : Trac user not found */ } /* Check that script exists */ if ( stat(trac_script,&script_attrs) ) { snprintf(error_msg, sizeof(error_msg), "Script not found (%s)", trac_script); email2trac_log(error_msg); return -4; /* 252 : script not found */ } /* Set PYTHON_EGG_CACHE env variable if we have been told to do so */ if ( python_egg_cache != NULL ) { setenv("PYTHON_EGG_CACHE",python_egg_cache ,1); } /* Execute script */ status = execv(trac_script, trac_script_args); /* should never reach this point */ snprintf(error_msg, sizeof(error_msg), "Script %s execution failure (error=%d). Check permission and interpreter path.", trac_script, status); email2trac_log(error_msg); return -1; } /* EOB */ email2trac-2.10.0/run_email2trac.h0000644007443000744420000000210713012622127015002 0ustar basbas/* SVN Info: $Id$ Local site configuration Value defined here are just default values than can be overriden at compile time See Makefile. Copyright 2002 SURFsara Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* User the MTA is running under */ #ifndef MTA_USER #define MTA_USER "nobody" #endif /* A user with write access to Trac DB */ #ifndef TRAC_USER #define TRAC_USER "www-data" #endif /* email2trac script name and path */ #ifndef TRAC_SCRIPT_NAME #define TRAC_SCRIPT_NAME "email2trac" #endif #ifndef TRAC_SCRIPT_PATH #define TRAC_SCRIPT_PATH "/usr/bin" #endif