none
[CONTRIB] hMailServer Provider DiskSpace/Bandwidth Calculation RRS feed

  • General discussion

  • Please include this in the next version on WesitePanel:

    I got it working with WebsitePanel 1.2 & hMailServer 5.3 (even without source codes, BTW why can't I download the full project from Codeplex?):

    hMailServer.vb:

    Public Overrides Function GetServiceItemsDiskSpace(ByVal items() As ServiceProviderItem) As ServiceProviderItemDiskSpace()
        Dim itemsDiskspace As List(Of ServiceProviderItemDiskSpace) = New List(Of ServiceProviderItemDiskSpace)
    
        ' update items with diskspace
        Dim item As ServiceProviderItem
        For Each item In items
          If TypeOf item Is MailAccount Then
            Try
              Dim name As String = item.Name
              Dim domainName As String = name.Substring((name.IndexOf("@") + 1))
    
              Dim objDomain As Service = GetDomainObject(domainName)
              Dim objAccount = objDomain.ComObject.Accounts.ItemByAddress(name)
              Dim objAccountSize As Long = objAccount.Size() * 1048576
              ' calculate disk space
              Dim diskspace As New ServiceProviderItemDiskSpace()
              diskspace.ItemId = item.Id
              diskspace.DiskSpace = objAccountSize
              itemsDiskspace.Add(diskspace)
            Catch ex As Exception
              Log.WriteError("Error calculating disk space for mail account: " + item.Name, ex)
            End Try
          End If
        Next item
        Return itemsDiskspace.ToArray()
      End Function
    

    Now for the Bandwidth I think parsing the AWStats file would work.. but not sure how to use the LogParser..
    Monday, July 18, 2011 9:22 PM

All replies

  • How do i make mine working...??? I have Win2008 with hmailserver, IIS7.

    My Website panel does not calculate any diskspace and bandwidth for Mail...

    Only thing it can calculate is the diskspace used by the folder of the domain in hostingspace..

     

    Please help..

    Friday, January 13, 2012 3:46 PM
  • Please include this in the next version on WesitePanel:

    I got it working with WebsitePanel 1.2 & hMailServer 5.3 (even without source codes, BTW why can't I download the full project from Codeplex?):

    hMailServer.vb:

    Public Overrides Function GetServiceItemsDiskSpace(ByVal items() As ServiceProviderItem) As ServiceProviderItemDiskSpace()
        Dim itemsDiskspace As List(Of ServiceProviderItemDiskSpace) = New List(Of ServiceProviderItemDiskSpace)
    
        ' update items with diskspace
        Dim item As ServiceProviderItem
        For Each item In items
          If TypeOf item Is MailAccount Then
            Try
              Dim name As String = item.Name
              Dim domainName As String = name.Substring((name.IndexOf("@") + 1))
    
              Dim objDomain As Service = GetDomainObject(domainName)
              Dim objAccount = objDomain.ComObject.Accounts.ItemByAddress(name)
              Dim objAccountSize As Long = objAccount.Size() * 1048576
              ' calculate disk space
              Dim diskspace As New ServiceProviderItemDiskSpace()
              diskspace.ItemId = item.Id
              diskspace.DiskSpace = objAccountSize
              itemsDiskspace.Add(diskspace)
            Catch ex As Exception
              Log.WriteError("Error calculating disk space for mail account: " + item.Name, ex)
            End Try
          End If
        Next item
        Return itemsDiskspace.ToArray()
      End Function
    

    Now for the Bandwidth I think parsing the AWStats file would work.. but not sure how to use the LogParser..

    When will you reply...??? Mine is not working .. Tell me how to use this script.. and where.. whats..??
    Bhargav L Pandya
    Sunday, January 15, 2012 2:15 PM
  • Please include this in the next version on WesitePanel:

    I got it working with WebsitePanel 1.2 & hMailServer 5.3 (even without source codes, BTW why can't I download the full project from Codeplex?):

    hMailServer.vb:

    Public Overrides Function GetServiceItemsDiskSpace(ByVal items() As ServiceProviderItem) As ServiceProviderItemDiskSpace()
        Dim itemsDiskspace As List(Of ServiceProviderItemDiskSpace) = New List(Of ServiceProviderItemDiskSpace)
    
        ' update items with diskspace
        Dim item As ServiceProviderItem
        For Each item In items
          If TypeOf item Is MailAccount Then
            Try
              Dim name As String = item.Name
              Dim domainName As String = name.Substring((name.IndexOf("@") + 1))
    
              Dim objDomain As Service = GetDomainObject(domainName)
              Dim objAccount = objDomain.ComObject.Accounts.ItemByAddress(name)
              Dim objAccountSize As Long = objAccount.Size() * 1048576
              ' calculate disk space
              Dim diskspace As New ServiceProviderItemDiskSpace()
              diskspace.ItemId = item.Id
              diskspace.DiskSpace = objAccountSize
              itemsDiskspace.Add(diskspace)
            Catch ex As Exception
              Log.WriteError("Error calculating disk space for mail account: " + item.Name, ex)
            End Try
          End If
        Next item
        Return itemsDiskspace.ToArray()
      End Function
    

    Now for the Bandwidth I think parsing the AWStats file would work.. but not sure how to use the LogParser..

    When will you reply...??? Mine is not working .. Tell me how to use this script.. and where.. whats..??
    Bhargav L Pandya

    We did the change in the hMailServer.vb and it works fine, thanks Dan.

    Pandya, is this the respectable way to ask others help and support ?!

    Sunday, January 29, 2012 10:57 AM
  • Ya, I understand that is not the way.. but I am really tired of waiting for someone to reply.. I dont have that file in my installation. anywhere..

     

    Regards


    Bhargav L Pandya
    Friday, February 3, 2012 3:51 AM
  • Ya, I understand that is not the way.. but I am really tired of waiting for someone to reply.. I dont have that file in my installation. anywhere.. Also I got the data from codeplex.. and got the file there.. but I dont know how to use it.. or how to build the same..

     

    Regards


    Bhargav L Pandya


    Bhargav L Pandya
    Friday, February 3, 2012 3:57 AM
  • DAn,,, Pelase help.. NEed this working... this is not working but worrying.. Please tell what is to be done with this script.. If you want i will give you my server on teamviewer.. but please get this working..
    Bhargav L Pandya
    Friday, February 3, 2012 5:13 AM