The default bug view has changed. See this FAQ.

log bugmail sent to the syslog

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
General
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: glob, Assigned: glob)

Tracking

Production
x86
Mac OS X

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Created attachment 708020 [details] [diff] [review]
patch v1

for diagnostic, auditing, and graphing purposes, i'd like to see all sent bugmail result in a syslog entry.

the attached patch generates lines which look like:
> [bugmail] byron.jones@gmail.com (CC) bug-1599 query doesnt show all bugs
recipient, reason, bug-id, and subject.
Attachment #708020 - Flags: review?(dkl)
Comment on attachment 708020 [details] [diff] [review]
patch v1

Review of attachment 708020 [details] [diff] [review]:
-----------------------------------------------------------------

Had to do:

-use Encode qw(find_encoding);
+use Encode qw(find_encoding decode_utf8);

to allow it to work. After that it was fine. 

Question: do we need to santize the subject for emails that are in one or more secure groups? 

dkl

::: extensions/BMO/Extension.pm
@@ +968,5 @@
> +    $message_type ||= '?';
> +
> +    $subject =~ s/[\[\(]Bug \d+[\]\)]\s*//;
> +
> +    openlog('apache', 'cons', 'pid', 'local4');

openlog('apache', 'cons,pid', 'local4');
Attachment #708020 - Flags: review?(dkl) → review+
(Assignee)

Comment 2

4 years ago
(In reply to David Lawrence [:dkl] from comment #1)
> Question: do we need to santize the subject for emails that are in one or
> more secure groups? 

no, that syslog already contains things of a sensitive nature, so it's tightly secured.
(Assignee)

Comment 3

4 years ago
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.0/
modified extensions/BMO/Extension.pm
Committed revision 8469.

Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.0/
modified extensions/BMO/Extension.pm
Committed revision 8470.

Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/
modified extensions/BMO/Extension.pm
Committed revision 8534.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
jobqueue was not able to deliver quite a few emails due to a wide character issue and so i have committed a small change to disable the feature for now until we can sort it out. Filed bug 839282 to ask for a BMO code push.

Error:

Wide character in syswrite at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Sys/Syslog.pm line 765. at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Sys/Syslog.pm line 765 Sys::Syslog::_syslog_send_socket('<165>Feb 7 05:22:55 apache[2970]: [bugma 

From my understanding of the docs (and I should have seen this before when doing the review :() we need to encode_utf8 instead of decode_utf8 as syslog needs the characters in bytestream (binary) format or octets. So maybe we just need to make one simple change?

@@ -962,7 +960,7 @@
     $subject =~ s/[\[\(]Bug \d+[\]\)]\s*//;
 
     openlog('apache', 'cons,pid', 'local4');
-    syslog('notice', decode_utf8("[bugmail] $recipient ($message_type) $bug_id $subject"));
+    syslog('notice', encode_utf8("[bugmail] $recipient ($message_type) $bug_id $subject"));
     closelog();
 }

dkl
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
See Also: → bug 839282
(Assignee)

Comment 5

4 years ago
nuts.  looks like this fix has been committed and pushed.
Status: REOPENED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → FIXED
(Assignee)

Updated

4 years ago
Blocks: 839357
(Assignee)

Comment 6

4 years ago
ah, the logging was disabled, not fixed.

to make it easier to track, i've filed a bug 839357
You need to log in before you can comment on or make changes to this bug.