Happy scripting

scripts and tools for Communigate Pro

As you may know, Communigate Pro™ is a really good and efficient mail server. Among its many useful functions, it has the ability to include external filters, helper applications, etc. Also, there is some tasks with it that are better done with scripting, through its CLI interface. We wrote a small amount of scripts to perform specific tasks, and here they are, for the joy of every worried CGPro administrator.

See the PRO version of some of these scripts. The Pro versions are faster and doesn't need Perl or any other dependencies, since they are written in portable C++.

To receive notifications about updates of these filters, please subscribe to the Niversoft's Updates mailing list. This is a low-traffic read-only list where we post updates (and only updates) of all our products.

All scripts can be downloaded on the download page.

Add Footer

Requires: Perl..

This script, when setup properly, adds a footer at the end of outgoing emails.

The text can be your signature, your company's logo and contact information, a legal disclaimer, etc.

You can specify different text (and formatting) for different content-types. You can add a HTML-formatted footer for the HTML part of a message, and a Text-only footer for the Text-only part.

AddFooter runs with the [FILE][RETPATH][RCPT] Execute parameters, and will append the footer to the last text part when there is multiple text parts with attachments in the middle.

See also the Pro version of this filter. The PRO version is faster and runs as an external filter instead of an Execute action

Auto-Delete Junk

RUNS AS: Cron job.
Requires: Perl, CLI.pm.

This script is intended to delete spam from SPAM folders after x days. The number of days can be set directly in the name of the mailbox. For instance, the mailbox SPAM14 would get its 14-days old messages deleted.

CG.Net library

RUNS AS: Software Library for .Net applications.
Requires: MS.Net Framework v2 to run, MS Visual Studio 2005 to compile.

This library allows the connection and interaction with Communigate Pro CLI using the .Net framework.

CG.Net library is distributed with full source code, pre-compiled DLL and minimalist sample project under a BSD-style license.

Content Filter Demo

RUNS AS: EXTFILTER Helper application.
Requires: Perl or a C++ compiler for your platform.

This script is intended to help to create a custom external filter. This script does nothing by itself, but it has placeholder and comments to guide in the creation of a real filter.

Dictionary Attack

RUNS AS: Cron job.
Requires: Perl, CLI.pm.

Updated! (2004-11-22, 2011-11-20) - Some of the changes sponsored by G. Kuznitz, thank you.

This script is intended to scan CGatePro Log Files and count the amount of rejected messages (unknown user account) in multiple SMTP sessions with a given IP. When that number exceeds a threshold in a given time (log rotation period), that host is automatically added to the blacklisted addresses, because this host appears to be trying to dictionary-attack your server.

Some code has been added to prevent the addition of localhost, client IPs, whitelist and LAN IPs as blacklisted.

Find Attachments

RUNS AS: EXTFILTER Helper application.
Requires: Perl.

This script is intended to add specific headers to messages that contain attachments. The filter finds attachments in the message, and then instructs CGPro to add one header for each type (extension) of attachment found.

For an EXE attachment in the message, you would get X-ATTACHEXT: EXE. Then it should be easy to set up rules to reject or take specific actions on particular attachments.

There are two versions of this filter in the archive. See the README file to read the differences between the two versions.

See also the Pro version of this filter. The PRO version is faster and can detect Encrypted Zip files

Get Webskin Info

RUNS AS: External script.
Requires: Perl, CLI.pm.

This script will help you find which user have setup which webskin on their settings. It will help you count the effective number of users of a particular WebSkin. Just run it and give it basic info: the domain name, the postmaster's password, and it will show you a small report of webskin usage.

List Post-Processor

RUNS AS: EXTFILTER Helper application.
Requires: Perl, CLI.pm.

This script intercepts list message before they are delivered to subscribers. It creates individual messages, one for each recipient, and introduces little modifications to it: such as it can add a X-ListMember header, replace the To: field value with the real recipient address, or replace any instance of %RCPT% in the message with the real recipient address.

This may be used if you want your users to know from which address they subscribed to the list. This will help them unsubscribe or modify their subscription.

Long Lines Stopper

RUNS AS: EXTFILTER Helper application.
Requires: Perl.

This script is intended to reject messages when they contain lines longer than 1023 chars. This could be helpful if you use a relay or if your mail passes through another mail server software that has such a limitation.

Mailbox Conversion v2.5

RUNS AS: External Script.
Requires: Perl, CLI.pm, Mail::IMAPClient Perl modules.

This script will do the painful mailbox format (mbox, mdir, mslc) conversion process for you. This script is designed to convert chosen mailboxes, accounts, domains or a whole server, using a hybrid conversion method which uses IMAP for INBOX conversion then converts other mailboxes using the filesystem for faster execution. A full offline mode is also available.

The script automatically sets account limits (size & number of mailboxes) to Unlimited before starting the conversion. These settings are automatically reset to previous value at the end of the script. The account being converted is locked during the execution to prevent errors.

NEW: Support for the new Sliced Mailbox format of CGP 6.0.

Postmaster's Backdoor Access

RUNS AS: CGI script.
Requires: Perl, CLI.pm.

This script allows the postmaster to easily login into any webmail account using its own password.

The script is as secure as webmail since it uses the webmail session realm and CLI to operate.

Remove Headers

Requires: Perl.

This script will remove extraneous headers from the messages. You specify the list of headers to remove.

It can be useful to hide Received: fields, headers added by other content-filtering helpers, or headers added by some mail clients that can possibily reveal sensitive information.

However, this script will add its custom header to the message. This may look weird for an header remover script to add one, but it's required to prevent email loops.

There is currently no Pro version of this filter, but one could be built if there's enough demand. Please contact us if you want a Pro version of this filter.

The Perl Runner

RUNS AS: Anything.
Requires: Perl 5.8, a C compiler (optional).

If you run any perl script as an external filter, for instance, this process may be listed as perl.exe on Windows task list, or as something quite unidentifiable on some other OSes.

This may help you if you run a Win32 system.

This is the Perl runner. A lightweight Perl interpreter, linked to the Perl Library. It's the same thing than if you took the perl.exe file, removed all unneeded things, renamed it with an identifiable name, and used it as an external filter with some script.

The Perl Runner will search in the directory where it's stored, a perl script named the same way as it. The Perl Runner will then start it. So if you name the perl runner PerlRun.pl.exe, it will try to run PerlRun.pl. This way you will know what to kill in the task manager if something goes wrong with your file.

The Regex Matcher

RUNS AS: EXTFILTER Helper application.
Requires: Perl.

The Regex Matcher is an extension to the Rules system of Communigate Pro™. This script tries to match a list of regular expressions with the headers of the message. Each time one match is found, a new header is added to the message with the description of the matched regex. These new headers can then be easily used in Communigate Pro™ to perform rules actions on these messages.

The list of regular expressions is contained in a config file. Each line begins with a simple description that will be used for further rule processing, and ends with the regulat expression itself, with the Perl syntax (/match/i). The config file is automatically reloaded on change, so no need to restart the filter.

The filter adds X-Regex-Match: [description] headers.

See also the Pro version of this filter.

Support Package

You liked this software? You want to support Niversoft to help it produce other tools as useful and as good as those scripts? Or maybe you need support for one of these scripts?

Well, you can purchase a support package. Purchasing a support package will help us to produce more free tools, and will allow you to get help from us if you need some.

Continue to the purchase page...