Results 1 to 2 of 2

Thread: [SOLVED] Bounce (Resend) message from postmaster

  1. #1
    Join Date
    Oct 2008
    Posts
    74
    Rep Power
    7

    Question [SOLVED] Bounce (Resend) message from postmaster

    Hi!

    We have a setup here where every spam and virus mail gets quarantined in our postmaster's mailbox. However, we had an error in our spam setup and so some messages are false positives there and I'd like to resend these messages keeping the original sender and recipient.

    How can I do this via CLI or Web UI?

    Kind regards
    Dennis
    Release 8.0.6.GA.5922.UBUNTU12.64 UBUNTU12_64 NETWORK edition.

  2. #2
    Join Date
    Oct 2008
    Posts
    74
    Rep Power
    7

    Post

    I solved it myself.

    I made two php-Scripts (Sorry, JSON-php was the easiest available). The first one fetches a raw message from the server:

    Code:
    <?php
    
    if ($_SERVER['argc'] != 3) {
    
        die ("Usage: php getmail.php <mailbox> <msgid>");
    
    }
    
    $mailbox = $_SERVER['argv'][1];
    $msgid = $_SERVER['argv'][2];
    
    $mail = json_decode(`zmsoap --json -z -m $mailbox GetMsgRequest/m @id=$msgid @raw=1`);
    
    print $mail->m[0]->content->_content;
    The second one uses that one to resend the message by using sendmail (yeah, that could've been done in bash):

    Code:
    <?php
    
    if ($_SERVER['argc'] != 3) {
    
            die ("Usage: php resend.php <mailbox> <msgid>");
    
    }
    
    $mailbox = $_SERVER['argv'][1];
    $msgid = $_SERVER['argv'][2];
    
    print `php /usr/local/bin/getmail.php $mailbox $msgid | sendmail -i -t`;
    If someone could wrap up something more compatible with Zimbra by not relying on PHP or other external libraries, please do so.

    Kind regards
    Dennis
    Release 8.0.6.GA.5922.UBUNTU12.64 UBUNTU12_64 NETWORK edition.

Similar Threads

  1. message cache problem
    By mikiso in forum Administrators
    Replies: 0
    Last Post: 10-20-2010, 09:48 AM
  2. Emails bouncing with "Error Text: 401,'null'"
    By sholden in forum Zimbra Connector for Outlook
    Replies: 27
    Last Post: 08-20-2008, 04:59 PM
  3. Bounce message on Over Quota
    By lleahu in forum Administrators
    Replies: 3
    Last Post: 02-20-2008, 04:08 AM
  4. Replies: 4
    Last Post: 08-10-2006, 10:55 PM
  5. Forward | bounce message as a filter action
    By dfaulkner in forum Developers
    Replies: 3
    Last Post: 02-23-2006, 10:17 PM

Posting Permissions

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