Bulk Restore Not Working

Issue #202 resolved
Former user created an issue
  • search for messages, in this case from a specific user, results are two messages.
  • select each one of the messages using the check boxes next to each one of the messages found vioa search above.
  • press the "bulk restore selected emails" icon next to the "Bulk Down selected emails" and tags input field.
  • A pop up message is displayed saying restored, however no messages leave the box.

Chrome Developer tools indicate Post to bulkrestore.php post with a HTTP 200. Console dump indicates message list was recieved, however bulkresotre.php Response displays "Restored 0". Console output below...

1386265128727 "[get_selected_messages_list]" piler.js:58 1386265128727 "[get_selected_messages_list], result:" ["3,2"] piler.js:55 1386265128727 "[show_message]" ["messagebox1", "<p>Restored</p>"] piler.js:55

Ngrep tests indicate no activity over any port related to mail piler.

SMARTHOST is set to 127.0.0.1 port 10026.

Postfix configured to listen on 127.0.0.1 10026.

Single message restores work when restoring via the link displayed when clicking a message to view the details.

Thanks in advance for any help.

Comments (10)

  1. Janos SUTO repo owner

    Are you an auditor user or a regular user? Do you have the recipients' domainname in the administration / domains menu?

  2. Janos SUTO repo owner

    OK, that's fine. Please edit controller/message/bulkrestore.php, and add the following line:

    syslog(LOG_INFO, "id=$id, rcpt=" . implode(",", $rcpt));

    right after the ~66th line where you have the following:

    $rcpt = $this->model_search_search->get_message_recipients($id);

    Then try to restore a few messages, and look at the maillog what the gui wants to do with those messages.

  3. Travis Edgar

    Results after adding debug call...

    Dec  6 16:11:04 awsemailarchive01 piler-webui[23580]: id=2, rcpt=
    Dec  6 16:11:04 awsemailarchive01 piler-webui[23580]: id=3, rcpt=
    
  4. Janos SUTO repo owner

    ok, the problem is that piler can't figure out whom to send these emails. See rcpt=''

    The reason is that the get_message_recipients() function fails to return a valid email address. This function works as follows:

    it queries all your domains you have in administration / domain menu, then it searches all recipients of the given email. Finally it tries to match all your domains against all the recipients' email addresses, and if it finds a match, then it returns the email address.

    In your case it couldn't find any. So please check that you have all your hosted domains listed in administration / domain, and look at all the recipients of these 3 messages, and verify that they are your domains.

    Note that the bulk restore tries to restore the selected messages to all recipients.

  5. Travis Edgar

    OK, one of three test message was addressed to a domain that was not in our hosted domains list. Just so I am clear...

    • a search is completed and yields 3 messages, 2 messages to domain1.com and 1 message to domain2.com. Domain1.com is in hosted domains, domain2.com is not.
    • I select the 2 messages (via the checkbox next to each message in the search results) for the domain in hosted domains.
    • Click bulk restore.

    This will fail because domain2.com is not in my hosted domains, even though I did not select it to be restored?

  6. Travis Edgar

    My logs indicate the correct number of messages are being restored to only the messages I have selected.

    In other words all looks good.

    Thanks for the help!

  7. Log in to comment