James Server
  1. James Server
  2. JAMES-941

FetchMail initializes some mail attributes with "null" values, which are then ignored by HasMailAttribute matcher.


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 3.0-M1
    • Component/s: FetchMail
    • Labels:


      I needed to resend all messages delivered by FetchMail to users, who are not defined to James, into postmaster's mailbox. To do so I've added a new mailet with HasMailAttribute matcher to process messages with "org.apache.james.fetchmail.isUserUndefined" attribute. But this mailet has never been actually invoked in spite of the aforementioned attribute presence.

      In the FetchMail's source code I've found that all attributes which do not assume some particular value, are initialized by nulls:
      if (isUserUndefined())
      aMail.setAttribute(getAttributePrefix() + "isUserUndefined", null);

      But HasMailAttribute matcher ignores attributes with null values:
      if (mail.getAttribute (attributeName) != null)

      { return mail.getRecipients(); }

      If I assign arbitrary not null value to the attribute like this
      aMail.setAttribute(getAttributePrefix() + "isUserUndefined", "true");
      the matcher works fine and my mailet is then invoked.

      Thereby we have some incorrectly initialized attributes which are definitely ignored by matchers (and possibly cause some other troubles).


        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12566635 ] jira [ 12582178 ]
        Mark Thomas made changes -
        Workflow jira [ 12485593 ] Default workflow, editable Closed status [ 12566635 ]
        Norman Maurer made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Norman Maurer [ norman ]
        Fix Version/s 3.0-M1 [ 12314294 ]
        Resolution Fixed [ 1 ]
        Aleksey Medvedev created issue -


          • Assignee:
            Norman Maurer
            Aleksey Medvedev
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: