[dev] User e-mail address in problem reports
John Morrissey
jwm-horde-dev@rpa.net
Wed, 27 Dec 2000 20:31:37 -0500
---------------------- multipart/mixed attachment
On Wed, Dec 27, 2000 at 07:07:26PM -0500, Jon Parise wrote:
% I'd suggest submitting the patch (unified diff, please) to this list.
% There's less thinking on our part that way. <grin> If it looks good,
% someone will commit.
To my chagrin, I just found that the code silently sends mail as from the
logged-in user. However, it uses $imp['user'] instead of a complete e-mail
address. The spam reporting feature does the same thing. Attached uses
get_barefrom() to get a valid address, including any user preferences.
john
--
John Morrissey _o /\ ---- __o
RPA Internet _-< \_ / \ ---- < \,
jwm@rpa.net __(_)/_(_)________/ \_______(_) /_(_)__
---------------------- multipart/mixed attachment
--- horde/imp/templates/menu/menu.inc.orig Wed Dec 27 19:57:20 2000
+++ horde/imp/templates/menu/menu.inc Wed Dec 27 20:10:53 2000
@@ -29,7 +29,7 @@
/* Horde menu items */
if ($conf['problems']['enabled']) {
- pmenuItem(Horde::url($conf['horde']['paths']['root'] . '/problem.php?current_user=' . $imp['user'] . '&return_url=' . Horde::url('mailbox.php', true)), _("Problem?"), 'exclamation.gif');
+ pmenuItem(Horde::url($conf['horde']['paths']['root'] . '/problem.php?current_user=' . get_barefrom() . '&return_url=' . Horde::url('mailbox.php', true)), _("Problem?"), 'exclamation.gif');
}
/* Additional site-specific menu items */
--- horde/imp/message.php.orig Wed Dec 27 20:15:47 2000
+++ horde/imp/message.php Wed Dec 27 20:16:17 2000
@@ -257,7 +257,7 @@
$headers['Message-ID'] = '<' . uniqid(time() . '.') . '@' . $SERVER_NAME . '>';
$headers['Date'] = date('r');
$headers['To'] = $conf['spam']['email'];
- $headers['From'] = $imp['user'];
+ $headers['From'] = get_barefrom();
$recipients = $conf['spam']['email'];
$headers['Subject'] = _("Spam Report from") . ' ' . $imp['user'];
$headers = $mime->header($headers);
---------------------- multipart/mixed attachment--