Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-25-2010, 02:05 AM
Active Member
 
Posts: 45
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 7.1.4_GA_2555.SLES10_64_20120105095040 SLES10_64 NETWORK edition, Patch 7.1.4_P1.
Reply With Quote
  #2 (permalink)  
Old 11-26-2010, 02:00 AM
Active Member
 
Posts: 45
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 7.1.4_GA_2555.SLES10_64_20120105095040 SLES10_64 NETWORK edition, Patch 7.1.4_P1.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.