11<?php
22
33/*
4- Copyright (c) 2007, Till Brehm, projektfarm Gmbh
4+ Copyright (c) 2007 - 2009 , Till Brehm, projektfarm Gmbh
55All rights reserved.
66
77Redistribution and use in source and binary forms, with or without modification,
@@ -108,12 +108,16 @@ function update($event_name,$data) {
108108 } else {
109109 $ tpl = str_replace ('{DELETE} ' ,'0 ' ,$ tpl );
110110 }
111-
111+
112112 // Set the data retriever
113113 if ($ data ["new " ]["type " ] == 'pop3 ' ) {
114114 $ tpl = str_replace ('{TYPE} ' ,'SimplePOP3Retriever ' ,$ tpl );
115115 } elseif ($ data ["new " ]["type " ] == 'imap ' ) {
116116 $ tpl = str_replace ('{TYPE} ' ,'SimpleIMAPRetriever ' ,$ tpl );
117+ } elseif ($ data ["new " ]["type " ] == 'pop3ssl ' ) {
118+ $ tpl = str_replace ('{TYPE} ' ,'SimplePOP3SSLRetriever ' ,$ tpl );
119+ } elseif ($ data ["new " ]["type " ] == 'imapssl ' ) {
120+ $ tpl = str_replace ('{TYPE} ' ,'SimpleIMAPSSLRetriever ' ,$ tpl );
117121 }
118122
119123 // Set server, username, password and destination.
@@ -140,22 +144,12 @@ function update($event_name,$data) {
140144 function delete ($ event_name ,$ data ) {
141145 global $ app , $ conf ;
142146
143- // load the server specific configuration options for getmail
144- $ app ->uses ("getconf " );
145- $ getmail_config = $ app ->getconf ->get_server_config ($ conf ["server_id " ], 'getmail ' );
146- $ this ->getmail_config_dir = $ getmail_config ["getmail_config_dir " ];
147-
148147 $ config_file_path = escapeshellcmd ($ this ->getmail_config_dir .'/ ' .$ data ["old " ]["source_server " ].'_ ' .$ data ["old " ]["source_username " ].'.conf ' );
149148 if (stristr ($ config_file_path ,".. " ) || stristr ($ config_file_path ,"| " ) || stristr ($ config_file_path ,"; " ) || stristr ($ config_file_path ,'$ ' )) {
150149 $ app ->log ("Possibly faked path for getmail config file: ' $ config_file_path'. File is not written. " ,LOGLEVEL_ERROR );
151150 return false ;
152151 }
153- if (is_file ($ config_file_path )) {
154- unlink ($ config_file_path );
155- $ app ->log ("Deleting file: ' $ config_file_path'. " ,LOGLEVEL_DEBUG );
156- } else {
157- $ app ->log ("Nothing to delete: ' $ config_file_path'. " ,LOGLEVEL_DEBUG );
158- }
152+ if (is_file ($ config_file_path )) unlink ($ config_file_path );
159153 }
160154
161155
0 commit comments