How to generate a report summary of messages that triggered a specific DSN codeSendmail stopped sending...

Is it bad writing or bad story telling if first person narrative contains more information than the narrator knows?

Is it a Munchausen Number?

Why are parallelograms defined as quadrilaterals? What term would encompass polygons with greater than two parallel pairs?

We are two immediate neighbors who forged our own powers to form concatenated relationship. Who are we?

Was the Highlands Ranch shooting the 115th mass shooting in the US in 2019

Windows OS quantum vs. SQL OS Quantum

How to make a language evolve quickly?

is it permitted to swallow spit on a fast day?

Exception propagation: When to catch exceptions?

Watching the game, having a puzzle

Has there been evidence of any other gods?

Should I pay on student loans in deferment or continue to snowball other debts?

How can I avoid subordinates and coworkers leaving work until the last minute, then having no time for revisions?

Why are low spin tetrahedral complexes so rare?

My perfect evil overlord plan... or is it?

No such column 'DeveloperName' on entity 'RecordType' after Summer '19 release on sandbox

Is there an application which does HTTP PUT?

How did Thanos not realise this had happened at the end of Endgame?

Why do unstable nuclei form?

Two researchers want to work on the same extension to my paper. Who to help?

Why is the Sun made of light elements only?

Thesis' "Future Work" section – is it acceptable to omit personal involvement in a mentioned project?

Why did Captain America age?

How to find the tex encoding of specific fonts?



How to generate a report summary of messages that triggered a specific DSN code


Sendmail stopped sending mails, “did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA”How do I stop recurring error messages from appearing in messages and auditd.log?How to generate a text report in Linux?How to output detail message about 5.x.x error on SendmailCan't send mail via sendmailHow do I hide warning messages that come from a specific command?How do you specify a blkparse format specifier that also suppresses summarySendmail error dsn=4.0.0 stat=Deferred: Connection refused by [127.0.0.1]Write script to generate report on every ThursdaySendmail queueing and not sending local mail promptly






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















I use Sendmail on CENTOS 5.x,
I hope this is a simple question. =) I need to generate a report summary of messages that triggered a specific DSN code. For example:



Jan 11 07:43:34 server-example sendmail[12732]: p937blksdh3: to=<someuser@recipientdomain.com>, 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 just grep for this information (something like: grep -i "dsn=5.7.1" /var/log/maillog). But the problem is that this only returns a line like above and doesn't tell me the sender of the message.



Ideally, I'm looking for a one-liner that can do the following:




  1. Search sendmail maillog for specific DSN.

  2. Identify the message-id for the email. (I'm guessing awk '{print $}' would be used?)

  3. Return the message details for each (presumably grepping for the the message id retrieved from step 2).










share|improve this question




















  • 1





    For those of us who aren't specifically familiar with sendmail, it might help if you post a more complete set of log lines, and describe exactly what details you're paying attention to when you do this manually. For example, in the line you've posted, is p937blksdh3 the message-id?

    – Jander
    Jan 22 '11 at 2:59


















2















I use Sendmail on CENTOS 5.x,
I hope this is a simple question. =) I need to generate a report summary of messages that triggered a specific DSN code. For example:



Jan 11 07:43:34 server-example sendmail[12732]: p937blksdh3: to=<someuser@recipientdomain.com>, 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 just grep for this information (something like: grep -i "dsn=5.7.1" /var/log/maillog). But the problem is that this only returns a line like above and doesn't tell me the sender of the message.



Ideally, I'm looking for a one-liner that can do the following:




  1. Search sendmail maillog for specific DSN.

  2. Identify the message-id for the email. (I'm guessing awk '{print $}' would be used?)

  3. Return the message details for each (presumably grepping for the the message id retrieved from step 2).










share|improve this question




















  • 1





    For those of us who aren't specifically familiar with sendmail, it might help if you post a more complete set of log lines, and describe exactly what details you're paying attention to when you do this manually. For example, in the line you've posted, is p937blksdh3 the message-id?

    – Jander
    Jan 22 '11 at 2:59














2












2








2








I use Sendmail on CENTOS 5.x,
I hope this is a simple question. =) I need to generate a report summary of messages that triggered a specific DSN code. For example:



Jan 11 07:43:34 server-example sendmail[12732]: p937blksdh3: to=<someuser@recipientdomain.com>, 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 just grep for this information (something like: grep -i "dsn=5.7.1" /var/log/maillog). But the problem is that this only returns a line like above and doesn't tell me the sender of the message.



Ideally, I'm looking for a one-liner that can do the following:




  1. Search sendmail maillog for specific DSN.

  2. Identify the message-id for the email. (I'm guessing awk '{print $}' would be used?)

  3. Return the message details for each (presumably grepping for the the message id retrieved from step 2).










share|improve this question
















I use Sendmail on CENTOS 5.x,
I hope this is a simple question. =) I need to generate a report summary of messages that triggered a specific DSN code. For example:



Jan 11 07:43:34 server-example sendmail[12732]: p937blksdh3: to=<someuser@recipientdomain.com>, 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 just grep for this information (something like: grep -i "dsn=5.7.1" /var/log/maillog). But the problem is that this only returns a line like above and doesn't tell me the sender of the message.



Ideally, I'm looking for a one-liner that can do the following:




  1. Search sendmail maillog for specific DSN.

  2. Identify the message-id for the email. (I'm guessing awk '{print $}' would be used?)

  3. Return the message details for each (presumably grepping for the the message id retrieved from step 2).







linux centos grep sendmail






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 3 hours ago









Rui F Ribeiro

42.7k1486146




42.7k1486146










asked Jan 21 '11 at 21:44









Mike BMike B

3,304205578




3,304205578








  • 1





    For those of us who aren't specifically familiar with sendmail, it might help if you post a more complete set of log lines, and describe exactly what details you're paying attention to when you do this manually. For example, in the line you've posted, is p937blksdh3 the message-id?

    – Jander
    Jan 22 '11 at 2:59














  • 1





    For those of us who aren't specifically familiar with sendmail, it might help if you post a more complete set of log lines, and describe exactly what details you're paying attention to when you do this manually. For example, in the line you've posted, is p937blksdh3 the message-id?

    – Jander
    Jan 22 '11 at 2:59








1




1





For those of us who aren't specifically familiar with sendmail, it might help if you post a more complete set of log lines, and describe exactly what details you're paying attention to when you do this manually. For example, in the line you've posted, is p937blksdh3 the message-id?

– Jander
Jan 22 '11 at 2:59





For those of us who aren't specifically familiar with sendmail, it might help if you post a more complete set of log lines, and describe exactly what details you're paying attention to when you do this manually. For example, in the line you've posted, is p937blksdh3 the message-id?

– Jander
Jan 22 '11 at 2:59










1 Answer
1






active

oldest

votes


















2














In bash



dsn=5.7.1
$ grep $dsn /var/log/maillog | awk '{print $6}' | awk -F: '{print $1}'


returns:



p937blksdh3


Of the line you posted, I'm guessing that is the message id?



OK, it's not one line. Then grep for that for message details, where are the message details kept?






share|improve this answer


























  • Thanks. That pointed me in the right direction. The final one-liner I came up with is a variation of that and includes a for loop: grep -i "dsn=5" /var/log/maillog | awk '{print $6}' | sed 's/://' | while read -r x; do grep -i "$x" /var/log/maillog; done

    – Mike B
    Feb 14 '14 at 0:07












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f6265%2fhow-to-generate-a-report-summary-of-messages-that-triggered-a-specific-dsn-code%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














In bash



dsn=5.7.1
$ grep $dsn /var/log/maillog | awk '{print $6}' | awk -F: '{print $1}'


returns:



p937blksdh3


Of the line you posted, I'm guessing that is the message id?



OK, it's not one line. Then grep for that for message details, where are the message details kept?






share|improve this answer


























  • Thanks. That pointed me in the right direction. The final one-liner I came up with is a variation of that and includes a for loop: grep -i "dsn=5" /var/log/maillog | awk '{print $6}' | sed 's/://' | while read -r x; do grep -i "$x" /var/log/maillog; done

    – Mike B
    Feb 14 '14 at 0:07
















2














In bash



dsn=5.7.1
$ grep $dsn /var/log/maillog | awk '{print $6}' | awk -F: '{print $1}'


returns:



p937blksdh3


Of the line you posted, I'm guessing that is the message id?



OK, it's not one line. Then grep for that for message details, where are the message details kept?






share|improve this answer


























  • Thanks. That pointed me in the right direction. The final one-liner I came up with is a variation of that and includes a for loop: grep -i "dsn=5" /var/log/maillog | awk '{print $6}' | sed 's/://' | while read -r x; do grep -i "$x" /var/log/maillog; done

    – Mike B
    Feb 14 '14 at 0:07














2












2








2







In bash



dsn=5.7.1
$ grep $dsn /var/log/maillog | awk '{print $6}' | awk -F: '{print $1}'


returns:



p937blksdh3


Of the line you posted, I'm guessing that is the message id?



OK, it's not one line. Then grep for that for message details, where are the message details kept?






share|improve this answer















In bash



dsn=5.7.1
$ grep $dsn /var/log/maillog | awk '{print $6}' | awk -F: '{print $1}'


returns:



p937blksdh3


Of the line you posted, I'm guessing that is the message id?



OK, it's not one line. Then grep for that for message details, where are the message details kept?







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 13 '14 at 18:14









slm

258k72547696




258k72547696










answered Feb 13 '14 at 17:55









user3275885user3275885

1736




1736













  • Thanks. That pointed me in the right direction. The final one-liner I came up with is a variation of that and includes a for loop: grep -i "dsn=5" /var/log/maillog | awk '{print $6}' | sed 's/://' | while read -r x; do grep -i "$x" /var/log/maillog; done

    – Mike B
    Feb 14 '14 at 0:07



















  • Thanks. That pointed me in the right direction. The final one-liner I came up with is a variation of that and includes a for loop: grep -i "dsn=5" /var/log/maillog | awk '{print $6}' | sed 's/://' | while read -r x; do grep -i "$x" /var/log/maillog; done

    – Mike B
    Feb 14 '14 at 0:07

















Thanks. That pointed me in the right direction. The final one-liner I came up with is a variation of that and includes a for loop: grep -i "dsn=5" /var/log/maillog | awk '{print $6}' | sed 's/://' | while read -r x; do grep -i "$x" /var/log/maillog; done

– Mike B
Feb 14 '14 at 0:07





Thanks. That pointed me in the right direction. The final one-liner I came up with is a variation of that and includes a for loop: grep -i "dsn=5" /var/log/maillog | awk '{print $6}' | sed 's/://' | while read -r x; do grep -i "$x" /var/log/maillog; done

– Mike B
Feb 14 '14 at 0:07


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f6265%2fhow-to-generate-a-report-summary-of-messages-that-triggered-a-specific-dsn-code%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...