LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-27-2012, 03:41 AM   #1
jamil.isayyed
LQ Newbie
 
Registered: Jul 2012
Location: Palestine
Posts: 27

Rep: Reputation: Disabled
Mail Server Using Postfix, Roundcube, Vimbadmin, and MySQL, reporting scripts


Hello,

i have Mail server using Postfix, roundcube, vimbadmin and MySQL. what i want to do is to create a script report that gives:

1- the Mailbox Size, which i think i will use du -sh to find the size but also i want the qouta for each user and what is the space the the user still have.
2- the Amount of unread/read emails for each user. which i do not have any idea about how i can do it.
3- Last logon/access (if possible also by protocol POP3 or HTTP)


So any Help
 
Old 07-27-2012, 08:38 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,662

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by jamil.isayyed View Post
Hello,

i have Mail server using Postfix, roundcube, vimbadmin and MySQL. what i want to do is to create a script report that gives:

1- the Mailbox Size, which i think i will use du -sh to find the size but also i want the qouta for each user and what is the space the the user still have.
2- the Amount of unread/read emails for each user. which i do not have any idea about how i can do it.
3- Last logon/access (if possible also by protocol POP3 or HTTP)


So any Help
Help with what? If you want a script, write it. There are many scripting tutorials you can find on Google. We will be glad to help you with specific questions....so post them with your scripts
 
Old 07-28-2012, 04:06 AM   #3
jamil.isayyed
LQ Newbie
 
Registered: Jul 2012
Location: Palestine
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Help with what? If you want a script, write it. There are many scripting tutorials you can find on Google. We will be glad to help you with specific questions....so post them with your scripts
i do not want a script, i am already writing it, my question is how i can find the number of read and unread message for each mailbox without invading the privacy and conditionality of there mail boxes is there a flag that i can monitor for each message or not.

and the second thing is how i can monitor there access is there another way than the log files, that each time somebody access his mail box to get the date and if possible the protocol and write it on other file?
these are my question i don't want any body to write any script on behalf of me, because i am already writing it.
 
Old 07-28-2012, 04:21 AM   #4
diwljina
Member
 
Registered: Jun 2009
Distribution: Slackware, Debian
Posts: 111

Rep: Reputation: 8
If it's maildir format, you can use find command to find all new folders in users directory and than count all files in them. Those are unread mails and those in cur folders are read. But I think this is already invading their privacy.

I don't think you can do anything else than monitor log file of POP3/IMAP service to find out about their access.
 
Old 07-28-2012, 04:33 AM   #5
jamil.isayyed
LQ Newbie
 
Registered: Jul 2012
Location: Palestine
Posts: 27

Original Poster
Rep: Reputation: Disabled
but as i have seen in the new and cur folders there is some files in them contains more than one message, and we will not know what is in there mailboxes from data or the contents of the email, but i will use this script to know whose emails is active and whose not, is there any mailboxes that just take a space without being used....etc.

i have another question , in postfix i can put a quota to for all the mailboxes, put how i can put different quotas to different users??
 
Old 07-28-2012, 04:56 AM   #6
diwljina
Member
 
Registered: Jun 2009
Distribution: Slackware, Debian
Posts: 111

Rep: Reputation: 8
To my best knowledge, in maildir format one message is represented with one file.

http://qmail.org/man/man5/maildir.html
Code:
Each file in new is a newly delivered mail message.  The
          modification time of the file is the delivery date of the
          message.
I see what you are trying to accomplish, but new mail in mailboxes doesn't mean that account is active. New mails can be spam mails, or sender isn't aware that recipient isn't using that account any more. Best thing is to watch for logging.

As for quota per user, you can try with this:

Code:
virtual_mailbox_limit_inbox = yes
virtual_mailbox_limit = 1073741824
virtual_mailbox_limit_override = yes
virtual_mailbox_limit_maps = hash:/etc/postfix/vquota
In /etc/postfix/vquota:
Code:
# 300MB limit
username@example.com    314572800
username2@example.com   314572800
# 500MB limit
username3@example.com   524288000
# no limit
username4@example.com    0
But you need this patch:
http://vda.sourceforge.net/

Last edited by diwljina; 07-28-2012 at 05:01 AM. Reason: Added link for patch.
 
1 members found this post helpful.
Old 07-28-2012, 05:01 AM   #7
jamil.isayyed
LQ Newbie
 
Registered: Jul 2012
Location: Palestine
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thank you a lot you were very helpfull
 
Old 07-29-2012, 07:22 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
For active accts, you need to watch outgoing email counts.
 
  


Reply



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
LXer: iRedMail:Full-Featured Mail Server With LDAP, Postfix, RoundCube/SquirrelMail O LXer Syndicated Linux News 0 10-09-2009 05:00 PM
Mail server issues (Postfix, MySQL, Dovecot) manijeee Linux - Server 0 08-03-2009 02:38 AM
LXer: iRedMail: Mail Server With LDAP, Postfix, RoundCube/SquirrelMail, Dovecot On De LXer Syndicated Linux News 0 06-05-2009 12:30 PM
mail server postfix with mysql at rhel5 rajinfokiit Linux - Newbie 2 09-09-2008 04:23 AM
mail server setup fc4 (postfix, qmail with mysql 5?) sendmail dtra Linux - Software 1 04-10-2006 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:19 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
Open Source Consulting | Domain Registration