Mailing List CGatePro@mail.stalker.com Message #93082
From: William Pratt <billp@billpratt.net>
Subject: Re: CLI commands and queues
Date: Thu, 01 Nov 2007 13:21:31 -0700
To: CommuniGate Pro Discussions <CGatePro@mail.stalker.com>
We were dealing with quite large queue's (60k+ queued messages) and this was getting to be a problem, so I wrote a perl script that used Inotify to load message info into a database (and remove it on deletion), then we were able to use sql to query the queue for specialized alerts (spambots on our network, etc). If you are dealing with large queues or want this kind of functionality, you should look into it. I think the cpan module is called Linux-Inotify2, but my memory is not always perfect :). Loading the data was fast as CG already appends some indexing data to the top of the message, so I just scanned and loaded that data, and kept going until I grabbed the subject header, then loaded the data. This allowed for easy web based views by subject, sender IP, etc. Good Luck and feel free to shoot any questions my way off list.

-Bill

Jeff Wark wrote:
Thanks Bill.

Actually, we have several perl programs for scanning the queue and deleting messages [mostly based on IP address or something like that].  It just always feels a little bit icky.

I see this functionality available through the Admin interface and am a little disappointed it isn't mirrored in the CLI.  Oh well.  One can hope I guess.

On Thu, 01 Nov 2007 12:39:34 -0700
 William Pratt <billp@billpratt.net> wrote:
I actually requested (long ago) to have the RejectQueueMessage call added, and with a lot of convincing, was able to get it added. I was told at the time that this was not something they really wanted to do nor something they will support. With that said, it is very easy using common unix tools to automate the rejection of messages. Since all of the message file names are the message id, minus the .msg, a simple grep can give you a list. We used many automated cron jobs to do rejection based on spam subjects, etc using grep and a one line Perl script to strip off the .msg.

As far as the ReleaseSMTPQueue command, the queueName is simply the domain name. If you want to release the queue for yahoo, jut do ReleaseSMTPQueue('yahoo.com'), or a simple ETRN will do exactly the same thing.

Hope this helps a bit.
-Bill

Jeff Wark wrote:
This is perhaps a feature request or a silly question.

On the CLI page there are the following two commands:

*snip*
ReleaseSMTPQueue(queueName)
Example:
    $cli->ReleaseSMTPQueue('mail.domain.com')
    || die "Can't release queue: ".$cli->getErrMessage;

RejectQueueMessage(messageID [,errorText])
Example:
    $cli->RejectQueueMessage('123456','your message is rejected')
    || die "Can't reject message: ".$cli->getErrMessage;
*snip*

Are there any commands available [or in development] that would generate a list of current waiting/active queues or message ID's in a specific queue [for rejection purposes]?

My idea is that the programmable interface should be at least as capable, if not more capable than the webadmin interface.

So, my simple request is to have these Queue manipulation commands available so I don't have to use a mouse.

Thank you and have a great day.

Jeff Wark
TBayTel Internet

#############################################################
This message is sent to you because you are subscribed to
 the mailing list <CGatePro@mail.stalker.com>.
To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
To switch to the DIGEST mode, E-mail to <CGatePro-digest@mail.stalker.com>
To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
Send administrative queries to  <CGatePro-request@mail.stalker.com>

-- Sincerely,

William Pratt


#############################################################
This message is sent to you because you are subscribed to
 the mailing list <CGatePro@mail.stalker.com>.
To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
To switch to the DIGEST mode, E-mail to <CGatePro-digest@mail.stalker.com>
To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
Send administrative queries to  <CGatePro-request@mail.stalker.com>

Jeff Wark
TBayTel Internet

#############################################################
This message is sent to you because you are subscribed to
 the mailing list <CGatePro@mail.stalker.com>.
To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
To switch to the DIGEST mode, E-mail to <CGatePro-digest@mail.stalker.com>
To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
Send administrative queries to  <CGatePro-request@mail.stalker.com>

--
Sincerely,

William Pratt

Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster