Mailing List Message #101356
From: Nicolas Hatier <>
Subject: Re: Perl scripting for PIPE
Date: Tue, 11 Jan 2011 11:25:11 -0500
To: CommuniGate Pro Discussions <>
Glad it worked.

If ever you implement something else submitting mail via PIPE, especially if it can submit several messages in a short time, make sure to use a unique filename so you don't overwrite a previously submitted one. CGP may take several seconds to process them and overwriting means mail loss. You can use a timestamp and a random value or unique counter in your filename, for instance.

In would also be better to use mv instead of cp on notify.tmp -> notify.sub.
From the documentation: "Because of the way the PIPE module processes the Submitted folder, it is recommended to compose messages in a different file directory and then move the composed .sub files to the Submitted folder, or to compose messages in the Submitted folder, in files with the .tmp file name extension, and then change the file name extension to .sub."

Making a copy "takes time", and there is a risk CGP will process the mail before the copy is complete, leading to an incomplete message.


On 2011-01-11 09:54, Dan Pratt wrote:
Works after removing the router entry! I created that after trying to follow the documentation under "Delivering to External Applications". Thank you! 

I manually created the file notify.tmp in /var/CommuniGate/Submitted. Then did a cp notify.tmp notify.sub.

Now I just have to get my original backup shell script to add the file to the Submitted directory and I'm good to go.

- Dan


From:	Nicolas Hatier <>
Subject:	Re: Perl scripting for PIPE
Date:	Mon, 10 Jan 2011 23:15:45 -0500
To:	CommuniGate Pro Discussions <>

myusername@pipe ? Where does that come from? To you have special router instructions related to PIPE? Note that you don't need any specific router entry for my example to work. If you tried to configure some PIPE-specific router entries to make that work, remove or disable them.



On 2011-01-10 23:00, Dan Pratt wrote:
No luck. Below is what I get in the logs. 

BTW, I had a router entry of: 

 = execmyusername@pipe

21:45:45.001 4 ROUTER Input(Mail): 

21:45:45.001 5 ROUTER PARSER: '
' -> 'myusername' at ''
21:45:45.001 4 ROUTER Alias: -> 'myusername@pipe'
21:45:45.001 5 ROUTER SYSTEM: -> 'myusername@pipe'
21:45:45.001 5 ROUTER PARSER: 'myusername@pipe' -> 'execmyusername' at 'pipe'
21:45:45.001 1 ROUTER PIPE: '
' rejected. Error Code=External Applications Directory is not specified
21:45:45.001 1 DEQUEUER [9064558] SYSTEM()
 failed: External Applications Directory is not specified


From:	Nicolas Hatier 

Subject:	Re: Perl scripting for PIPE
Date:	Mon, 10 Jan 2011 21:53:15 -0500
To:	CommuniGate Pro Discussions 

You don't absolutely need a Perl script.

All you have to do is put a message in the PIPE directory - usually /var/Communigate/Submitted
In the file, you can put a normal email message with headers, such as

From: Root
Subject: Nightly backup 

Nightly backup $NOWDATE completed

CGP will process it and send it to the To address. You can include an Envelope-To: header if you want the recipient to be something else than the To: header.

Name your file something.tmp while you're writing it, then rename it something.sub. CGP processes *.sub every 15 seconds by default. 


On 2011-01-10 18:16, Daniel Pratt wrote:

I have a shell script that runs every morning at 3am backing up the /var/CommuniGate directory to a second volume. Works great. New file every night date stamped correctly. At the end of the script I want it to send me an email notification to my gmail account.

So I did:

    echo "Nightly backup $NOWDATE completed" | mail -s "Nightly Backup"

However, that won't work as the installer renames the /usr/bin/mail program to /usr/bin/LegacyMail.

So now my messages end up in the Submitted folder as .sub files. Researching this I need to get a Perl script for the PIPE Application Directory setting to trigger to get my simple email notification to go out.

I'm not up on Perl scripting (obviously should be). Has someone already created a script to do this?

Should I approach this differently?


- Dan Pratt
Mac OS X (10.6.4) / MacMini SnowLeopard Server
/var/Communigate directory on Promise SmartStor DS4600 RAID Tower
This message is sent to you because you are subscribed to
  the mailing list 


To unsubscribe, E-mail to: 


To switch to the DIGEST mode, E-mail to 


To switch to the INDEX mode, E-mail to 


Send administrative queries to  




Nicolas Hatier, ing. <>
Niversoft idées logicielles -

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