Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

'NoneType' object has no attribute 'Header'

Help
s_sbaiz
2005-09-20
2013-06-04
  • s_sbaiz
    s_sbaiz
    2005-09-20

    I configured my account to download mails by pop3.
    When I call '/getMail' method I obtain the error:
    'NoneType' object has no attribute 'Header',
    mails are not saved on MailManager database, and my mailbox results empty.

    How can I solve this problem?
    Why mails disappear?

    Regards.

     
    • Kevin Campbell
      Kevin Campbell
      2005-09-20

      It is likely this problem is related to bugs which exist in the 2.0 release. The 2.0-r7 release will resolve this issue, and can be downloaded from sourceforge. You will need to install this version of the product by hand. Please let me know if this doesn't resolve the issue.

      Regards,
      Kevin

       
    • s_sbaiz
      s_sbaiz
      2005-09-20

      I installed 2.0.1rc1 version.

      1)
      I got ISO8601 error but I solved it:
      i modified 'msg_date.ISO8601()' in 'msg_date' on line 762 in
      MailManager.py script. Why ISO8601 make problems?

      2)
      I tryed getting mail by forward but my zope installation and my qmail
      work on different computers (without any firewall between them).
      Can you give me some advice on which to call MMMailIn-Qmail.py script
      from another computer?

      3)
      Without forward system, i configured my account to download mails using
      pop3.
      When I call '/getMail' method I obtain the error:
      'NoneType' object has no attribute 'Header',
      mails are not saved on MailManager database, and my mailbox results empty.
      The same happends calling MMGetMail.py from cron.

      Thanks for help.

      Regards.

       
    • Kevin Campbell
      Kevin Campbell
      2005-09-21

      Simone,

      The ISO8601 error you received is possibly related to a missing check for dates which are out of range. Could you check that you had the following section of code in your MailManager.py?

              # If msg_date cannot be decoded the current date will be used
              dateobj = parsedate_tz(msg.get('date'))
              if not (dateobj is None):
                  try:
                      msg_date = DateTime(mktime_tz(dateobj))
                  except Exception, e:
                      # OverflowError will be called on dateobj's which are too far
                      # in the future. Also want to catch other errors here and log
                      # them, rather than blocking processing by raising an exception
                      zLOG.LOG('MailManager:', zLOG.DEBUG,
                               '%sDate Parsing Error: exception %s raised from date %s' % (self.getLogName(), str(e), msg.get('date')))
                      msg_date = DateTime(time.time())
              else:
                  msg_date = DateTime(time.time())

      As for the MMMailIn-QMail.py script, it's usage appears to be identical to the MMMailIn.py script, only the account name does not have to be specified on the command line.

      ./MMMailIn.py -u http://localhost:8080/mail test@example.com

      vs

      ./MMMailIn-QMail.py -u http://localhost:8080/mail

      Changing the hostname from localhost to the full internal url of your mailmanager instance should let you use this from a remote system.

      As for the third problem, a full traceback from the error_log would be helpful for solving this. It's hard to see what the problem is without that.

      Regards,
      Kevin

       
    • s_sbaiz
      s_sbaiz
      2005-09-21

      Kevin,

      I have that code in my MailManager.py but the problem was in the following lines where is called ISO8601.

      For the pop3 error, this is the error_log:
      Traceback (innermost last):
        Module ZPublisher.Publish, line 100, in publish
        Module ZPublisher.mapply, line 88, in mapply
        Module ZPublisher.Publish, line 40, in call_object
        Module Products.MailManager.MailManager, line 615, in getMail
        Module /var/lib/zope_2.7.0b/Dati/Products/MailManager/Extensions/AccountPluggableBrain.py, line 421, in getMail
        Module /var/lib/zope_2.7.0b/Dati/Products/MailManager/Extensions/AccountPluggableBrain.py, line 450, in _getPOP3
        Module /var/lib/zope_2.7.0b/Dati/Products/MailManager/Extensions/AccountPluggableBrain.py, line 113, in process
        Module /var/lib/zope_2.7.0b/Dati/Products/MailManager/Extensions/AccountPluggableBrain.py, line 372, in _standardFilter
        Module None, line 337, in getHeader
        Module None, line 345, in _decodeHeader
      AttributeError: 'NoneType' object has no attribute 'Header'

      Regards,
      Simone

       
    • s_sbaiz
      s_sbaiz
      2005-09-22

      I created a new MailManager object in my zope root folder and i created a new database. Now mails are downloaded properly.
      I don't understand why... but one of my problems seems to be solved.

      Sorry, but I still not understanding how to make forward possible if my zope installation, my MailManager instance and my script MMMailIn-QMail.py are not on the mail server. My problem is to call MMMailIn-QMail.py from the .forward file, not to call MailManager instance from the MMMailIn-QMail.py script.

      Can you help me?

      Thanks again.

      Regards,
      Simone

       
      • Kevin Campbell
        Kevin Campbell
        2005-09-22

        Simone,

        The MMMailIn-QMail.py script must reside on the server running QMail. That script does not require MailManager or Zope to be installed on the local system to run. The script only uses commands from the base python library. You should be able to copy over that script on it's own to the QMail server and run it from there using the example commands from my previous reply.

        Regards,
        Kevin