How to create a record recap of messages that caused a details DSN code

I make use of Sendmail on CENTOS 5.x, I wish this is a straightforward inquiry. =) I require to create a record recap of messages that caused a details DSN code. As an example:

Jan 11 07:43:34 server-example sendmail[12732]: p937blksdh3: to=<[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=102537, relay=mta.recipientdomain.com. [12.34.56.78], dsn=5.7.1, stat=Service unavailable

Normally, I would certainly simply grep for this details (something like: grep -i "dsn=5.7.1" /var/log/maillog). Yet the trouble is that this only returns a line like above and also does not inform me the sender of the message.

Preferably, I'm seeking a one - lining that can do the following:

  1. Search sendmail maillog for details DSN.
  2. Recognize the message - id for the e-mail. (I'm presuming awk '{print $}' would certainly be made use of?)
  3. Return the message information for each and every (probably grepping for the the message id fetched from action 2).

I'm a n00b at scripting/one - linings so I'm certain there is possibly a less complicated means to do this. Any kind of ideas?

0
2019-05-18 22:45:22
Source Share
Answers: 0