[Erp5-report] r12744 - in /spec/debian/erp5-cmfmailin: ./ CMFMailIn/ CMFMailIn/debian/ CMFM...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 15 17:46:43 CET 2007


Author: yusei
Date: Thu Feb 15 17:46:39 2007
New Revision: 12744

URL: http://svn.erp5.org?rev=12744&view=rev
Log:
commit debian(unstable) packages.

Added:
    spec/debian/erp5-cmfmailin/
    spec/debian/erp5-cmfmailin/CMFMailIn/
    spec/debian/erp5-cmfmailin/CMFMailIn/INSTALL.txt
    spec/debian/erp5-cmfmailin/CMFMailIn/LICENSE.txt
    spec/debian/erp5-cmfmailin/CMFMailIn/MailIn_Tool.py
    spec/debian/erp5-cmfmailin/CMFMailIn/MailMessage.py
    spec/debian/erp5-cmfmailin/CMFMailIn/README.txt
    spec/debian/erp5-cmfmailin/CMFMailIn/VERSION.txt
    spec/debian/erp5-cmfmailin/CMFMailIn/__init__.py
    spec/debian/erp5-cmfmailin/CMFMailIn/debian/
    spec/debian/erp5-cmfmailin/CMFMailIn/help/
    spec/debian/erp5-cmfmailin/CMFMailIn/sendMailToZope.py
    spec/debian/erp5-cmfmailin/CMFMailIn/skins/
    spec/debian/erp5-cmfmailin/CMFMailIn/tests/
    spec/debian/erp5-cmfmailin/CMFMailIn/tool.gif   (with props)
    spec/debian/erp5-cmfmailin/CMFMailIn/www/
    spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.diff.gz   (with props)
    spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.dsc
    spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_all.deb   (with props)
    spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.build
    spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.changes
    spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0.orig.tar.gz   (with props)

Added: spec/debian/erp5-cmfmailin/CMFMailIn/INSTALL.txt
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/INSTALL.txt?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/INSTALL.txt (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/INSTALL.txt Thu Feb 15 17:46:39 2007
@@ -1,0 +1,171 @@
+Introduction
+
+    This is the first release version of CMFMailIn, which allows you to
+    email into CMF.  Each email that is sent to known CMF instance
+    arrives in the CMF ready to be processed by your own methods or scripts.
+    
+
+Status
+
+    This is a release version and is actually in use by NIP.
+    This release has been tested using the eXtreme Programming
+    ( "XP":http://www.extremeprogramming.org/ ) methodology
+    and NIP's in-house product testing system.
+    There are also unittests for the CMFMailIn Tool and the MailMessage
+    content type.
+    It is intended for people who wish to be able to get emails in to their own
+    CMF Instances.
+
+    We've split the problem into a number of aspects:
+    
+      - Getting the email from the mail system into a world we can program 
+        (Python).
+      
+      - Getting the mail into CMF.
+      
+      - Figuring out what to do with the mail once it is in CMF.
+      
+    As we are targetting Unix (specifically Linux) we can get the MTA (Exim, or
+    Sendmail, or most other MTAs) to send mail for a particular address to a
+    script.
+    
+    The setup has been developed and lightly tested using:
+    
+      - Zope 2.5.1 running on Linux (Mandrake 8.1).
+      
+      - Exim 3.14 as the mail transport. You can find more information about
+        Exim at http://www.exim.org/. We believe it should also work with
+        sendmail (the MTA normally found on Linux) but haven't tested it.
+        
+
+Contents
+
+    CMFMailIn is provided as a single tar archive. It contains the
+    CMFMailIn Tool, MailMessage Content Type and sendMailToZope.py script
+
+
+Installation
+
+    (In the following instructions, Zope_Home means your Zope directory, for
+     example, */usr/local/zope*.)
+
+
+    1. Extract CMFMailIn-*.tgz to your Zope_Home directory using
+       *tar zxvf CMFMailIn-*.tgz*	          
+       
+    2. Change the first line of
+       *Zope_Home/lib/python/Products/CMFMailIn/sendMailToZope.py*
+       to reflect your python location (*whereis python*).
+
+    3. Make sure your MTA has permission to execute sendMailToZope.py
+
+       To check this, try it, for example if your MTA runs as the user
+       mail, do 
+       *su - mail* 
+       and then
+       *./sendMailToZope.py*
+  
+       *chmod a+x sendMailToZope.py*
+       should fix any access problems, but don't forget to give your MTA
+       permission to access the directory
+       *Zope_Home/lib/python/Products/CMFMailIn/*
+       as well.
+
+    4. Make sure your MTA (in our case, Exim) will deliver email to a program.
+       For Exim this means assuming Exim is installed and working you need to:
+       
+       a. Make sure that 'pipe transports' are enabled.
+       
+          Check */etc/exim.conf* for a section in transports like::
+          
+                address_pipe:
+                   driver = pipe
+                   user = mail
+                   return_output
+
+          This is usually found in the default exim.conf file.
+          To make CMFMailIn work for mailing lists add this line::
+                
+                  envelope_to_add = true
+                    
+          This forces Exim to add the 'envelope-to' to the headers
+          of the mail message.
+
+       b. Make sure that there is a director set up to handle pipes.
+
+          This will be in the same config file in the Directors section and will
+          look something like::
+          
+                  pipe_transport = address_pipe
+
+          Again, this is already present in the default setup.
+
+       c. Make sure that local_domains is configured to deliver local mail to 
+          the host machine.
+
+          So, if your mail addresses are of the form *recipient at foo.bar.baz*
+          then you should have::
+          
+                  local_domains = foo.bar.baz
+  
+       d. Restart Exim
+          (this step may not be needed for machines running Sendmail).
+
+    5. In the file /etc/aliases set up the appropriate pipe alias.
+       You also need to supply the location of your CMF instance as the
+       first arguement to this method.  You will need to include any
+       username and password authentication.
+
+       For example - a line such as::
+
+           recipient:   "|Zope_Home/lib/python/Products/CMFMailIn/sendMailToZope.py http://username:password@www.myserver.com/CMFInstance/"
+          
+    6. Restart Zope.
+
+    7. Create a CMFMailIn Tool in you CMF Site.
+      
+       From the add list select "CMFMailIn Tool".
+       Then Tick "CMFMail In Tool" and Click 'Add'
+    
+    8. Add the CMFMailIn skins to your portal_skins tool
+    
+       In the portal_skins tool, select from the add list 
+       "Filesystem Directory View"
+       
+       In the 'directory' field select "Products/CMFMailIn/skins/mailin",
+       leave the 'id' field empty and click 'add'
+    
+    9. Add the MailMessage content type to your portal_types
+    
+       In the portal_types tool, select from the add list
+       "Factory-based Type Information"
+       
+       Leave the 'id' field blank and in the 'use default type information'
+       field select 'CMFMailIn: CMFMailMessage', then click 'add'
+    
+   10. In the 'mailin' skin there is a default method that will handle all
+       mail messages coming in to the CMF Instance.
+       
+       This method is called 'mail_received'.
+       
+       The default mail_received method will take the local part of the
+       destination email address of the mail message.
+       (i.e. the localpart of 'andyd at nipltd.com' is 'andyd')
+       It will look for a Member Folder with the id equal to this localpart.
+       If it finds the member folder it will create a MailMessage content
+       type instance in the member folder with the id equal to the mail message's
+       message-id header, and the content of the file will be the content of
+       the email.
+
+       You can, and i advise you to write your own mail_received script that
+       will handle the incoming mail messages in a way that you see fit.
+       
+   11. To test the system send a mail to the address that you have configured
+       in your MTA.
+       (for example recipient at foo.bar.baz) and it should appear in your CMF.
+
+Support
+
+  This was written by a number of people at NIP. For help with this release
+  contact
+  "New Information Paradigms Ltd - ZMailIn Support", mailto:zmailin-support at groups.nipltd.com

Added: spec/debian/erp5-cmfmailin/CMFMailIn/LICENSE.txt
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/LICENSE.txt?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/LICENSE.txt (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/LICENSE.txt Thu Feb 15 17:46:39 2007
@@ -1,0 +1,37 @@
+License
+
+  Copyright (c) 2000 New Information Paradigms Ltd. http://www.nipltd.com/
+  All rights reserved.  
+
+  Redistribution and use of source and binary forms, with or without 
+  modification, are permitted provided that the following conditions 
+  are met: 
+    
+  1. Redistributions of source code must retain the above copyright 
+     notice, this list of conditions and the following disclaimer. 
+       
+  2. Redistributions in binary form must reproduce the above copyright 
+     notice, this list of conditions and the following disclaimer in the 
+     documentation and/or other materials provided with the distribution. 
+       
+  3. The name of the author may not be used to endorse or promote products 
+     derived from this software without specific prior written permission. 
+
+  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 
+  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
+  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 
+  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
+  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+  
+   In accordance with the license provided for by the software upon 
+   which some of the source code has been derived or used, the following  
+   acknowledgement is hereby provided : 
+
+       "This product includes software developed by Digital Creations 
+       for use in the Z Object Publishing Environment 
+       (http://www.zope.org/)." 

Added: spec/debian/erp5-cmfmailin/CMFMailIn/MailIn_Tool.py
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/MailIn_Tool.py?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/MailIn_Tool.py (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/MailIn_Tool.py Thu Feb 15 17:46:39 2007
@@ -1,0 +1,172 @@
+# Mail in tool for the CMF
+
+from Globals import InitializeClass
+from AccessControl import ClassSecurityInfo
+from OFS.SimpleItem import SimpleItem
+from Products.CMFCore import CMFCorePermissions
+from Products.CMFCore.utils import UniqueObject
+from Products.CMFCore.utils import getToolByName
+from Products.CMFCore.DirectoryView import createDirectoryView
+from Products.PageTemplates.PageTemplateFile import PageTemplateFile
+import string, rfc822, multifile, StringIO, mimetools, re, os
+
+mailin_globals = {}
+
+class MailInTool (UniqueObject, SimpleItem):
+    """ a mail in tool for handling mail coming in to the portal """
+    id = 'portal_mailin'
+    meta_type= 'CMF Mail In Tool'
+    security = ClassSecurityInfo()
+
+    manage_options = ( ({ 'label' : 'Overview', 'action' : 'manage_overview' }
+                     ,  { 'label' : 'Configure', 'action' : 'manage_configure' }
+                     ,
+                     ) + SimpleItem.manage_options
+                     )
+    
+    #
+    #   ZMI methods
+    #
+    security.declareProtected( CMFCorePermissions.ManagePortal ,
+                               'manage_overview' )
+    manage_overview = PageTemplateFile('www/explainMailInTool', globals(),
+                               __name__='manage_overview')
+    
+    security.declareProtected( CMFCorePermissions.ManagePortal
+                             , 'manage_configure' )    
+    manage_configure = PageTemplateFile('www/configureMailInTool', globals(),
+                                   __name__='manage_configure')    
+    
+   
+    def __init__(self): 
+        self.method = 'mail_received'
+    
+    security.declarePublic('setup_skins')
+    def setup_skins(self):
+        """ Sets up the mailin_tool skin """
+        skinstool=getToolByName(self, 'portal_skins')
+        try:
+            createDirectoryView( skinstool, os.path.join('Products','CMFMailIn','skins','mailin')) 
+        except:
+            pass
+        
+        skinpaths = skinstool.getSkinPaths()
+        for skin in skinpaths:
+            paths = map(string.strip, string.split(skin[1],','))
+            if not 'mailin' in paths:
+                paths.append('mailin')
+                skinstool.addSkinSelection(skin[0], string.join( paths, ', '))
+        
+        # add the content type to the portal_types tool
+        typestool=getToolByName(self, 'portal_types')
+        typestool.manage_addTypeInformation(id=None, add_meta_type="Factory-based Type Information", typeinfo_name="CMFMailIn: CMF MailMessage")
+                
+        return "The mailin skins have been setup"
+    
+    security.declareProtected( CMFCorePermissions.ManagePortal
+                             , 'edit_configuration' )
+    def edit_configuration(self, method):
+        """ Change the configuration of the mailin tool """
+        self.method = method
+        if hasattr(self.REQUEST, 'RESPONSE'):
+            self.REQUEST.RESPONSE.redirect('manage_configure')
+
+    security.declarePublic('getMethodName')
+    def getMethodName(self):
+        """ Returns the name of the method called when mail arrives """
+        return self.method
+    
+    security.declarePublic( 'postMailMessage' )
+    def postMailMessage(self, file=None):
+        """
+        This method will create a dictionary containing all the information about the Mail Message
+        The dictionary is then handed to the method stated in self.method for processing
+        """
+       
+        if not file:
+            raise IOError, 'No Mail Message Supplied'
+        
+        sio = StringIO.StringIO(file)  # Put it in a StringIO so we can play with it over and over
+        m = rfc822.Message(sio)  # Render the message through rfc822 so we can get the headers
+        sio.seek(0)
+
+        theMail = {}  # A New Dictionary
+        
+        # Place all the email header in the headers dictionary in theMail
+        headers = theMail['headers'] = {}
+        for (name,value) in m.items():
+            headers[name]=value
+        
+        # put localpart in theMail
+        address_to = headers.get('envelope-to',headers.get('to',''))
+        if not address_to:
+            raise KeyError,'neither envelope-to or to found in supplied the mail message header'
+
+        theMail['localpart'] = self._getLocalPart(address_to)
+         
+        # Process mime encoded mail messages
+        mf = multifile.MultiFile(sio,0)
+        theMail['attachments'] = {}
+        self._unpack_part(theMail,mf,1)
+
+        try:
+            portal_url = self.portal_url.getPortalPath()
+            if portal_url[-1]!='/': portal_url=portal_url+'/'
+        except:
+            portal_url = ''
+            
+        if self.method:
+            return self.restrictedTraverse(portal_url+self.method)(theMail=theMail)
+        
+        self.REQUEST.RESPONSE.notFoundError('MailIn method not specified')
+
+
+    security.declarePrivate( '_unpack_part' )
+    def _unpack_part(self,theMail, file, partno):
+        # Will unpack a multipart message in the MIME format and enter it in to
+        # the dictionary theMail
+
+        headers = mimetools.Message(file)
+        type = headers.getmaintype()
+        if type == 'multipart':
+            boundary = headers.getparam("boundary")
+            file.push(boundary)
+            file.readlines()
+            while not file.last:
+                file.next()
+                partno = partno + 1
+                self._unpack_part(theMail, file, partno)
+            file.pop()
+            return
+
+        name = headers.getparam("name")
+        subtype = headers.getsubtype()
+        if type=='text' and subtype=='plain' and not name:
+            # overwrite the body so that we get _only_ the body text.
+            # (Uses the plain version of the body in all situations.
+            #  HTML formated body will be in the attachments dictionary)
+            theMail['body'] = file.read()
+        else:
+            if not name:
+                name = 'part%d' % (partno,)
+                name = name + '-'+subtype
+
+            encoding = headers.getencoding()
+
+
+            outfile = StringIO.StringIO()
+            if encoding == '7bit':
+                mimetools.copyliteral(file,outfile)
+            else:
+                mimetools.decode(file,outfile,encoding)
+
+            theMail['attachments'][name]=outfile.getvalue()
+            outfile.close()
+
+    def _getLocalPart(self, address):
+        str1 = address[:string.find(address,'@')]
+        if string.find(str1,'<')>-1:
+            return str1[string.find(str1,'<')+1:]
+        return str1            
+            
+InitializeClass(MailInTool)    

Added: spec/debian/erp5-cmfmailin/CMFMailIn/MailMessage.py
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/MailMessage.py?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/MailMessage.py (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/MailMessage.py Thu Feb 15 17:46:39 2007
@@ -1,0 +1,151 @@
+from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
+from Products.CMFCore.PortalContent import PortalContent
+from Products.CMFCore.WorkflowCore import WorkflowAction
+from AccessControl import ClassSecurityInfo
+from Products.CMFCore import CMFCorePermissions
+import string
+
+factory_type_information = (
+    {'id': 'MailMessage',
+     'content_icon': 'mail.png',
+     'meta_type': 'CMF MailMessage',
+     'description': ('MailMessages are object that store mail messages'
+                     'that have arrived in the Portal'),
+     'product': 'CMFMailIn',
+     'factory': 'addMailMessage',
+     'immediate_view': 'mailmessage_view',
+     'actions': ({'id': 'view',
+                  'name': 'View',
+                  'action': 'mailmessage_view',
+                  'permissions': (CMFCorePermissions.View,)},)
+     },
+    )
+                            
+def addMailMessage(self,
+                   id,
+                   title = '',
+                   subject = '',
+                   date = '',
+                   to = '',
+                   sender = '',
+                   replyto = '',
+                   body = '',
+                   headers = '',
+                   otherInfo = '',
+                   attachments = {},
+                   REQUEST = None,
+                   **kw):
+    
+    """
+    Create an empty MailMessage.
+    """
+    mm = MailMessage(id,
+                     title,
+                     subject,
+                     date,
+                     to,
+                     sender,
+                     replyto,
+                     body,
+                     headers,
+                     otherInfo,
+                     attachments,
+                     **kw
+                     )
+    self._setObject(id, mm)
+    
+
+class MailMessage(PortalContent, DefaultDublinCoreImpl):
+    """
+    MailMessage is a Mail Message. Pretty obvious really
+    """
+    meta_type='CMF MailMessage'
+
+    # Declarative security
+    security = ClassSecurityInfo()
+    security.declareObjectProtected(CMFCorePermissions.View)
+
+    def __init__(self,
+                 id,
+                 title = '',
+                 subject = '',
+                 date = '',
+                 to = '',
+                 sender = '',
+                 replyto = '',
+                 body = '',
+                 headers = '',
+                 otherInfo = '',
+                 attachments = {},
+                 **kw
+                 ):
+
+        DefaultDublinCoreImpl.__init__(self)
+        self.id=id
+        self.setTitle(title)
+        self.setSubject(subject)
+        self.date = date
+        self.to = to
+        self.sender = sender
+        self.replyto = replyto
+        self.body = body
+        self.headers = headers
+        self.otherInfo = otherInfo
+        self.attachments = attachments
+
+    security.declareProtected(CMFCorePermissions.View, 'Subject')        
+    def Subject(self):
+        return string.join(self.subject,' ')
+
+    security.declareProtected(CMFCorePermissions.View, 'Date')        
+    def Date(self):
+        return self.date
+    
+    security.declareProtected(CMFCorePermissions.View, 'To')        
+    def To(self):
+        return self.to
+
+    security.declareProtected(CMFCorePermissions.View, 'Sender')
+    def Sender(self):
+        return self.sender
+
+    security.declareProtected(CMFCorePermissions.View, 'ReplyTo')
+    def ReplyTo(self):
+        return self.replyto
+
+    security.declareProtected(CMFCorePermissions.View, 'Body')
+    def Body(self):
+        return self.body
+
+    security.declareProtected(CMFCorePermissions.View, 'Headers')
+    def Headers(self):
+        return self.headers
+
+    security.declareProtected(CMFCorePermissions.View, 'OtherInfo')
+    def OtherInfo(self):
+        return self.otherInfo
+
+    security.declareProtected(CMFCorePermissions.View, 'Attachments')
+    def Attachments(self):
+        return self.attachments.keys()
+    
+    security.declareProtected(CMFCorePermissions.View, 'getAttachment')
+    def getAttachment(self, key):
+        """ return the attachment """
+        import mimetypes
+        mimetype = ()
+        mimetype = mimetypes.guess_type(key)[0]
+        if not mimetype:
+            mimetype = 'application/octet-stream'
+        self.REQUEST.RESPONSE.setHeader('Content-Type', mimetype)
+        return self.attachments[key]
+        
+
+    def _convertToSortableDate(self, date):
+        import rfc822
+        # Converts a date in to a string which can be sorted to produce the correct results
+        if not date:
+            return ""
+        dateTuple = rfc822.parsedate(date)
+        return str('%04d%02d%02d%02d%02d%02d' % (dateTuple[0],dateTuple[1],dateTuple[2],dateTuple[3],dateTuple[4],dateTuple[5]))
+    

Added: spec/debian/erp5-cmfmailin/CMFMailIn/README.txt
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/README.txt?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/README.txt (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/README.txt Thu Feb 15 17:46:39 2007
@@ -1,0 +1,46 @@
+
+README.txt
+
+  CMFMailIn
+
+      CMFMailIn, a product designed by New Information Paradigms Ltd,
+      provides the means to send emails directly in a CMF Instance.
+
+      If an email is sent to an email address corectly configurated
+      in your MTA then it will arrive in the CMF Instance ready for
+      processing by any Zope method or script.
+
+  Getting Started:
+
+      (More detailed installation and setup instructions can be found in
+       INSTALL.txt and in the help system.)
+
+      1. Extract CMFMailIn in to your Zope Products directory
+         (i.e. *Zope_Home/lib/python/Products* ).
+    
+      2. Restart Zope.
+    
+      3. Place a CMFMailIn tool in you CMF Instance.
+      
+      4. Add the CMF Skins to your portal_skins tool
+
+      5. Add the MailMessage content type to your portal_types tool
+    
+      6. Create a Method (Python Script/DTML Method/Product Method)
+         to deal with incoming emails. Alternatively just leave the default
+         mail handling script.
+    
+      7. Modify the CMFMailIn Tools method property to point to your newly
+         created method. (If applicable)
+    
+      6. Configure your Message Transport Agent (MTA) to pipe messages
+         from a specific email (i.e. *andyd at nipltd.com* ) to the 
+         sendMailToZope.py script
+    
+      7. Restart your MTA and send a message to the configured email address
+         (i.e. *andyd at nipltd.com* ).
+    
+
+All questions and comments to :
+  "New Information Paradigms Ltd - ZMailIn Support", mailto:zmailin-support at nipltd.com 
+

Added: spec/debian/erp5-cmfmailin/CMFMailIn/VERSION.txt
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/VERSION.txt?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/VERSION.txt (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/VERSION.txt Thu Feb 15 17:46:39 2007
@@ -1,0 +1,1 @@
+CMFMailIn-1.0.0

Added: spec/debian/erp5-cmfmailin/CMFMailIn/__init__.py
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/__init__.py?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/__init__.py (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/__init__.py Thu Feb 15 17:46:39 2007
@@ -1,0 +1,48 @@
+##############################################################################
+#
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
+##############################################################################
+from Products.CMFDefault import Portal
+import Products.CMFCore
+
+from Products.CMFCore import utils, CMFCorePermissions
+from Products.CMFCore.DirectoryView import registerDirectory
+import MailMessage
+import MailIn_Tool
+
+import sys
+this_module = sys.modules[ __name__ ]
+
+contentConstructors = (MailMessage.addMailMessage,)
+contentClasses = (MailMessage.MailMessage,)
+
+tools = ( MailIn_Tool.MailInTool, )
+
+z_bases = utils.initializeBasesPhase1( contentClasses, this_module )
+
+# Make the skins available as DirectoryViews
+registerDirectory('skins', globals())
+registerDirectory('skins/mailin', globals())
+
+def initialize( context ):
+    utils.ToolInit('CMFMailIn Tool', tools=tools,
+                   product_name='CMFMailIn', icon='tool.gif',
+                   ).initialize( context )
+    
+    utils.initializeBasesPhase2( z_bases, context )
+    context.registerHelpTitle('CMF MailIn Help')
+    context.registerHelp(directory='help')
+    utils.ContentInit( 'CMF MailMessage'
+                     , content_types = contentClasses
+                     , permission = CMFCorePermissions.AddPortalContent 
+                     , extra_constructors = contentConstructors
+                     , fti = MailMessage.factory_type_information
+                     ).initialize( context ) 

Added: spec/debian/erp5-cmfmailin/CMFMailIn/sendMailToZope.py
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/sendMailToZope.py?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/CMFMailIn/sendMailToZope.py (added)
+++ spec/debian/erp5-cmfmailin/CMFMailIn/sendMailToZope.py Thu Feb 15 17:46:39 2007
@@ -1,0 +1,50 @@
+#!/usr/bin/python
+
+# This python module will send a mail message to a CMF site
+
+# $Id: sendMailToZope.py,v 1.1.1.1 2002/05/31 09:13:06 andyd Exp $
+
+__version__='$Revision: 1.1.1.1 $'[11:-2]  
+
+import sys, urllib
+import rfc822, StringIO, string
+
+def sendMail(url, messageText):
+    if url:
+        if not url[-len('/postMailMessage'):] == '/postMailMessage':
+            url = url + '/postMailMessage'
+
+        try:
+            result = urllib.urlopen(url, urllib.urlencode({'file':messageText})).read()
+        except (IOError,EOFError),e:
+            print "ZMailIn Error: Problem Connecting to server",e
+            sys.exit(73)
+                
+        # if the ZMailIn Client's method returned anything, then 'something bad' happened.
+        if result:
+            print result
+            sys.exit(1)
+                        
+        sys.exit(0)
+
+    print "ZMailIn Error: No ZMailIn Client URL found or specified."
+    sys.exit(1)
+    
+
+if __name__ == '__main__':
+    # This gets called by the MTA when a new message arrives.
+    # The mail message file gets passed in on the stdin
+        
+    f = sys.stdin   # First get a handle on the message file
+    messageText = f.read()
+        
+    url = ''
+    if len(sys.argv)>1:
+        url = sys.argv[1]
+        
+    if not url:
+        print "ZMailIn Error: You must specify the URL to the CMF instance in the First arguement. i.e. python sendMailToZope.py http://www.myserver.com/CMF/"
+        sys.exit(1)
+
+    sendMail(url, messageText)
+        

Added: spec/debian/erp5-cmfmailin/CMFMailIn/tool.gif
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/CMFMailIn/tool.gif?rev=12744&view=auto
==============================================================================
Binary file - no diff available.

Propchange: spec/debian/erp5-cmfmailin/CMFMailIn/tool.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.diff.gz
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.diff.gz?rev=12744&view=auto
==============================================================================
Binary file - no diff available.

Propchange: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.diff.gz
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.dsc
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.dsc?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.dsc (added)
+++ spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1.dsc Thu Feb 15 17:46:39 2007
@@ -1,0 +1,12 @@
+Format: 1.0
+Source: erp5-cmfmailin
+Version: 1.0.0-1
+Binary: erp5-cmfmailin
+Maintainer: Yusei TAHARA
+Architecture: all
+Standards-Version: 3.7.2
+Build-Depends: debhelper (>= 5.0)
+Build-Depends-Indep: zope-debhelper (>= 0.3.6)
+Files: 
+ e3d2947576f4f4be7adaf6a2d4886d91 16497 erp5-cmfmailin_1.0.0.orig.tar.gz
+ d30173075b38ea2d2ae01ed6ae2d7818 1805 erp5-cmfmailin_1.0.0-1.diff.gz

Added: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_all.deb
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_all.deb?rev=12744&view=auto
==============================================================================
Binary file - no diff available.

Propchange: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_all.deb
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.build
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.build?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.build (added)
+++ spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.build Thu Feb 15 17:46:39 2007
@@ -1,0 +1,34 @@
+ fakeroot debian/rules clean
+dh_testdir
+dh_testroot
+rm -f build-stamp configure-stamp
+dh_clean
+ dpkg-source -b CMFMailIn
+dpkg-source: warning: source directory `./CMFMailIn' is not <sourcepackage>-<upstreamversion> `erp5-cmfmailin-1.0.0'
+dpkg-source: warning: .orig directory name CMFMailIn.orig is not <package>-<upstreamversion> (wanted erp5-cmfmailin-1.0.0.orig)
+dpkg-source: building erp5-cmfmailin using existing erp5-cmfmailin_1.0.0.orig.tar.gz
+dpkg-source: building erp5-cmfmailin in erp5-cmfmailin_1.0.0-1.diff.gz
+dpkg-source: building erp5-cmfmailin in erp5-cmfmailin_1.0.0-1.dsc
+ debian/rules build
+touch build-stamp
+ fakeroot debian/rules binary
+dh_testdir
+dh_testroot
+dh_clean -k
+dh_installdirs
+dh_installerp5zope .
+dh_testdir
+dh_testroot
+dh_installdocs
+dh_installexamples
+dh_installchangelogs
+dh_compress
+dh_fixperms
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb
+dpkg-deb: `../erp5-cmfmailin_1.0.0-1_all.deb' ¤Ë¥Ñ¥Ã¥±¡¼¥¸ `erp5-cmfmailin' ¤ò¹½ÃÛ¤·¤Æ¤¤¤Þ¤¹¡£
+ dpkg-genchanges
+dpkg-genchanges: including full source code in upload
+dpkg-buildpackage (debuild emulation): full upload (original source is included)

Added: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.changes
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.changes?rev=12744&view=auto
==============================================================================
--- spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.changes (added)
+++ spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0-1_i386.changes Thu Feb 15 17:46:39 2007
@@ -1,0 +1,21 @@
+Format: 1.7
+Date: Wed, 14 Feb 2007 03:27:56 +0900
+Source: erp5-cmfmailin
+Binary: erp5-cmfmailin
+Architecture: source all
+Version: 1.0.0-1
+Distribution: unstable
+Urgency: low
+Maintainer: Yusei TAHARA
+Changed-By: Yusei TAHARA <yusei at domen.cx>
+Description: 
+ erp5-cmfmailin - A Zope product to import emails into CMF sites
+Changes: 
+ erp5-cmfmailin (1.0.0-1) unstable; urgency=low
+ .
+   * Initial Release.
+Files: 
+ 409f6aa6018535fc7faff19144fe416b 375 web optional erp5-cmfmailin_1.0.0-1.dsc
+ e3d2947576f4f4be7adaf6a2d4886d91 16497 web optional erp5-cmfmailin_1.0.0.orig.tar.gz
+ d30173075b38ea2d2ae01ed6ae2d7818 1805 web optional erp5-cmfmailin_1.0.0-1.diff.gz
+ 068333a47c219f26dde05e898930fffc 18974 web optional erp5-cmfmailin_1.0.0-1_all.deb

Added: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0.orig.tar.gz
URL: http://svn.erp5.org/spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0.orig.tar.gz?rev=12744&view=auto
==============================================================================
Binary file - no diff available.

Propchange: spec/debian/erp5-cmfmailin/erp5-cmfmailin_1.0.0.orig.tar.gz
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream




More information about the Erp5-report mailing list