Commit 1fbea9d9 authored by marknl's avatar marknl
Browse files

FS#1522 - Add getmail configuration option read_all

implemented the patch supplied by Jan Vansteenkiste with the latest commit
parent 77c68a69
-- database patch for getmail read_all option
ALTER TABLE `mail_get` ADD ( `source_read_all` varchar(255) NOT NULL default 'y');
\ No newline at end of file
......@@ -630,6 +630,7 @@ CREATE TABLE `mail_get` (
`source_username` varchar(255) default NULL,
`source_password` varchar(64) default NULL,
`source_delete` varchar(255) NOT NULL default 'y',
`source_read_all` varchar(255) NOT NULL default 'y',
`destination` varchar(255) default NULL,
`active` varchar(255) NOT NULL default 'y',
PRIMARY KEY (`mailget_id`)
......
......@@ -117,6 +117,12 @@ $form["tabs"]['mailget'] = array (
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
'source_read_all' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
'destination' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
......
......@@ -5,6 +5,7 @@ $wb["source_server_txt"] = 'Pop3/Imap Server';
$wb["source_username_txt"] = 'Username';
$wb["source_password_txt"] = 'Password';
$wb["source_delete_txt"] = 'Delete emails after retrieval';
$wb["source_read_all_txt"] = 'Retrieve all emails (incl. read mails)';
$wb["destination_txt"] = 'Destination';
$wb["active_txt"] = 'Active';
$wb["limit_fetchmail_txt"] = 'The max. number of Fetchmail records for your account is reached.';
......
......@@ -24,11 +24,17 @@
<input name="source_password" id="source_password" value="{tmpl_var name='source_password'}" size="30" maxlength="255" type="password" class="textInput" />
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='source_delete_txt'}</p>
<div class="multiField">
{tmpl_var name='source_delete'}
</div>
</div>
<p class="label">{tmpl_var name='source_delete_txt'}</p>
<div class="multiField">
{tmpl_var name='source_delete'}
</div>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='source_read_all_txt'}</p>
<div class="multiField">
{tmpl_var name='source_read_all'}
</div>
</div>
<div class="ctrlHolder">
<label for="destination">{tmpl_var name='destination_txt'}</label>
<select name="destination" id="destination" class="selectInput">
......
......@@ -2,6 +2,7 @@
# message_log = /var/log/getmail.log
message_log_syslog = 1
delete = {DELETE}
read_all = {READ_ALL}
[retriever]
type = {TYPE}
......
......@@ -108,6 +108,12 @@ class getmail_plugin {
} else {
$tpl = str_replace('{DELETE}','0',$tpl);
}
if($data["new"]["read_all"] == 'y') {
$tpl = str_replace('{READ_ALL}', '1', $tpl);
} else {
$tpl = str_replace('{READ_ALL}', '0', $tpl);
}
// Set the data retriever
if($data["new"]["type"] == 'pop3') {
......
......@@ -14,7 +14,7 @@ if [ -f /tmp/.getmail_lock ]; then
else
touch /tmp/.getmail_lock
if [ "$rcfiles" != "" ]; then
/usr/bin/getmail -n -v -g /etc/getmail $rcfiles
/usr/bin/getmail -v -g /etc/getmail $rcfiles
fi
rm -f /tmp/.getmail_lock
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment