[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - Forwarding script question

Forwarding script question

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Forwarding script question

Postby dribnus » Sat May 14, 2005 1:43 am

I have searched here and at JDFSoftware, and cannot figure this out. I'm trying to create a script that will do the following:

Take an incoming message ->
Truncate it to 150 characters ->
then Forward it to another email address with the "TO" and "FROM" headers still in place.

I did find 2 scripts that dealt with truncating, but I can't seem to get them to work.
Any help with this would be appreciated.
dribnus
Poco Enthusiast
 
Posts: 221
Joined: Fri Jul 30, 2004 3:33 am

Postby Michael » Sat May 14, 2005 4:22 am

You need to setup a filter to do the forwarding and then use the script from the site on the outgoing message. For example, if you want to filter all messages from "someone AT somewhere.com" to "mycellphone AT cell phone company" you should:
  1. Setup a incoming message filter:
    • Condition: "Search From For "someone AT somewhere.com"
    • Perform: Forward message To "mycellphone AT cell phone company"
  2. Setup an outgoing message filter:
    • Condition: To "mycellphone AT cell phone company"
    • Perform: "Run script" "TruncateMessage"
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby dribnus » Sat May 14, 2005 4:39 am

I can't seem to find the TruncateMessage script. Here are the 2 I found, but I can't get them to work. No errors, but no change in the text either.

ReadBody $body %message
CharCount #size $body
If #size < 110 Then Done
ClearBody %message
ChopString $body 111 #size
AssignBody %message $body
<p> :Done
Exit
-------------------------------------------------------------------
ReadBody $body %message
CharCount #size %body
ChopString $body 200 #size
dribnus
Poco Enthusiast
 
Posts: 221
Joined: Fri Jul 30, 2004 3:33 am

Postby Michael » Sat May 14, 2005 5:23 am

The first script looks like it should work. I don't have time to test it now. Are you invoking it as I described in my previous posting?
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby dribnus » Sat May 14, 2005 6:06 am

Ok, got it.....thanx for your help
dribnus
Poco Enthusiast
 
Posts: 221
Joined: Fri Jul 30, 2004 3:33 am


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron