From 80974679094063965bc346695db251e095a491ff Mon Sep 17 00:00:00 2001 From: pf4public Date: Mon, 16 May 2016 18:01:31 +0300 Subject: [PATCH] closes #8 --- config.inc.php.dist | 3 +++ fetchmail.php | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.inc.php.dist b/config.inc.php.dist index 9f80723..bc3a1ce 100644 --- a/config.inc.php.dist +++ b/config.inc.php.dist @@ -6,4 +6,7 @@ $rcmail_config ['fetchmail_limit'] = 10; // allow remote folder setting $rcmail_config ['fetchmail_folder'] = false; +// mda for fetchmail +$rcmail_config ['fetchmail_mda'] = ''; + ?> diff --git a/fetchmail.php b/fetchmail.php index 34f8f55..39a16ba 100644 --- a/fetchmail.php +++ b/fetchmail.php @@ -116,20 +116,21 @@ function save() { } else { $fetchall = 1; } + $mda = $rcmail->config->get ( 'fetchmail_mda' ); if ($newentry or $id == '') { $sql = "SELECT * FROM fetchmail WHERE mailbox='" . $mailbox . "'"; $result = $rcmail->db->query ( $sql ); $limit = $rcmail->config->get ( 'fetchmail_limit' ); $num_rows = $rcmail->db->num_rows ( $result ); if ($num_rows < $limit) { - $sql = "INSERT INTO fetchmail (mailbox, active, src_server, src_user, src_password, src_folder, poll_time, fetchall, keep, protocol, usessl, src_auth) VALUES ('$mailbox', '$enabled', '$server', '$user', '$pass', '$folder', '$pollinterval', '$fetchall', '$keep', '$protocol', '$usessl', 'password' )"; + $sql = "INSERT INTO fetchmail (mailbox, active, src_server, src_user, src_password, src_folder, poll_time, fetchall, keep, protocol, usessl, src_auth, mda) VALUES ('$mailbox', '$enabled', '$server', '$user', '$pass', '$folder', '$pollinterval', '$fetchall', '$keep', '$protocol', '$usessl', 'password', '$mda' )"; $insert = $rcmail->db->query ( $sql ); $rcmail->output->command ( 'display_message', $this->gettext ( 'successfullysaved' ), 'confirmation' ); } else { $rcmail->output->command ( 'display_message', 'Error: ' . $this->gettext ( 'fetchmaillimitreached' ), 'error' ); } } else { - $sql = "UPDATE fetchmail SET mailbox = '$mailbox', 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'"; + $sql = "UPDATE fetchmail SET mailbox = '$mailbox', 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'"; $update = $rcmail->db->query ( $sql ); $rcmail->output->command ( 'display_message', $this->gettext ( 'successfullysaved' ), 'confirmation' ); }