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
New file |
| | |
| | | -- database patch for getmail read_all option |
| | | ALTER TABLE `mail_get` ADD ( `source_read_all` varchar(255) NOT NULL default 'y'); |
| | |
| | | `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`) |
| | |
| | | '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', |
| | |
| | | $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.'; |
| | |
| | | <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"> |
| | |
| | | # message_log = /var/log/getmail.log |
| | | message_log_syslog = 1 |
| | | delete = {DELETE} |
| | | read_all = {READ_ALL} |
| | | |
| | | [retriever] |
| | | type = {TYPE} |
| | |
| | | } 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') { |
| | |
| | | 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 |