hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : is there anyway that I can extracting smtp traffic from logs
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

is there anyway that I can extracting smtp traffic from logs

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 05-26-2009, 01:40 PM
kustomjs kustomjs is offline
Newbie
 
Join Date: Apr 2007
Posts: 27

is there anyway that I can extracting smtp traffic from logs


Hi Guys
I am just wondering if there is anyway that I could extracting smtp traffic from per user with logs and put into like a mysql database? because my setup is with postfix+dovecot+mysql

like this:

outbound
May 20 22:13:37 mail sm-mta[47291]: n4L2DaNl047291 from=<xxxxx@domain.net>, size=1370, class=0, nrcpts=1, msgid=<E2E640AC5BCD49DF8FC380DFAE2F4670@xxxxx>, proto=SMTP, daemon=IPv4, relay=xxx.xxx.xxx.xxx[xxx.xxx.xxx.xxx]

incoming
May 20 00:32:47 mail sm-mta[49233]: n4K4Wkeg049233 from=<1-8100100-domain.net?xxxxx@mxx.xxx.com>, size=0, class=0, nrcpts=1, proto=SMTP, daemon=IPv4, relay=xxxxx1.*********** [xx.xx.x.xxx]

dovecot pop3/imap
May 20 22:10:00 mail dovecot: POP3(xxxx): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0


Last edited by kustomjs; 05-26-2009 at 01:51 PM.
Reply With Quote


Sponsored Links
  #2  
Old 05-26-2009, 05:14 PM
kustomjs kustomjs is offline
Newbie
 
Join Date: Apr 2007
Posts: 27
Ok tell me after 26 views and no replys what is up with that?

Reply With Quote
  #3  
Old 05-26-2009, 05:53 PM
oldunis oldunis is offline
Web Hosting Guru
 
Join Date: Mar 2004
Location: /dev/null
Posts: 275
Quote:
Originally Posted by kustomjs View Post
Ok tell me after 26 views and no replys what is up with that?
Maybe being a little bit more polite could help

I see two options:
1- You make up a script that parses through dovecot's log. Since it is a standard log file, it should not be too hard.
2- For the inboud, it is possible to forward the emails to a script. Just like with most support ticket system...

Reply With Quote
Sponsored Links
  #4  
Old 05-26-2009, 06:26 PM
UNIXy UNIXy is offline
Warp Speed!
 
Join Date: Feb 2008
Location: Houston, Texas, USA
Posts: 2,747
For SMTP, create a content filter in master.cf for smtp/smtps (-o content_filter=transactlog:transactlog)

transactlog unix - n n - - pipe
flags=Rq user=transactlog argv=/usr/local/bin/transactlog -f ${sender} -- ${recipient}

transactlog can be a perl / php script that connects to the DB and or dumps the data to a file.

For dovecot, just add an SQL update in the same dovecot mysql conf file (%n = username %d = domain).

Edit: Be sure to set the right Exit code in the transactlog script

Regards

__________________
|- UNIXY :: Fully Managed Servers and Clusters Since 2006
|- DC POP :: Houston, Los Angeles, Atlanta, & Rotterdam NL
|- Managed Magento Varnish Servers w/ ESI. < 250ms Page Load / TTFB
L- We LOVE helping our clients!


Last edited by UNIXy; 05-26-2009 at 06:33 PM.
Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Host1Plus Offers SmarterTools Email and Collaboration Services Web Hosting News 2012-06-08 15:06:38
Akamai Report Names Taiwan Number-One Source of Attack Traffic Web Hosting News 2011-10-28 18:33:23
Perimeter E-Security Launches SaaS-Based Log Management Solution Web Hosting News 2011-09-27 19:54:12
Indian Web Host ZNet Offers SmarterTools Products to Customers Web Hosting News 2011-07-12 19:58:10
FBI Questions Iowa Woman on LulzSec Involvement Web Hosting News 2011-06-29 19:46:20


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?