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

RUNS AS: EXECUTE action.
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 formating) 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.

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) - 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.

Fast Mailbox Conversion

RUNS AS: External Script.
Requires: Perl.

These scripts will help you do the painful mbox to mdir conversion process for you (or the inverse...).

These scripts are designed to convert only one mailbox, but they could easily be modified to convert a full account or a full domain.

These scripts are a lot faster than the Mailbox Conversion script, but they work at filesystem level so they will require the CGP server to be stopped before running them.

Find Attachments

RUNS AS: EXTFILTER Helper application.
Requires: Perl.

This script is intended to add specific headers to messages that contains attachments. The filter finds attachments in the message, 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 is two version 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.

Headertrimmer adaptor

RUNS AS: EXTFILTER Helper application.
Requires: Perl. Header Trimmer script and its dependencies.

A Communigate Pro™ adaptor for HeaderTrimmer, to be able to run it as an external filter. Learn about header trimmer.

Somme little modifications have to be applied on Headertrimmer, see the adaptor script for details.

This adaptor script can also be modified to be used with other scripts.

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 introduce little modifications to it: 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 contains line longer than 1023 chars. This could be helpful if you use a relay or if your mail passes through another mail server software that have such a limitation.

Mailbox Conversion

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

This script will do the painful mbox to mdir conversion process for you (or the inverse...). This script is designed to convert only one account per run, but it probably can be easily modified to convert one entire domain. Just run it and give it basic info: the destination type, the domain name, the postmaster's password, and the account to convert. Please read carefully the notice that is printed on start, it contains critical information about this script.

The script automatically set account limits (size & number of mailboxes) to Unlimited before starting the conversion, so you don't have to do it by hand, and the script can copy data without getting a Accout Full message. These settings are automatically reset to previous value at the end of the script, unless the script ends with an error (for instance if an IMAP client is connected to the account). It also preserves the mailbox class.

See also the Fast Mailbox Conversion script

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

RUNS AS: EXECUTE action.
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 unindentifiable 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 a 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 than it. And it will 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.

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 wich 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 producing other tools as useful and 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...