Skip to content

Commit 0e96141

Browse files
authored
Option to disable writing mda to database (#38)
1 parent 466bf79 commit 0e96141

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ In case you need to edit default-set settings, you may copy `config.inc.php.dist
5959
* `$config['fetchmail_db_dsn']` allows you to use a fetchmail database outside the Roundcube database, e.g. from an existing Postfix Admin installation. see [Roundcube configuration options](https://github.com/roundcube/roundcubemail/wiki/Configuration#database-connection) for correct syntax. If set to `null`, Roundcube Database is used. Default is `null`.
6060
* `$config['fetchmail_folder']` whether to allow users to specify IMAP folder they wish to download mail from. Default is `false`.
6161
* `$config['fetchmail_limit']` limits the number of external mailboxes per user allowed. Default is `10`.
62-
* `$config['fetchmail_mda']` allows you to specify mda field for fetchmail. This could be useful in case you want to deliver downloaded mail via MDA or LDA directly, rather than forwarding via SMTP or LMTP. For more information please refer to [fetchmail manual](http://www.fetchmail.info/fetchmail-man.html) and [fetchmail.pl](https://github.com/postfixadmin/postfixadmin/blob/master/ADDITIONS/fetchmail.pl) script. Default is `''`, i.e. not used.
62+
* `$config['fetchmail_mda']` allows you to specify mda field for fetchmail. This could be useful in case you want to deliver downloaded mail via MDA or LDA directly, rather than forwarding via SMTP or LMTP. For more information please refer to [fetchmail manual](http://www.fetchmail.info/fetchmail-man.html) and [fetchmail.pl](https://github.com/postfixadmin/postfixadmin/blob/master/ADDITIONS/fetchmail.pl) script. Default is `''`, i.e. mda is skipped. Possibly existing values are left untouched.
6363

6464
## License
6565
This software distributed under the terms of the GNU General Public License as published by the Free Software Foundation

fetchmail.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ public function save()
175175
}
176176
else
177177
{
178+
if($mda != '')
179+
{
178180
$sql = "UPDATE fetchmail SET mailbox = '$mailbox', domain = '$mailbox_domain', active = '$enabled', keep = '$keep', protocol = '$protocol', src_server = '$server', src_user = '$user', src_password = '$pass', src_folder = '$folder', poll_time = '$pollinterval', fetchall = '$fetchall', usessl = '$usessl', src_auth = 'password', mda = '$mda' WHERE id = '$id'";
181+
} else {
182+
$sql = "UPDATE fetchmail SET mailbox = '$mailbox', domain = '$mailbox_domain', active = '$enabled', keep = '$keep', protocol = '$protocol', src_server = '$server', src_user = '$user', src_password = '$pass', src_folder = '$folder', poll_time = '$pollinterval', fetchall = '$fetchall', usessl = '$usessl', src_auth = 'password' WHERE id = '$id'";
183+
}
179184
$update = $this->db->query($sql);
180185
if ($err_str = $this->db->is_error())
181186
{

0 commit comments

Comments
 (0)