Zimbra TGZ फ़ाइलें पढ़ें और निर्यात करें

Zimbra एक क्लाउड‑आधारित ईमेल और सहयोग सूट है जो ईमेल, संपर्क, कैलेंडर, फ़ाइल शेयरिंग, कार्य और मैसेजिंग प्रदान करता है – सभी Zimbra वेब क्लाइंट के माध्यम से किसी भी डिवाइस पर उपलब्ध हैं।

Aspose.Email for Node.js via .NET डेवलपर्स को Zimbra TGZ बैकअप फ़ाइलों से डेटा पढ़ने, निकालने और निर्यात करने की सुविधा देता है TgzReader class। आप आसानी से सभी संदेशों तक पहुंच सकते हैं, कुल आइटम गिन सकते हैं, और TGZ फ़ाइलों से संदेश, संपर्क या कैलेंडर डेटा को सामान्य फ़ॉर्मेट में निर्यात कर सकते हैं।

Zimbra TGZ फ़ाइल से सभी संदेश पढ़ें

यह TgzReader class आपको Zimbra TGZ बैकअप फ़ाइल में संग्रहीत सभी संदेश पढ़ने की अनुमति देता है।

निम्न उदाहरण दिखाता है कि सभी संदेशों के माध्यम से इटरिट करके उनके फ़ोल्डर स्थान और विषय कैसे प्रदर्शित करें।

const asposeemail = require('@aspose/email');
const fs = require('fs');

// Path to the Zimbra TGZ file
const tgzPath = "ZimbraSample.tgz";

// Create a TgzReader instance
const reader = new asposeemail.TgzReader(tgzPath);

// Read and display all messages
while (reader.readNextMessage()) {
    const directoryName = reader.currentDirectory;
    console.log("Directory:", directoryName);

    const message = reader.currentMessage;
    console.log("Subject:", message.subject);
}

reader.dispose();
console.log("All messages read successfully from the Zimbra TGZ file.");

Zimbra TGZ फ़ाइल में कुल आइटम गिनें

आप TGZ बैकअप में कितने ईमेल आइटम हैं, इसे जल्दी से निर्धारित करने के लिए इसका उपयोग कर सकते हैं getTotalItemsCount() विधि TgzReader क्लास।

नीचे दिया गया कोड नमूना दिखाएगा कि इस विधि को अपने प्रोजेक्ट में कैसे लागू किया जाए:

const asposeemail = require('@aspose/email');

const tgzFile = "ZimbraSample.tgz";
const reader = new asposeemail.TgzReader(tgzFile);

const totalCount = reader.getTotalItemsCount();
console.log(`Total items in TGZ file: ${totalCount}`);

reader.dispose();

Zimbra TGZ फ़ाइल से संदेश और फ़ोल्डर संरचना सहेजें

यह exportTo() यह विधि आपको TGZ फ़ाइल से सभी संदेश सहेजने की अनुमति देती है जबकि मूल फ़ोल्डर संरचना को बनाए रखती है। यह मेलबॉक्स डेटा को पुनर्स्थापित या माइग्रेट करने के समय उपयोगी है।

नीचे दिया गया कोड नमूना दिखाता है कि कैसे Aspose.Email लाइब्रेरी का उपयोग करके TGZ अभिलेख फ़ाइल से सभी Zimbra ईमेल संदेशों को निकालें और निर्यात करें।

const asposeemail = require('@aspose/email');

const tgzFile = "ZimbraSample.tgz";
const outputDir = "Output/Zimbra/";

const reader = new asposeemail.TgzReader(tgzFile);
reader.exportTo(outputDir);

reader.dispose();
console.log(`All Zimbra messages exported to: ${outputDir}`);

Zimbra बैकअप फ़ाइलों से कैलेंडर और संपर्क निर्यात करें

Zimbra TGZ बैकअप में संपर्क और कैलेंडर फ़ोल्डर हो सकते हैं। आप इन्हें उसी का उपयोग करके VCard (.vcf) और iCalendar (.ics) फ़ॉर्मेट में निर्यात कर सकते हैं exportTo() विधि।

const asposeemail = require('@aspose/email');

const tgzFile = "ZimbraBackup.tgz";
const outputPath = "Output/ZimbraData/";

const reader = new asposeemail.TgzReader(tgzFile);

// Contacts can be found in "Contacts" and "Emailed Contacts" folders.
// Calendar entries can be found in the "Calendar" folder.
reader.exportTo(outputPath);

reader.dispose();
console.log("Zimbra calendar and contacts exported successfully.");