Error C3083 compiling hMs

Use this forum if you want to discuss a problem or ask a question related to a hMailServer beta release.
hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-04 10:26

Yes I've seen it in the documentation....but it doesn't work.

I am not writing a script, I am modifying the code of the Administrator program. Using the COM API the messages.item(ByVal Index as LONG) property is not recognised. Maybe this is a bug?

User avatar
Dravion
Senior user
Senior user
Posts: 704
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error C3083 compiling hMs

Postby Dravion » 2017-08-04 10:55

No, its not a bug, its intentionally .

The hMailAdmin.exe program is designed to manage the Server, not viewing Mail content or being a Mailprogram.
For hMailServer this part is for MUA's (Mail User Agents) like Thunderbird, Outlook ect.

I remember some dicussions here at the forum where people trying to push the idea of adding features to
hMailAdmin.exe for example taking a look inside the emails content or even modifying the content and most Users dont want this features at all. I dont believe Martin will accept such a feature in hMailAdmin.
My experimental builds of hMailserver 32/64-Bit+Unicode
https://github.com/Dravion/hmailserver/releases

HMSInfo 32/64-Bit
https://github.com/Dravion/HMSInfo/releases

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-04 11:32

Dravion wrote:No, its not a bug, its intentionally .

The hMailAdmin.exe program is designed to manage the Server, not viewing Mail content or being a Mailprogram.
For hMailServer this part is for MUA's (Mail User Agents) like Thunderbird, Outlook ect.

Yes, currently, that's why I'm changing it to add the feature. Some people agree that being able to see mail is part of managing the server.

I remember some dicussions here at the forum where people trying to push the idea of adding features to
hMailAdmin.exe for example taking a look inside the emails content or even modifying the content and most Users dont want this features at all.

Really? Then why is it the most-requested feature in the Feature-Request topic in this forum?
And I don't want to modify content of mail, just view. Possibly delete, assuming a good reason.

I dont believe Martin will accept such a feature in hMailAdmin.

Has he said so, in which case I'd like to hear why? It has already been discussed on the Feature Request topic and he didn't say that there.

User avatar
Dravion
Senior user
Senior user
Posts: 704
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error C3083 compiling hMs

Postby Dravion » 2017-08-04 11:46

Some User and Dev quotes:

Postby martin » 27 Jun 2010, 22:20
Can you guys tell me what you actually need this for? What problem is it that you're trying to solve?
viewtopic.php?t=5773&vote=viewresult

Postby mattg » 28 Jun 2010, 16:42
I had ticked yes, but truly don't remember why.
dzekas wrote:
The only problem that I see in this feature request is that people ask for it in order to be able to violate end users privacy more easily. Now they must wander in hashed data directory and they want to get it on a plate.
I tend to agree with Dzekas.

I don't recall that I would have used this feature were it available...
viewtopic.php?t=5773&vote=viewresult
My experimental builds of hMailserver 32/64-Bit+Unicode
https://github.com/Dravion/hmailserver/releases

HMSInfo 32/64-Bit
https://github.com/Dravion/HMSInfo/releases

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-04 12:06

Yeah thanks for those quotes that you've picked from the 10% of the people who don't agree with me (even then, Martin is asking a question, not saying No). Shame you didn't quote any of the others, 90% roughly, that agree with me and state good reasons why. Seems like you have selective reading. I won't argue here but suggest you re-read the topic you just quoted.

User avatar
RvdH
Senior user
Senior user
Posts: 458
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Error C3083 compiling hMs

Postby RvdH » 2017-08-04 12:21

Personally i see no good practical and legally allowed reason for this feature...besides spying on users mailboxes!
But you are free to choose another product if hMailServer does not suite your needs, bye bye!
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-04 12:51

If you read the feature-request thread you will find several good reasons already listed there, it's not about spying on users mailboxes.

User avatar
RvdH
Senior user
Senior user
Posts: 458
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Error C3083 compiling hMs

Postby RvdH » 2017-08-04 13:09

it 'can' be used for that...and therefore is a privacy issue (legally wise, that is)
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-04 14:01

So can Notepad, by reading the raw EML files, but I don't see that being banned anytime soon.

User avatar
Dravion
Senior user
Senior user
Posts: 704
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error C3083 compiling hMs

Postby Dravion » 2017-08-04 14:06

Thats why
Now they must wander in hashed data directory and they want to get it on a plate.
My experimental builds of hMailserver 32/64-Bit+Unicode
https://github.com/Dravion/hmailserver/releases

HMSInfo 32/64-Bit
https://github.com/Dravion/HMSInfo/releases

User avatar
SorenR
Senior user
Senior user
Posts: 2327
Joined: 2006-08-21 15:38
Location: Denmark

Re: Error C3083 compiling hMs

Postby SorenR » 2017-08-04 16:43

hottroc wrote:Thanks, lol, more VB. The Administrator is written in C#.

However even when I try to translate it into C# I can't get it to work. There is no .Item method/property on Messages, there is only ItembyDBID().
So "Set oMessage = oIMAPFolder.Messages.Item(k)" will not work. It needs to be "Set oMessage = oIMAPFolder.Messages.ItembyDBID(k)" and for that the value of k needs to be the MessageID of the message, not an index number, and THAT is the value I don't know how to retrieve? It is not related to Count of the items in .Messages.

Am I missing something?

Property Item(ByVal Index As Long) As IInterfaceMessage
read-only
Default member of hMailServer.Messages
Returns the message in the collection with the given index.

- OR -

hMailServer.Message this[int Index] { get; }
Member of hMailServer.IInterfaceMessages

??? Last one I found using the object browser on interop.hmailserver in VS2008 ... (older version of hMailServer)
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
mattg
Moderator
Moderator
Posts: 17596
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Error C3083 compiling hMs

Postby mattg » 2017-08-05 00:47

hottroc wrote:Yes I've seen it in the documentation....but it doesn't work.
I am not writing a script, I am modifying the code of the Administrator program. Using the COM API the messages.item(ByVal Index as LONG) property is not recognised.

I know that the GUI is written completely using the COM.API

If the COM.API has that potential (and it does), then you can use that to modify the GUI if you so desire...
If you can't get it to work, then you are doing something wrong.

hottroc wrote:If you read the feature-request thread you will find several good reasons already listed there, it's not about spying on users mailboxes.

RvdH wrote:it 'can' be used for that...and therefore is a privacy issue (legally wise, that is)

This is absolutely a legal privacy issue in many jurisdictions. You may poh-poh the idea, and privacy may not be an issue to you where ever you live, but this will certainly be illegal in some situations.
We have had forum users here talk about setting the data directory on an encrypted network share with no user access. IT companies managing encrypted network drives for which they can't see any content of is normal in 2017, more so in particular sectors (e.g. I work in Healthcare, the days of giving trusting the IT guy with patient data are long gone). There is no notepad++ issue there either.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-05 02:06

SorenR wrote:Property Item(ByVal Index As Long) As IInterfaceMessage
read-only
Default member of hMailServer.Messages
Returns the message in the collection with the given index.


So it should work but doesn't, I get....

Code: Select all

"'hMailServer.Messages' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'hMailServer.Messages' could be found (are you missing a using directive or an assembly reference?)


- OR -

hMailServer.Message this[int Index] { get; }
Member of hMailServer.IInterfaceMessages


Hmmm, not sure how I use this but it also seems to throw an error.

tunis
Normal user
Normal user
Posts: 159
Joined: 2015-01-05 20:22
Location: Sweden

Re: Error C3083 compiling hMs

Postby tunis » 2017-08-05 15:21

To see all messages in a account use this:

Code: Select all

var oApp = new hMailServer.Application();
oApp.Authenticate(login, password);
var oAccount = oApp.Domains.ItemByName[domain].Accounts.ItemByAddress[email];
var oMessages = oAccount.Messages;
int iMesseges = oMessages.Count;
for (int i = 0; i < iMesseges; i++)
{
  Console.WriteLine("UID: " + oMessages[i].UID);
  Console.WriteLine("ID: " + oMessages[i].ID);
  Console.WriteLine(oMessages[i].From);
  Console.WriteLine(oMessages[i].Subject);
}

For messages in specified IMAP folder:

Code: Select all

var oMessages = oAccount.IMAPFolders.ItemByName["INBOX"].Messages;
HMS 5.6.6 B2383.7 on Windows Server 2016 Core VM.
HMS 5.6.7 B2407.9 on Windows Server 2012 R2 Core VM.

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-05 19:55

mattg wrote:This is absolutely a legal privacy issue in many jurisdictions. You may poh-poh the idea, and privacy may not be an issue to you where ever you live, but this will certainly be illegal in some situations.
We have had forum users here talk about setting the data directory on an encrypted network share with no user access. IT companies managing encrypted network drives for which they can't see any content of is normal in 2017, more so in particular sectors (e.g. I work in Healthcare, the days of giving trusting the IT guy with patient data are long gone). There is no notepad++ issue there either.


Any of you admins that have access to the hMailServer Administrator program could currently change the password of any user account and hence access their mail if you so desired. OK an encrypted drive may stop this (and I'm not trying to circumvent that) but that's kind of a different issue. And IMHO you shouldn't employ IT guys you don't trust. Preventing admins from being able to access and manage data is asking for trouble. Do you think a nurse for example is better at managing his/her password than the IT guy who is aware of the risks and issues? What happens when the nurse leaves or forgets their pw?

User avatar
mattg
Moderator
Moderator
Posts: 17596
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Error C3083 compiling hMs

Postby mattg » 2017-08-05 22:42

I seriously can't believe that you want to continue this discussion...

Anyway
hottroc wrote: What happens when the nurse leaves or forgets their pw?

You reset the password, or better you get the nurse to set their own new password via PhPWebAdmin or one of the roundcube / squirrelmail plug-ins. Resetting a password is very different to recording all passwords for all users.

Look I get that YOU think that the concept of user privacy is utter rubbish, but the fact remains that there is a legal requirement in many jurisdictions to keep detailed logs of access, of sending mail, of receiving mail, (All of this so far in Australia), and that in some jurisdictions / environments, it is necessary that email are secured from all prying eyes including the IT team. In Australia, in any workplace, an Employer looking through and employee's email without their prior knowledge (not necessarily consent) is likely to find trouble in the industrial relations courts if things go pear shaped. Healthcare in Australia has defined ideas about privacy, and many don't make sense - like faxes being OK, but unencrypted email not being OK to discuss patient health information. (Most faxes are fax-to-email and/or email-to-fax services of some description anyway. Message level encryption for email is fine, but message level encryption is not just StartTLS or SSL secured connections to a mail server)

Australia is not alone. In many European countries the right to privacy is ensconced in law.
In the USA there is HIPAA (health) legislation which includes mandatory reporting of data breaches - 791 occurrences in 2017 to July 20. A suitable data breach for reporting could include the IT firm accessing patient information.

I'm not for a minute saying to you that you can't do what you want to do, I've actively tried to help you achieve that goal. However, my view is that this concept of admins reading user mail should never become part of the main hMailserver builds.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
Dravion
Senior user
Senior user
Posts: 704
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error C3083 compiling hMs

Postby Dravion » 2017-08-05 23:29

I agree 100% with Mattg
My experimental builds of hMailserver 32/64-Bit+Unicode
https://github.com/Dravion/hmailserver/releases

HMSInfo 32/64-Bit
https://github.com/Dravion/HMSInfo/releases

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-06 00:30

tunis wrote:To see all messages in a account use this:

Code: Select all

var oApp = new hMailServer.Application();
oApp.Authenticate(login, password);
var oAccount = oApp.Domains.ItemByName[domain].Accounts.ItemByAddress[email];
var oMessages = oAccount.Messages;
int iMesseges = oMessages.Count;
for (int i = 0; i < iMesseges; i++)
{
  Console.WriteLine("UID: " + oMessages[i].UID);
  Console.WriteLine("ID: " + oMessages[i].ID);
  Console.WriteLine(oMessages[i].From);
  Console.WriteLine(oMessages[i].Subject);
}

For messages in specified IMAP folder:

Code: Select all

var oMessages = oAccount.IMAPFolders.ItemByName["INBOX"].Messages;


Thanks for replying but this doesn't seem to work. Have you actually got it working with this code? If so then I must be doing something wrong but can't spot what. It's probably something stupid I've missed somewhere, I'll keep trying....

User avatar
Dravion
Senior user
Senior user
Posts: 704
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error C3083 compiling hMs

Postby Dravion » 2017-08-06 00:59

I think we should close this thread because its not a hMailServer related project anymore. If hottroc wants to develop creepy spyfeatures in private its ok, but we dont should support such efforts in any shape or form in the same way as we do not support spammers or other potential criminal stuff.

Vote for /close
My experimental builds of hMailserver 32/64-Bit+Unicode
https://github.com/Dravion/hmailserver/releases

HMSInfo 32/64-Bit
https://github.com/Dravion/HMSInfo/releases

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-06 01:14

Think I've sorted it now, anyhow, feel free to close if you wish. I assure you there was no creepy intent, this was for legit purposes as outlined by several people on the feature-request topic. But if you feel like unjustly libelling my good name for no proven reason you feel free Dravion.
Thanks to everyone that helped me or tried to help me.

User avatar
mattg
Moderator
Moderator
Posts: 17596
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Error C3083 compiling hMs

Postby mattg » 2017-08-06 01:16

hottroc wrote:Think I've sorted it now, anyhow.

Great.

Feel free to share your code please. It may help others, and as you say there are many who have requested this over the years.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

hottroc
Normal user
Normal user
Posts: 146
Joined: 2017-03-05 14:46

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-08 01:51

It is now working but still needs a bit of tweaking to enable sorting so you can see the most recent messages at the top of the list (order currently seems completely random!), for example, and tidying up, etc. Tunis really had got it spot on in his post above. When I thought it wasn`t working, it actually was, but getting it into the datagrid wasn`t working so I couldn`t see that it was working.

BTW, The message contents are not directly viewable and it is only read-only currently so no editing or deleting.

Here is the code....

Code: Select all

//Start of my section

            var mymessages = _representedAccount.Messages;
            textTotMessages.Text = mymessages.Count.ToString();
            GridViewMail.Width = tabMail.Width;
            int mycount = mymessages.Count;
            if (mycount > 1000) { mycount = 1000; }; //limit to 1000 messages for speed unless ShowAll button is pressed
            if (mycount < 1) { mycount = 1; };
            for (int i = 0; i < mycount-1; i++)
            {
                //add each message to the datagrid
                var selmessage = mymessages[i];
                if (selmessage != null)
                    GridViewMail.Rows.Add();
                    GridViewMail.Rows[i].SetValues(selmessage.From, selmessage.Subject, selmessage.Size+" Kb", selmessage.Date, "SHOW");
                GridViewMail.Refresh();

            }

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            MessageBox.Show ("Dravion will call you creepy if you view the message!"); //LOL
        }

        private void btnShowAll_Click(object sender, EventArgs e)
        {
         //not yet implemented, option to list all the messages
        }
           
 //end of my section


I`ve also created the tray icon monitor I mentioned earlier if anyone is interested, just need to work on improving my icons. Anyone recommend a good, free, icon editor? Editing icons in the Resource Editor in VS doesn't appear to work for some reason (any clues?).


Return to “Development & alpha discussions”



Who is online

Users browsing this forum: No registered users and 5 guests