Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th October 2010, 06:30
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Post ispconfig3+dovecot with mailbox traffic

Hey all,

I had an older courier ispc3 system and converted it to dovecot for one of many reasons but one problem I didn run into is that ispc3 no longer tracks the mailbox traffic information (not that I really cared too much anyway). What makes it worse is that since it's not using procmail and instead using sieve, sieve has no way of writing to file (that I know of, possibly security reasons) so the ispconfig_mailsize files are no long updated.

Using dovecot settings, I had written a sieve wrapper which will process the emails sizes and create/append the files upon receiving mail.

I don't know how the new dovecot support works since 3.0.3 and how many people are using it. The sieve script and wrapper is still a bit quick patched up since I wrote it a while back but if there's interest, I'll release the code/howto.

Tremors.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
Sponsored Links
  #2  
Old 17th October 2010, 12:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,769
Thanks: 840
Thanked 5,607 Times in 4,418 Posts
Default

Would be great if you could release that wrapper. Maybe it can be used in ispconfig to solve the mail statistics problem for dovecot servers.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 17th October 2010, 13:20
radim_h radim_h is offline
Senior Member
 
Join Date: Jan 2007
Location: Prague, Czech
Posts: 424
Thanks: 34
Thanked 26 Times in 21 Posts
Send a message via ICQ to radim_h
Default

i think it will be not only me thankfull for this!
i'm using 3.0.3 with dovecot
Reply With Quote
  #4  
Old 18th October 2010, 04:13
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

I have been running it now for months now and so far it's been successful but i only have 1 little issue to resolve and that is that since this is opensource there's the problem that I'm using a localhost email address which is the processing agent (php script) that takes care of counting it.
The problem itself is that anyone outside can telnet to the server and send heaps of emails to the "mailtrafficlogger@localhost" or whatever address either to exploit it (attack php itself) or to artificially inject traffic to an account that never got the traffic... if you get what I mean.

The way I did it is to write a global sieve script which all mailboxes receiving the mail will run this script, it auto forwards the emails to the local scripted alias address which does the processing.

One solution i thought of is forcing the admin installing the script to generate their own email, possibly using an md5 or something eg. 80b0cb7936ebf798b1ca4305b6f313e9@localhost
Then alias from that.

there's the other thing which I haven't actually checked yet is that if 2 people in the same domain are sent the same email, is it counted as 2x traffic (1 for each) or just the 1.. I believe it's counting as 1 atm...

any suggestions are helpful. I'll modify and release as I clean it up.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #5  
Old 18th October 2010, 11:04
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,769
Thanks: 840
Thanked 5,607 Times in 4,418 Posts
Default

Ok, so your approach is similar to what we have used in ispconfig 2. One other solution for dovecot might be to use the dovecot rawlog. I've read about that log but I was not able to test it yet. This log shall contain the mailsize as well.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 19th October 2010, 04:13
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

Yeah at the time I didn't realise the change to dovecot would affect this so when I noticed what was happening and so in the rush to simulate how it was being done in the past was do to the same in dovecot/sieve although couldn't write to a file so opted for an alias script. works well so far.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #7  
Old 23rd August 2011, 11:59
osterhase osterhase is offline
Member
 
Join Date: Jul 2011
Location: Germany
Posts: 63
Thanks: 6
Thanked 7 Times in 5 Posts
Default

Hi there,

any news to this topic? On our servers there is also dovecot running an we are heavily interested in implementing the mailbox-traffic-monitoring feature.

I did a bit of research and came across the rawlog-feature for dovecot. Maybe it's possible to use that feature instead of sieve-stuff. Had no time to test the feature so far.

Best regards.
Reply With Quote
  #8  
Old 24th August 2011, 02:13
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

rawlog would be the ideal way as it wouldnt need special permissions or sieve scripting etc.
Without doubling checking the logs I believe you would have to script it well enough to pickup the size=[0-9]+ value on 1 log line and then chase the recipients names in upcoming lines as it aren't on the same log line entry making it a wee bit trickier. You would have to track the queue id and then find the recipients on the line with the same queue id.
This is going off memory but whatever the case, it's possible.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #9  
Old 24th August 2011, 10:25
osterhase osterhase is offline
Member
 
Join Date: Jul 2011
Location: Germany
Posts: 63
Thanks: 6
Thanked 7 Times in 5 Posts
Default

Just checked out the rawlog feature - the problem seems to be that those logfiles are simply exploding because they "log" also the attachments sent. So basically I send a couple of test-mails - one containing an attachment - and the dovecot.rawlog directory came up with 500 kb. That seems to be a damn lot of hdd-space (if you think not about one but about one-hundred users).

I wonder if the mail.log wouldn't be another interesting starting point - I mean awstats is able to log the mailbox traffic.
Reply With Quote
  #10  
Old 25th August 2011, 01:49
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
 
Default

actually, I was thinking of logtail with a script as most of you probably realised. then you can run it every minute or so and process the mail.log. shouldn't be too hard.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPCONFIG3 + No Email Service!!! AntennaMike Installation/Configuration 4 13th February 2013 12:24
amavis rejects all inbound emails aclhkaclhk Installation/Configuration 5 28th February 2010 05:24
Webmail problems with only one domain? compner Installation/Configuration 14 16th February 2010 17:59
Postfix can't received email from exterior astra2000 Server Operation 5 18th October 2009 00:26
Dovecot fails to deliver to all mail clients zwelabantu Installation/Configuration 3 19th June 2009 17:57


All times are GMT +2. The time now is 23:07.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.