[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 - remove winmail.dat

remove winmail.dat

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

remove winmail.dat

Postby ericjacobowitz » Sat May 07, 2005 3:10 pm

Anyone have a script to remove the winmail.dat file that sometimes gets attached to an email from Outlook users?
Eric Jacobowitz
ericjacobowitz
Resident Poster
 
Posts: 147
Joined: Tue Apr 19, 2005 12:52 am

Postby Michael » Sun May 08, 2005 4:20 am

I don't but I also offer a word of caution here, if the sender is attaching a word document to their email there are circumstances when it will be sent within the winmail.dat file!
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby ericjacobowitz » Mon May 09, 2005 1:22 am

Here is the script that I have, but it is not working

     ReadAttached $AttachedFiles %message
     If "winmail" ^ $AttachedFiles Then WinMailPrefix
     Exit
     :WinMailPrefix
     If ".dat" ^ $AttachedFiles Then WinMail
     Exit
     :WinMail
     DeleteAttached "winmail.dat"

What am I missing?
Eric Jacobowitz
ericjacobowitz
Resident Poster
 
Posts: 147
Joined: Tue Apr 19, 2005 12:52 am

Postby Michael » Mon May 09, 2005 2:56 am

If you are running this script against incoming messages it should work, if you are running it against selected messages after they have arrived you will need to add a "SaveMessage" command to the script. This will probably duplicate the message. This is ok for now (until you've tested it), when you are satisfied then you can add a "DeleteMessage" command before the SaveMessage command (and test that on a sample message before commiting to the change).

Here is a sample of code for the SaveMessage command. The AppendToFile may be unnecessary due to recent changes but I typically put it in in case people using older versions of Poco get hold of the script.
Code: Select all
  AppendToFile True
  SaveMessage %Message $CurrentMailbox
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron