Project

General

Profile

Feature #116

Add script to parse mail log and generate a report (CSV attachment) of all 'Client host rejected: cannot find your hostname' rejection warnings

Added by Deoren Moor about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Report - Rejection Warnings
Target version:
Start date:
07/27/2013
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

Here's an example of what the script would look at in the mail log (spacing added by me for readability):

Jul 27 07:18:46 mail postfix/smtpd[24192]: NOQUEUE: reject_warning: RCPT from unknown[5.57.10.188]: 450 4.7.1 Client host rejected: cannot find your hostname, [5.57.10.188]; from=<hvffz@iqwamw.net> to=<moneybags@example.com> proto=ESMTP helo=<5-57-10-188.elcat.kg>

Jul 27 07:54:52 mail postfix/smtpd[24223]: NOQUEUE: reject_warning: RCPT from unknown[186.56.12.105]: 450 4.7.1 Client host rejected: cannot find your hostname, [186.56.12.105]; from=<couponscdkdn@alphatech.com.tr> to=<coupons@example.com> proto=ESMTP helo=<[186.56.12.105]>

Jul 27 07:59:13 mail postfix/smtpd[24231]: NOQUEUE: reject_warning: RCPT from unknown[24.143.10.149]: 450 4.7.1 Client host rejected: cannot find your hostname, [24.143.10.149]; from=<moneybagspgcah@arluff.com> to=<moneybags@example.com> proto=ESMTP helo=<h149.10.143.24.cable.communicomm.com>

Jul 27 08:38:16 mail postfix/smtpd[24276]: NOQUEUE: reject_warning: RCPT from unknown[41.78.157.227]: 450 4.7.1 Client host rejected: cannot find your hostname, [41.78.157.227]; from=<moneybagsfjc@adorematernity.com.au> to=<moneybags@example.com> proto=ESMTP helo=<[41.78.157.227]>

Associated revisions

Revision 2 (diff)
Added by Deoren Moor about 4 years ago

[issues #116]
First draft at creating a CSV report of all reject warnings in a specified log file. Bundling the input file as an attachment isn't working yet.

Revision 3 (diff)
Added by Deoren Moor about 4 years ago

[issues #116]
  • Changed output file extension to something Mail clients will find more acceptable (specifically Outlook)
  • Incorporated different MIME/attachment code to properly attach CSV output file as an attachment
  • Added email summary as the plain-text part of the email
  • Changed email function to match what I based the changes off of

Ref: http://stackoverflow.com/a/3363254

Revision 4 (diff)
Added by Deoren Moor about 4 years ago

[issues #116]
Allowing for one or two whitespace characters between month and date.

Revision 5 (diff)
Added by Deoren Moor about 4 years ago

[issues #116]
Capturing the rejection warning reason.

Revision 6 (diff)
Added by Deoren Moor about 4 years ago

[issues #116]
Forgot string formatting anchors (oops).

Revision 7 (diff)
Added by Deoren Moor about 4 years ago

[issues #116]
Added missing header column (I see why Git is popular).

History

#1 Updated by Deoren Moor about 4 years ago

Since my testing had only involved sample log entries that had two digits in the date field I didn't realize that I was excluding entries with only one digit. r4 fixes this by allowing 1 or 2 digits for the date field.

#2 Updated by Deoren Moor about 4 years ago

  • Subject changed from Add script to parse mail log and generate a report (CSV attachment) of all rejection warnings to Add script to parse mail log and generate a report (CSV attachment) of all 'Client host rejected: cannot find your hostname' rejection warnings

#3 Updated by Deoren Moor about 4 years ago

  • Category set to Report - Rejection Warnings
  • Status changed from Assigned to Closed
  • Resolution set to Fixed

With a limited scope, this has been completed as of r7.

#4 Updated by Deoren Moor about 4 years ago

  • Target version set to 0.1

Also available in: Atom PDF