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;
}
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:
- Search sendmail maillog for specific DSN.
- Identify the message-id for the email. (I'm guessing
awk '{print $}'would be used?) - Return the message details for each (presumably grepping for the the message id retrieved from step 2).
linux centos grep sendmail
add a comment |
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:
- Search sendmail maillog for specific DSN.
- Identify the message-id for the email. (I'm guessing
awk '{print $}'would be used?) - Return the message details for each (presumably grepping for the the message id retrieved from step 2).
linux centos grep sendmail
1
For those of us who aren't specifically familiar withsendmail, 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, isp937blksdh3the message-id?
– Jander
Jan 22 '11 at 2:59
add a comment |
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:
- Search sendmail maillog for specific DSN.
- Identify the message-id for the email. (I'm guessing
awk '{print $}'would be used?) - Return the message details for each (presumably grepping for the the message id retrieved from step 2).
linux centos grep sendmail
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:
- Search sendmail maillog for specific DSN.
- Identify the message-id for the email. (I'm guessing
awk '{print $}'would be used?) - Return the message details for each (presumably grepping for the the message id retrieved from step 2).
linux centos grep sendmail
linux centos grep sendmail
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 withsendmail, 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, isp937blksdh3the message-id?
– Jander
Jan 22 '11 at 2:59
add a comment |
1
For those of us who aren't specifically familiar withsendmail, 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, isp937blksdh3the 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
add a comment |
1 Answer
1
active
oldest
votes
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?
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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?
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
add a comment |
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?
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
add a comment |
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?
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?
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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, isp937blksdh3the message-id?– Jander
Jan 22 '11 at 2:59