Skip to content

Commit 8829e1c

Browse files
committed
Added: FS#693 - Add SSL options to GETMAIL section so getmail can be used with gmail and others that force SSL
1 parent c2f53e7 commit 8829e1c

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

interface/web/mail/form/mail_get.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
'datatype' => 'VARCHAR',
7474
'formtype' => 'SELECT',
7575
'default' => '',
76-
'value' => array('pop3' => 'POP3','imap'=>'IMAP')
76+
'value' => array('pop3' => 'POP3','imap'=>'IMAP','pop3ssl' => 'POP3SSL','imapssl'=>'IMAPSSL')
7777
),
7878
'source_server' => array (
7979
'datatype' => 'VARCHAR',

server/plugins-available/getmail_plugin.inc.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
4+
Copyright (c) 2007 - 2009, Till Brehm, projektfarm Gmbh
55
All rights reserved.
66
77
Redistribution 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

Comments
 (0)