Skip to content

Commit 1fbea9d

Browse files
author
marknl
committed
FS#1522 - Add getmail configuration option read_all
implemented the patch supplied by Jan Vansteenkiste with the latest commit
1 parent 77c68a6 commit 1fbea9d

File tree

8 files changed

+29
-6
lines changed

8 files changed

+29
-6
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- database patch for getmail read_all option
2+
ALTER TABLE `mail_get` ADD ( `source_read_all` varchar(255) NOT NULL default 'y');

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ CREATE TABLE `mail_get` (
630630
`source_username` varchar(255) default NULL,
631631
`source_password` varchar(64) default NULL,
632632
`source_delete` varchar(255) NOT NULL default 'y',
633+
`source_read_all` varchar(255) NOT NULL default 'y',
633634
`destination` varchar(255) default NULL,
634635
`active` varchar(255) NOT NULL default 'y',
635636
PRIMARY KEY (`mailget_id`)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@
117117
'default' => 'y',
118118
'value' => array(0 => 'n',1 => 'y')
119119
),
120+
'source_read_all' => array (
121+
'datatype' => 'VARCHAR',
122+
'formtype' => 'CHECKBOX',
123+
'default' => 'y',
124+
'value' => array(0 => 'n',1 => 'y')
125+
),
120126
'destination' => array (
121127
'datatype' => 'VARCHAR',
122128
'formtype' => 'SELECT',

interface/web/mail/lib/lang/en_mail_get.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ $wb["source_server_txt"] = 'Pop3/Imap Server';
55
$wb["source_username_txt"] = 'Username';
66
$wb["source_password_txt"] = 'Password';
77
$wb["source_delete_txt"] = 'Delete emails after retrieval';
8+
$wb["source_read_all_txt"] = 'Retrieve all emails (incl. read mails)';
89
$wb["destination_txt"] = 'Destination';
910
$wb["active_txt"] = 'Active';
1011
$wb["limit_fetchmail_txt"] = 'The max. number of Fetchmail records for your account is reached.';

interface/web/mail/templates/mail_get_edit.htm

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ <h2><tmpl_var name="list_head_txt"></h2>
2424
<input name="source_password" id="source_password" value="{tmpl_var name='source_password'}" size="30" maxlength="255" type="password" class="textInput" />
2525
</div>
2626
<div class="ctrlHolder">
27-
<p class="label">{tmpl_var name='source_delete_txt'}</p>
28-
<div class="multiField">
29-
{tmpl_var name='source_delete'}
30-
</div>
31-
</div>
27+
<p class="label">{tmpl_var name='source_delete_txt'}</p>
28+
<div class="multiField">
29+
{tmpl_var name='source_delete'}
30+
</div>
31+
</div>
32+
<div class="ctrlHolder">
33+
<p class="label">{tmpl_var name='source_read_all_txt'}</p>
34+
<div class="multiField">
35+
{tmpl_var name='source_read_all'}
36+
</div>
37+
</div>
3238
<div class="ctrlHolder">
3339
<label for="destination">{tmpl_var name='destination_txt'}</label>
3440
<select name="destination" id="destination" class="selectInput">

server/conf/getmail.conf.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# message_log = /var/log/getmail.log
33
message_log_syslog = 1
44
delete = {DELETE}
5+
read_all = {READ_ALL}
56

67
[retriever]
78
type = {TYPE}

server/plugins-available/getmail_plugin.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ function update($event_name,$data) {
108108
} else {
109109
$tpl = str_replace('{DELETE}','0',$tpl);
110110
}
111+
112+
if($data["new"]["read_all"] == 'y') {
113+
$tpl = str_replace('{READ_ALL}', '1', $tpl);
114+
} else {
115+
$tpl = str_replace('{READ_ALL}', '0', $tpl);
116+
}
111117

112118
// Set the data retriever
113119
if($data["new"]["type"] == 'pop3') {

server/scripts/run-getmail.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ -f /tmp/.getmail_lock ]; then
1414
else
1515
touch /tmp/.getmail_lock
1616
if [ "$rcfiles" != "" ]; then
17-
/usr/bin/getmail -n -v -g /etc/getmail $rcfiles
17+
/usr/bin/getmail -v -g /etc/getmail $rcfiles
1818
fi
1919
rm -f /tmp/.getmail_lock
2020
fi

0 commit comments

Comments
 (0)