Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: clean up script

  1. #1

    clean up script

    i just upgraded tot zcp 7.2 and my cleanup script isn't working anymore, worked fine on zcp 7.1.14 (als updated sles 11sp3 to sles sp4)
    its the script to delete unwanted mail (spam) and deleted folder after x days

    was a very useful script.

  2. #2
    Zarafa

    Join Date
    Jan 2009
    Location
    Hanover, Germany
    Posts
    1,891
    In case you are searching for help, I think you should paste your script or at least the error message you get when running it.
    Regards Felix

    How to get Kopano

    Zarafa ALPHA/BETA/RC feedback in BETA forum please.
    Zarafa IRC chat: irc.freenode.com > #zarafa
    Zarafa documentation: http://documentation.zarafa.com/

    No support via PM! Please contact our sales team for an offer if you want my full attention.

  3. #3

    cleanup

    this is the message:
    Cleanup spam & deleted items folders
    PHP Warning: mapi_logon_zarafa(): Unable to setup service for provider in /usr/local/bin/spam.php on line 26
    PHP Warning: mapi_getmsgstorestable() expects parameter 1 to be resource, boolean given in /usr/local/bin/spam.php on line 30
    PHP Warning: mapi_table_queryallrows() expects parameter 1 to be resource, boolean given in /usr/local/bin/spam.php on line 34
    PHP Notice: Undefined variable: storeEntryId in /usr/local/bin/spam.php on line 48
    PHP Warning: mapi_logon_zarafa(): Unable to setup service for provider in /usr/local/bin/delete.php on line 23
    PHP Warning: mapi_getmsgstorestable() expects parameter 1 to be resource, boolean given in /usr/local/bin/delete.php on line 27
    PHP Warning: mapi_table_queryallrows() expects parameter 1 to be resource, boolean given in /usr/local/bin/delete.php on line 31
    PHP Notice: Undefined variable: storeEntryId in /usr/local/bin/delete.php on line 46
    PHP Warning: mapi_logon_zarafa(): Unable to setup service for provider in /usr/local/bin/spam.php on line 26
    PHP Warning: mapi_getmsgstorestable() expects parameter 1 to be resource, boolean given in /usr/local/bin/spam.php on line 30
    PHP Warning: mapi_table_queryallrows() expects parameter 1 to be resource, boolean given in /usr/local/bin/spam.php on line 34
    PHP Notice: Undefined variable: storeEntryId in /usr/local/bin/spam.php on line 48
    PHP Warning: mapi_logon_zarafa(): Unable to setup service for provider in /usr/local/bin/delete.php on line 23
    PHP Warning: mapi_getmsgstorestable() expects parameter 1 to be resource, boolean given in /usr/local/bin/delete.php on line 27
    PHP Warning: mapi_table_queryallrows() expects parameter 1 to be resource, boolean given in /usr/local/bin/delete.php on line 31
    PHP Notice: Undefined variable: storeEntryId in /usr/local/bin/delete.php on line 46
    PHP Warning: mapi_logon_zarafa(): Unable to setup service for provider in /usr/local/bin/spam.php on line 26
    PHP Warning: mapi_getmsgstorestable() expects parameter 1 to be resource, boolean given in /usr/local/bin/spam.php on line 30
    PHP Warning: mapi_table_queryallrows() expects parameter 1 to be resource, boolean given in /usr/local/bin/spam.php on line 34
    PHP Notice: Undefined variable: storeEntryId in /usr/local/bin/spam.php on line 48
    PHP Warning: mapi_logon_zarafa(): Unable to setup service for provider in /usr/local/bin/delete.php on line 23
    PHP Warning: mapi_getmsgstorestable() expects parameter 1 to be resource, boolean given in /usr/local/bin/delete.php on line 27
    PHP Warning: mapi_table_queryallrows() expects parameter 1 to be resource, boolean given in /usr/local/bin/delete.php on line 31
    PHP Notice: Undefined variable: storeEntryId in /usr/local/bin/delete.php on line 46
    PHP Notice: Undefined offset: 920129794 in /usr/local/bin/spam.php on line 56
    PHP Notice: Undefined offset: 904069378 in /usr/local/bin/delete.php on line 52

    line 56 off the spam php:
    $spamFolder = mapi_msgstore_openentry($store,$spamStoreProps[PR_ADDITIONAL_REN_ENTRYIDS][4]);

    they are the normal cleanup scripts, only the amount off days are changed
    stopped working after update sles 11sp 3 to sles 11 sp4 and zarafa 7.1.14 to 7.2.1 51665

  4. #4
    Senior Member
    Join Date
    Nov 2007
    Location
    Belo Horizonte, Brazil
    Posts
    1,475
    Hi uniware,

    mapi_logon_zarafa has changed in 7.2.0. You need two additional parameters at the end. In Z-Push it looks like this:

    $zpush_version and $user_agent you can replace with some strings (e.g. 'unknown').

    Manfred
    Please do not PM me asking for support. Use the forum instead. Thank you.
    I usually check the mobility thread at the end of the day, so please have some patience if there's no immediate response. Asking to look at certain thread per PM won't result in a faster answer.

  5. #5
    @manfred
    hmm not working
    seems (what i see???) its not the login butt the storeEntryID (deleted item)
    i am not a programmer so.... can't read it full

    but thanks anyway

  6. #6
    Senior Member
    Join Date
    Nov 2007
    Location
    Belo Horizonte, Brazil
    Posts
    1,475
    Hi uniware,

    have you changed mapi_logon_zarafa call? What is the output of the script now?

    Manfred
    Please do not PM me asking for support. Use the forum instead. Thank you.
    I usually check the mobility thread at the end of the day, so please have some patience if there's no immediate response. Asking to look at certain thread per PM won't result in a faster answer.

  7. #7
    hi Manfred,
    only changed it in the delete.php spam.php is the "old" one

    output:
    Attached Files Attached Files
    Last edited by uniware; 03-12-2015 at 12:33 PM.

  8. #8
    Senior Member
    Join Date
    Nov 2007
    Location
    Belo Horizonte, Brazil
    Posts
    1,475
    Hi uniware,

    there's also mapi_logon_zarafa call in spam.php, why haven't you changed it there as well?

    Is MAPI_SERVER constant defined properly?

    Manfred
    Please do not PM me asking for support. Use the forum instead. Thank you.
    I usually check the mobility thread at the end of the day, so please have some patience if there's no immediate response. Asking to look at certain thread per PM won't result in a faster answer.

  9. #9
    wanted to first see response at the delete php, then alter the spam.php
    in zarafa-php in the z-push no constant for MAPI_SERVER
    altered the first bit of the delete.php to try to make sense to me
    original head of script:

    webmail:/usr/share/z-push/backend/zarafa # vi /usr/local/bin/delete.php.old
    <?php
    $l_sUsername = $argv[1];
    $l_sPassword = '';
    $l_sServer = 'file:///var/run/zarafa';
    // enter the number of days here, messages before this number of days will get deleted
    $daysBeforeDeleted = 10;

    define('PT_BOOLEAN' , 11); /* 16-bit boolean (non-zero true) */
    define('PT_STRING8' , 30); /* Null terminated 8-bit character string */
    define('PT_TSTRING' ,PT_STRING8);
    define('PT_BINARY' ,258); /* Uninterpreted (counted byte array) */
    define('PT_SYSTIME' , 64); /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */
    define('PR_DEFAULT_STORE' ,mapi_prop_tag(PT_BOOLEAN, 0x3400));
    define('PR_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x0FFF));
    define('PR_IPM_WASTEBASKET_ENTRYID' ,mapi_prop_tag(PT_BINARY, 0x35E3));
    define('PR_CREATION_TIME' ,mapi_prop_tag(PT_SYSTIME, 0x3007));

    function greaterDate($start_date, $daysBeforeDeleted){
    return (strtotime($start_date)-strtotime(date('Y-m-d G:i:s', strtotime("-$daysBeforeDeleted days"))) < 0) ? 1 : 0;
    }

    // Log in to Zarafa server
    $l_rSession = mapi_logon_zarafa($l_sUsername, $l_sPassword, $l_sServer);
    echo ((mapi_last_hresult()==0)?"Logged in successfully":"Some error in login")."\n";

    // Get a table with the message stores within this session
    $l_rTableStores = mapi_getmsgstorestable($l_rSession);
    echo ((mapi_last_hresult()==0)?"Processing to get data... ":"Some error in processing...")."\n";

    // Retrieve the default store by querying the table
    $l_aTableRows = mapi_table_queryallrows($l_rTableStores, array(PR_ENTRYID, PR_DEFAULT_STORE));
    echo ((mapi_last_hresult()==0)?"Fetching Deleted Folder...":"Some error in fetching...")."\n";

    $l_bbnEntryID = false; // Either boolean or binary

  10. #10
    Senior Member
    Join Date
    Nov 2007
    Location
    Belo Horizonte, Brazil
    Posts
    1,475
    Hi uniware,

    what is the connection between delete.php and spam.php? Or is this the same files with two different names?

    Anyway, as I've stated before, you have to alter mapi_logon_zarafa function call. In your case that would be something like:

    for delete.php

    Manfred
    Please do not PM me asking for support. Use the forum instead. Thank you.
    I usually check the mobility thread at the end of the day, so please have some patience if there's no immediate response. Asking to look at certain thread per PM won't result in a faster answer.

Page 1 of 2 12 LastLast

Similar Threads

  1. msr broke. need to clear/clean it on remote server
    By djtremors in forum Migration
    Replies: 0
    Last Post: 21-03-2013, 11:56 AM
  2. Alias Info not recieving mail on clean install zarafa
    By mdeboer85 in forum Installation, Configuration and Maintenance
    Replies: 1
    Last Post: 19-03-2013, 02:03 PM
  3. Indexer doesn't clean up after deleted stores
    By classic in forum Beta Feedback
    Replies: 7
    Last Post: 22-10-2012, 12:02 PM
  4. 7.0.1-28479, Clean Profile, But Cannot Display Folder
    By GraysonPeddie in forum Outlook client
    Replies: 2
    Last Post: 26-08-2011, 01:46 PM
  5. Howto clean out corrupted emails
    By compsos in forum Installation and Configuration Archives
    Replies: 1
    Last Post: 07-02-2010, 10:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •