marknl
2011-08-26 1fbea9d98636c40cfe761e8f531d6b3821ab7e28
FS#1522 - Add getmail configuration option read_all 

implemented the patch supplied by Jan Vansteenkiste with the latest commit
7 files modified
1 files added
35 ■■■■ changed files
install/sql/incremental/upd_0014.sql 2 ●●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 1 ●●●● patch | view | raw | blame | history
interface/web/mail/form/mail_get.tform.php 6 ●●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/en_mail_get.lng 1 ●●●● patch | view | raw | blame | history
interface/web/mail/templates/mail_get_edit.htm 16 ●●●●● patch | view | raw | blame | history
server/conf/getmail.conf.master 1 ●●●● patch | view | raw | blame | history
server/plugins-available/getmail_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
server/scripts/run-getmail.sh 2 ●●● patch | view | raw | blame | history
install/sql/incremental/upd_0014.sql
New file
@@ -0,0 +1,2 @@
-- database patch for getmail read_all option
ALTER TABLE `mail_get` ADD ( `source_read_all` varchar(255) NOT NULL default 'y');
install/sql/ispconfig3.sql
@@ -630,6 +630,7 @@
  `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`)
interface/web/mail/form/mail_get.tform.php
@@ -117,6 +117,12 @@
            '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',
interface/web/mail/lib/lang/en_mail_get.lng
@@ -5,6 +5,7 @@
$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.';
interface/web/mail/templates/mail_get_edit.htm
@@ -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">
server/conf/getmail.conf.master
@@ -2,6 +2,7 @@
# message_log = /var/log/getmail.log
message_log_syslog = 1
delete = {DELETE}
read_all = {READ_ALL}
[retriever]
type = {TYPE}
server/plugins-available/getmail_plugin.inc.php
@@ -108,6 +108,12 @@
                } 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') {
server/scripts/run-getmail.sh
@@ -14,7 +14,7 @@
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