LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-13-2010, 07:00 AM   #1
noxerpus
LQ Newbie
 
Registered: May 2010
Posts: 5

Rep: Reputation: 0
mailq grepping


Hi,

I want to exclude only ip addresses from an mailq.

So the result i need is to get a list of all the smtp IDs that that spesific ip has sent out.

I have only found a way to grep on the domain name the email has been sent to.

So for me a linux noob this command should be link this:

mailq | grep "Ip" and a list of smtp IDs including that ip will show.

But this dose not work

If i understand it correctly i can only grep on the domain name the e-mail has been sent to?

is there a way to get what i ask?
 
Old 05-13-2010, 07:48 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,493

Rep: Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867
Is mailq an executable? Maybe you could show what the output is?
If it is a file you have it in the wrong order:
Code:
grep Ip mailq
 
Old 05-13-2010, 07:57 AM   #3
noxerpus
LQ Newbie
 
Registered: May 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I generally use this command like this:

[blah@blah ~]$ mailq | grep mailq.com
D454790906 1754 Wed May 12 22:06:56 diadem@mailq.com
8DAC990C91 1778 Wed May 12 22:22:53 invitation@mailq.com
53E2D909CD 1663 Wed May 12 19:21:38 accreditation@mailq.com
51E7690711 1890 Wed May 12 21:52:13 rule@mailq.com
6FFDA90F07 1258 Wed May 12 23:19:26 brighten@mailq.com

Here i get the information i need but only on the domain name.

In a SMTP id i can read a e-mail header and i want to get a list og all the e-mails a certain ip-addresse has sent out.

Then i can go and do:

sudo postcat -q 53E2D909CD

and see this line: Received: from 192.192.0.1 (192.192.0.1 [192.192.0.1.])

so when for me it seems like i could do the same on the ip.
 
Old 05-13-2010, 08:05 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,493

Rep: Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867
I am a little lost, so is the problem you do not know what to grep for?

Obviously you only get domain info as that is what you searched for.
Can you not just do:
Code:
mailq | grep 53E2D909CD
To get all emails from that id?

Or have I missed what you want from mailq?
 
Old 05-13-2010, 08:14 AM   #5
noxerpus
LQ Newbie
 
Registered: May 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I want to grep that ip whitch is in the e-mail header of the smtp ID.

and the result i want is all SMTP IDs 192.168.0.1 has in our mailq.

the SMTP ID is an uniq id for all the e-mails going thru that server so this cannot be grepped.
 
Old 05-13-2010, 08:28 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,493

Rep: Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867
Quote:
I want to grep that ip whitch is in the e-mail header of the smtp ID.
So does mailq produce the header as well?
 
Old 05-13-2010, 08:38 AM   #7
noxerpus
LQ Newbie
 
Registered: May 2010
Posts: 5

Original Poster
Rep: Reputation: 0
The header comes from the person sending the e-mail.

mailq or postmaster produces the SMTP id. proberly for tracking the e-mail thru the prosess of delivery etc.

I am new to this system so i dont know how to explain it better.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with mailq prakash.akumalla Linux - Newbie 6 11-09-2008 11:59 PM
postfix mailq abiye Linux - Software 4 01-25-2007 09:42 AM
sorting Mailq matt1982 Linux - Networking 0 11-03-2006 10:36 AM
Clearing the mailq HELP LC Jonesy Linux - Newbie 4 05-03-2005 07:11 AM
mailq clearing mnauta Linux - General 0 04-12-2005 07:34 PM


All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration