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

Error C3083 compiling hMs

Postby hottroc » 2017-06-01 22:21

Hi,

I'm following the instructions on GitHub to build hMailServer from the source but I'm getting one error I can't solve. I don't actually understand it completely, the error is in bind_mf_cc.hpp and is as follows:

Code: Select all

Error   C3083   'core': the symbol to the left of a '::' must be a type   


and the code section it refers to is...

Code: Select all

template<class Rt2, class R, class T,
    class A1>
   typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
    _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
{
    typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
    typedef typename _bi::list_av_1<A1>::type list_type;
    return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
}


The line it specifically mentions as the problem is the 3rd line beginning "typename boost::enable_if_c<!boost::core....".

Can anyone help advise what the issue might be please?

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-06-02 01:07

Thats libboost programming code and not hMailServer specific.Keep in mind hMailServer will only compile with VS2013 but not higher and not with a libboost version higher then 1.57.0.
You also get trouble if you try it with the latest OpenSSL stable version off branch 1.1.x and not 1.0.x because hMailServers code isnt ready for it right now.
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
RvdH
Senior user
Senior user
Posts: 458
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Error C3083 compiling hMs

Postby RvdH » 2017-06-02 10:07

5.6.7 and master branches build fine with Boost 1.63.0, it is even in the documentation here: https://github.com/hmailserver/hmailserver/tree/5.6.7 and https://github.com/hmailserver/hmailserver/tree/master
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

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-06-02 12:16

Goood if it compiles now against higher versions of libboost.Now its time to do the openssl upgrade because the 1.0.x lts line is running out of support
and the new mainline requires changes in irder to buildhms from source. Visual C++ 2013 is also running outof Supportand the source isnt compatible with VS2015 and VS2017 (which allready had its first service pack).
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-07-13 17:05

I tried to ask in the boost mailing list about this error, but nobody seemed able to help. Has anyone got any other ideas please?

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-07-13 17:10

The only thing which comes to my mind is, you are using the wrong Visual C++ Version (2015 or 2017 and not 2013 with all Updates) or you messed up the libbost compilation step. rerunthe Build instructions carefully, espacially the libboost compilation step.
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-07-14 12:51

Yes I am using VS 2015 and don't really want to install 2013 and it would be really good if I could get this to work with 2015. This one small section of code seems to be the only stumbling block, is there no way I can modify anything to let it compile on 2015?

I do have access to VS2010 also if that helps but haven't tried it with that.

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-07-14 23:00

Sorry, it simply doesnt compile. MS changes from time to time something which can break the source code compatibility (it has happen before and will hapoen again) Right now you are restricted to VS 2013 with or without VS2013 Updates but it has to be VS2013. Not lower then VS2013 and not higher as VS2013 until Martin has migrated the codebase to a more recent VS Version.
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-07-16 18:04

Thanks for replying. Yes I know it doesn't compile, that is why I'm asking the question.

Question is how to change it so it does compile? Martin has to do it? But what will Martin do? He'll change it so it compiles. I've changed some things in this process but found one bit which I'm stuck on. Maybe only Martin can answer. Or I'll have to wait, or find a way to use VS 2013. But an answer that it doesn't work is not an answer at all, just a comment which I already knew.

Is there a timescale known for when Martin will be migrating the codebase?

User avatar
jimimaseye
Moderator
Moderator
Posts: 6402
Joined: 2011-09-08 17:48

Re: Error C3083 compiling hMs

Postby jimimaseye » 2017-07-16 18:59

hottroc wrote:Is there a timescale known for when Martin will be migrating the codebase?

:lol: :lol: :lol:

Err....no. There is NEVER a timescale for Hmailserver project, fixes, upgrades, or even recognition of comments. It will be when he wants, is able, and then chooses to. It could be tomorrow, next month or next year....or longer.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-07-16 20:12

OK thanks.

I tried to download VS2013 but when I try to run it on my Windows 10 system it says it's incompatible. Trying to change it to run in compatibility mode with Windows 8 just makes it say it requires a newer version of Windows. Aaaaghh!

So currently stuck whichever way I try.

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-07-16 23:43

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-07-17 01:30

Thanks for trying but no help as the compatibility box was unticked incl. for all users. However I think I have eventually sorted that problem by renaming the downloaded executable.

Onto the next problem.....

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-07-17 08:46

...So I now have a working VS 2013 with update 3, but it still says "incompatible project" when I try to load the solution....so I updated to update 5 but still the same.
This is starting again with the source as downloaded (ie not after I opened it in VS2015).
I didn't have this problem in VS 2015 strangely.

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-07-17 12:58

Which version of VS2013 did you install? Express only comes un specific flavors and you need thw Windows SDK linked to it while with Pro and higher Versiins everything is integrated. Stick to the build instructions.
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-07-19 11:20

The instructions don't mention a particular variant of VS 2013 except to say that if it is Express that I need to install the Windows Driver Kit which I have done (and pointed to it as per instructions).

The version I downloaded first was Visual Studio Express 2013 for Windows with Update 3. That didn't work so I downloaded "Visual Studio Express 2013" (no updates) and that didn't work, so then I downloaded Visual Studio Express 2013 for Windows with Update 5. That didn't work either so I then (after reading a post elsewhere) tried Visual Studio Express 2013 for Web with Update 5. That doesn't work either. Altogether (with VS2015 Pro which I have also tried) I've tried 5 versions. VS 2015 did work with a few errors which I worked through (mostly to do with paths) and corrected except the one in my first post.

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-07-19 12:24

The Windows SDK or the Drivers Kit doing almost the same Job.Unfortently Microsoft tends to change the structure in the SDK or Driver Kit dramatically from Versikn to Version therefore its not safe to use a diffrent Driver Kit as described in the build instructions.This is also true for Visual Studio itself.

It takes a lot of time and practice to get along with Visual C++ and its traps, so be patient.

Unfortently OpenSSL and Boost adding its own Problems into the overall Situation.

The Boost Framework SSL/TLS Networking Functions is requiring OpenSSL itself to provide
SSL/TLS Features and hMailServers needs a proper build of Boost with a proper OpenSSL build in the first place. Now it comes to OpenSSL itself.

Dont use the latest 1.1x version of OpenSSL and stick exactly to the version in the build instructions. OpenSSL 1.1x has changed dramatically and hMailServers build instructions doesnt cover its change. You shouldnt also not try to use the latest OpenSSL 1.0.x version because in hMailServer Solution and Projectfoles exists hardcoded path and file references to it, which will result in compilefail if you use a higher version.

You also need C# and .NET Visual Studio Features because the Client part of hMailServer is developed with C#. Unfortently Microsoft is splitting and changing arround with added features inside the Express Version.
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-07-19 23:06

Er... When I installed VS2013 I actually first installed VS2013 Express for Desktop Update 5 and AFTER that I installed VS2013 Express for WEB in order for everything to come together...

Initially Windows 10 "Anniversary Update" 32-bit on a Dell D610 laptop, 2GB RAM, 1.6MHz Pentium M.
Now migrated to Windows 10 64-bit Core i7-6500U 8GB RAM 250MB SSD Acer laptop, totally quiet - NO moving parts except the CPU fan :mrgreen:
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
Dravion
Senior user
Senior user
Posts: 704
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error C3083 compiling hMs

Postby Dravion » 2017-07-20 00:31

@Soren

Exactly but the Buildinstructions covers only the native c++ Compiler Version and hides the Web Edition Express requitements.

I dont use Exptess so i simply can skip that shit but for users with Express it can be a adfitional pitfall.
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-07-22 20:46

So should I now download VS 2013 Express for Desktop with Update 5?

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-07-22 21:19

Yes.
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-07-26 18:12

Brilliant thanks, that is now working and I have been able to build the server part of the application.

I really think it should be made clear which particular variant of VS 2013 is required in the GitHub instructions, would have saved me a lot of time. Thanks for your patience with my efforts.

Now onto my next query. It is the Tools part, the Administrator specifically, that I really want to make a few changes to...but again there appear to be some problems. I SUSPECT it could be due to the .NET Framework version installed. Does it have to be v 2.0? I have v 4.6 installed at the moment.

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-07-26 18:19

Newer .NET Framework is ok, but you have to take care if you compile the 32 or 64-Bit Workspace. Booth
depending on Typelib Information and proper Registration to a dedicated hMailServer.exe Typelib Instance.
In short: The 32-Bit Solution for hMailServer Admin and other Tools needs a hMailServer.exe /Register (64-Bit
and the 32-Bit a hMailServer.exe /Register (32-Bit) setup.

Hint:
If you start the hMailServer Project in Debug Mode, all previous hMailServer installation will overwritten in the
Registry COM Object Section (you can only register one hMailServer.exe as COM-Server at the time, never two or
more side by side).
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-07-27 15:28

Hi thanks, but changing to x86 did not make a difference, I think the issue is something more basic.

Whenever I try to open one of the main panes for example it comes up with an error about being unable to find hMailServer.Administrator.Controls.ucPassword then 32 other errors similar like uc.Checkbox and other controls and variables etc.
If I choose to "Ignore and Continue" it gives a warning but then opens the forms but with things missing, like password fields and checkboxes and comboboxes etc. (Labels seem fine).
When I look in the Controls section of the Solution Explorer I can see those items, ucCombobox.cs etc, but if I try to open them it says "To add components...drag them from the Toolbox...."

Do I need to add a reference to the server project (ie hMailServer) in the "Administrator" project?

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-07-27 16:03

This could be a Problem with the Visual Studio Express Version you are using.

Keep in mind:
*Everything related to the Server is Visual C/C++ and has nothing todo with .NET
And:
*Everything Client and Tools specific is C#.NET only and has nothing todo with native C/C++

Regarding Express Editions:
I belive there is a Visual C/C++ Express Edition 2013 and a Desktop C#.NET Visual Studio 2013
Edition. You need both Express Editions or you can get pay Edition (i believe the Pro and higher Editions of Visual
Studio includes all in one)
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-07-27 17:42

That would make sense and would explain the problem but the version I'm using is just called Visual Studio 2013 Express for Desktop and appears to include both C# and C/C++.

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-07-28 01:28

Did you install VS2013 Express for WEB on top of your VS2013 Express for Desktop ??

DESKTOP is missing a few things that comes with WEB... :wink:

Don't ask me why, but it works :mrgreen:
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.

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-07-28 12:48

No not exactly, if you see the timeline above in this topic you'll see I installed Express for Web before Express for Desktop.

Do you think I would benefit from re-installing Express for Web? And into the same folder?

Actually I think there is still a program icon for Express for Web, I'll give that a try....

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-07-28 12:53

M$ is trying to convince you to buy the pay versions :)
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-07-28 13:40

hottroc wrote:Actually I think there is still a program icon for Express for Web, I'll give that a try....


Same result using that, same problems.

M$ is trying to convince you to buy the pay versions


But I already have VS 2015 Pro so hardly want to buy 2013.

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-07-28 20:56

All I can say is that I (and others) on two occations installed the Desktop version before the WEB version. I use the "Desktop" icon and "run as administrator" to compile the latest 5.6x with my own modifications.
Both server AND admin gui..
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
Dravion
Senior user
Senior user
Posts: 704
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error C3083 compiling hMs

Postby Dravion » 2017-07-28 21:09

@Soren

What modification have youimplemented?
Any new Features worth merging/integrating?
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-07-29 02:58

It seems to be unable to find controls such as hMailServer.Administrator.Controls.ucPassword and others even though I can see they are there in the project, ie the .cs files for them.

I have tried Desktop AND Web varieties of VS Express.

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-07-29 03:41

Dravion wrote:@Soren

What modification have youimplemented?
Any new Features worth merging/integrating?

The OnHELO stuff, backported some 4byte-UTF modifications to the database calling, different approach to No Auth on port 25, removed the 250-HELP stuff from the SMTP response and changed GreyListing to work with Minutes, Hours and Days from the GUI...

I still use 5.4.2 in production :oops:

I did apply my changes to 5.6.5 but then I got pulled into another project. New target must be to "attack" 5.7 :mrgreen:

I've attached the diff from 5.4.2 ...
Attachments
diff.rar
(5.37 KiB) Downloaded 13 times
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.

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-07-29 12:47

I have fixed my issues and can now see the controls on the forms etc. I had to Build the project first which I didn't realise.

Thank you all for the help and advice.

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-07-30 14:37

So in the Administrator project I was expecting to see the controls (textboxes, comboboxes etc) linked to fields in the database, but seems there is no data source defined in the project so I assume this must be done programmatically. So not as easy as I hoped. Now on the hunt to find where and how this happens in the code??? Or am I missing something?

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-07-30 14:50

The entire GUI is written using the COM API
https://www.hmailserver.com/documentati ... om_objects
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-07-30 18:00

Oh I see thanks. Looking at the link you provided I see "The complete COM API is available as a .NET class in the hMailserver bin directory ...\hmailserver\bin\Interop.hMailServer.dll" and so I added the dll file as a data source object. So now I can see the data source objects in the Data Source view but still none of the GUI controls databindings are linking on the form designer like I was hoping. But I see now they programmatically bind on form initialize and save-button operations. So I am beginning to understand how this works, just need to work out how the nodes and interfaces fit together, think I need to do some more reading of the link....much obliged for your assistance.

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-07-31 00:55

What exactly are you trying to achieve as the eventual outcome?
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-07-31 14:09

I wish to add a couple of things in the Administrator to start with....firstly I want to be able to view the list of messages for an account (either by right-clicking it and bringing up a dedicated form, or by adding it as a tab in the account properties interface (node?).
Then I may develop a tray app to monitor the mail server, ie visually confirm it is functioning, options to restart the service, open the Administrator, and ability to check the logs. With an option in the Administrator to show or hide this tray icon.
And I want to do something with the logs so the view from the Administrator can be more user-friendly and useful, eg filtering, sorting.

Any previous users of Mailtraq might recognize these features.

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-07-31 15:57

The tray icon is almost like this web app >> viewtopic.php?f=10&t=30713 - except that obviously it's a tray icon, not a web app.. :)
The web app is a replacement for the included PHPWebAdmin

(I actually leave the administrator GUI open the VM where I have hMailserver installed. It also hosts a couple of IIS Websites, and an FTP server presently - subject to change)
That web app also does a great job with logs, although I prefer to use baretail with colour highlighting for various segments of the logs.

Your first point is nearly exactly our highest voted for feature >> https://www.hmailserver.com/feature_voting/
(although to be fair that hasn't had much traction the last few years, and in some jurisdictions this would now be illegal)
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-07-31 17:04

mattg wrote:The tray icon is almost like this web app >> viewtopic.php?f=10&t=30713 - except that obviously it's a tray icon, not a web app.. :)

Similar, but it is a bit OTT for a tray icon, closer to a replacement for the Administrator, I'm more thinking of a 2-status icon (running or stopped) in the system tray with just 3 or 4 commands when the icon is clicked or rt-clicked.

That web app also does a great job with logs, although I prefer to use baretail with colour highlighting for various segments of the logs.


Yes looking at it, that is much better than in the Administrator. This ought to be standard in the Administrator. Personally though I would have toggle switches or chkboxes for each service so I could have say SMTP Client and TCPIP on at the same time etc.

Your first point is nearly exactly our highest voted for feature >> https://www.hmailserver.com/feature_voting/


Yes, I've now added my vote there, but as the request has been around since 2006 it looks like doing it myself will be the only option to see it happen. It's a really useful troubleshooting feature for tracking down stuck or lost emails or the like. There is no difference privacy wise as with a bit of work an admin could go and view the raw EML files anyway.

Also, not really a hMS thing, but I'd also like to integrate SpamAssassin more. So I can mark messages as spam/ham from my OL client, and check SA logs in the hMS Administrator.

But I'm getting ahead of myself, lol, ....

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

Re: Error C3083 compiling hMs

Postby tunis » 2017-07-31 21:11

hottroc wrote:Yes looking at it, that is much better than in the Administrator. This ought to be standard in the Administrator. Personally though I would have toggle switches or chkboxes for each service so I could have say SMTP Client and TCPIP on at the same time etc.


Good idea with check boxes.
I'll give it a try to rewrite the log page.
I'll look into color coding also as Matt mentioned.
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-01 15:57

Great, tunis, that should be good. :)

Your first point is nearly exactly our highest voted for feature >> https://www.hmailserver.com/feature_voting/


I've figured out how to do this (viewing messages in the Administrator). Actually quite straightforward it seems. (haven't actually done it yet!)
A minor query though, I'm coding on my non-production machine. If I make the change then compile/build it, could I just transfer it, stop the hMS service, and swap the Administrator executable over manually?

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-01 16:43

Looks obvious to me you do not need to restart the service as long the changes you made are for the admin gui only, just swap & restart the admin gui executable
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

User avatar
jimimaseye
Moderator
Moderator
Posts: 6402
Joined: 2011-09-08 17:48

Re: Error C3083 compiling hMs

Postby jimimaseye » 2017-08-01 17:01

hottroc wrote:If I make the change then compile/build it, could I just transfer it, stop the hMS service, and swap the Administrator executable over manually?

Yes - simply swap out the Hmailserver.exe in situ.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-01 18:55

Great, thanks. is it OK that the exe will not be signed though? (Windows 10!)

Also I have hit a difficulty. I am populating a gridview for the selected account to list (From, Subject, Rec'd Date/Time) for each message, but the only retrieval option for the messages collection seems to be get_ItemByDBID(). But how can I know the DBID? (I could resort to linking a text field directly to the database and use some SQL to retrieve this, but would imagine there is a better way using the COM API?)

User avatar
jimimaseye
Moderator
Moderator
Posts: 6402
Joined: 2011-09-08 17:48

Re: Error C3083 compiling hMs

Postby jimimaseye » 2017-08-01 19:32

If it helps, it is the same number that you find appearing in the log file and under the 'messageID' column of the hm_messages table.

as in

"APPLICATION" 4936 "2017-08-01 18:06:37.866" "SMTPDeliverer - Message 373720: Delivering message from xxx to yyy. File: D:\Datastore\hMailData\{535446A7-A882-4CA9-A3F7-4B2E7A97F870}.eml"
"APPLICATION" 4936 "2017-08-01 18:06:41.329" "SMTPDeliverer - Message 373720: Message delivery thread completed."
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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-01 23:24

hottroc wrote:the only retrieval option for the messages collection seems to be get_ItemByDBID().

There is also

app >> domains >> domain >> accounts >> account >> IMAPfolders >>IMAPfolder >> Messages >> Message

Or you could build the message list using normal mail protocol POP3 or IMAP (not in the COM API)
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-02 14:47

it is the same number that you find appearing in the log file and under the 'messageID' column of the hm_messages table.


Thanks, it's how to get this number programmatically. I could perhaps directly connect to the database and use sql but is there a better way using the COM API?

mattg wrote:
hottroc wrote:the only retrieval option for the messages collection seems to be get_ItemByDBID().

There is also

app >> domains >> domain >> accounts >> account >> IMAPfolders >>IMAPfolder >> Messages >> Message


Ok so I need some clarification here please. When hMS receives a mail for an account from elsewhere (via SMTP delivery) is that mail automatically and instantly put into a IMAP folder (INBOX?) for that account, even if IMAP is not used for retrieval? So if I list all mail for an account in the IMAP folder would that be all the mail for that account? Also the way to get a reference to that "Message" object, if that is by DBID then that is the issue I am having, ie how to get that reference.
In other words:
to get the 1st message for joe.bloggs@mydomain.com I need to know the ....Messages >> Message(DBID).
I cant use ...Message >> Message(1)

Secondly, at least as far as my intellisense sees it, I can get as far as _representedAccount >> IMAPfolders>> then I have to go >> ItemByName (presumably "INBOX"), >> then nothing shows in intellisense, but presumably >> Messages>> Message(then assume you would need the messageID again, which is the bit I can't determine).

Think I will need some trial and error.....?

User avatar
jimimaseye
Moderator
Moderator
Posts: 6402
Joined: 2011-09-08 17:48

Re: Error C3083 compiling hMs

Postby jimimaseye » 2017-08-02 17:09

You can select the message by any means you want or have availbalve to you - the DBID is only needed when you then want to action against that email

eg,

Set oMessage = oMessages.Item(iMessages)
If (oMessage.InternalDate < CDate(Now - )) Then oMessages.DeleteByDBID(oMessage.ID)

In this eaxample you see that standard way of getting to a message by using the messages object index: https://www.hmailserver.com/documentati ... t_messages

This example in the documentation will give you some clues too on how to get to an email by its current folder: https://www.hmailserver.com/documentati ... map_folder

When hMS receives a mail for an account from elsewhere (via SMTP delivery) is that mail automatically and instantly put into a IMAP folder (INBOX?) for that account, even if IMAP is not used for retrieval

Technically no. It will be assigned an ID, and the email will then live in the DATA root directory. Then the delivery queue will delivery it (subject to whatever rules you have) to the relevant account. When an email lands in an account (as allowed by any rules) it will then technically exist in the INBOX. Every account has an INBOX folder regardless of your email collection protocols in use.

Hope this helps.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-02 18:03

jimimaseye wrote:You can select the message by any means you want or have availbalve to you - the DBID is only needed when you then want to action against that email

eg,

Set oMessage = oMessages.Item(iMessages)
If (oMessage.InternalDate < CDate(Now - )) Then oMessages.DeleteByDBID(oMessage.ID)

So in this example how do I get the variable iMessages?

In this eaxample you see that standard way of getting to a message by using the messages object index: https://www.hmailserver.com/documentati ... t_messages


Again, in this example:

Code: Select all

Message Item(long Index)

Returns the message in the collection with the given index.
(read-only)

... same thing, but how do I get the value of Index?


[When hMS receives a mail for an account from elsewhere (via SMTP delivery) is that mail automatically and instantly put into a IMAP folder (INBOX?) for that account, even if IMAP is not used for retrieval

Technically no. It will be assigned an ID, and the email will then live in the DATA root directory. Then the delivery queue will delivery it (subject to whatever rules you have) to the relevant account. When an email lands in an account (as allowed by any rules) it will then technically exist in the INBOX. Every account has an INBOX folder regardless of your email collection protocols in use.

Hope this helps.


Yes thanks, that is very helpful. So when you say "When an email lands in an account ..it will then technically exist in the INBOX. Every account has an INBOX folder regardless of your email collection protocols in use." then this is the same as the IMAP folder "Inbox"? and hence can be accessed by IMAPfolders >>IMAPfolder ("Inbox")? If so then I can work with this and use what you say here...
This example in the documentation will give you some clues too on how to get to an email by its current folder: https://www.hmailserver.com/documentati ... map_folder

...hence accessing the messages in the messages collection without needing to know the messageID or index or DBID or whatever you wanna call it. So this will do the trick.

User avatar
jimimaseye
Moderator
Moderator
Posts: 6402
Joined: 2011-09-08 17:48

Re: Error C3083 compiling hMs

Postby jimimaseye » 2017-08-02 18:44

Yes, "inbox" (the default storage folder for a received email) is the same as the IMAP inbox.

same thing, but how do I get the value of Index?

The usual way is a FOR...NEXT look through the messages. Even when accessing the messages as they appear in the IMAP folders "INBOX", you will still need to access it by its index number. If you are sure there is only one message in there then of course it will always be index=0 (so, example "oMessages.Item(0)"). IOW if you are sure of the index number as it appears in the group then you can quote it directly .... but you cant (hence the need to access the MESSAGES group with a FOR...NEXT and then use the value as the index number).

See this: viewtopic.php?f=21&t=28139 and scroll down the first post and you will see 'EMAILCLEARDOWN.VBS' - perhaps that will give you some idea on how to access the messages wither by IMAP folder or just generally by account.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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-03 00:58

hottroc wrote:
jimimaseye wrote: Every account has an INBOX folder regardless of your email collection protocols in use.

Yes thanks, that is very helpful. So when you say "When an email lands in an account ..it will then technically exist in the INBOX. Every account has an INBOX folder regardless of your email collection protocols in use." then this is the same as the IMAP folder "Inbox"? and hence can be accessed by IMAPfolders >>IMAPfolder ("Inbox")?

UNLESS there is a rule that moves the mail from the inbox to another IMAP folder...or if the user has moved the mail message from the inbox manually...or if the mail client has a rule...or if the mail client does automatic junk mail filtering...etc (you get the point)

Are you looking for ALL messages, or are you only looking for unread messages?
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-03 21:27

jimimaseye wrote:
same thing, but how do I get the value of Index?

The usual way is a FOR...NEXT look through the messages. Even when accessing the messages as they appear in the IMAP folders "INBOX", you will still need to access it by its index number. If you are sure there is only one message in there then of course it will always be index=0 (so, example "oMessages.Item(0)"). IOW if you are sure of the index number as it appears in the group then you can quote it directly .... but you cant (hence the need to access the MESSAGES group with a FOR...NEXT and then use the value as the index number).

See this: viewtopic.php?f=21&t=28139 and scroll down the first post and you will see 'EMAILCLEARDOWN.VBS' - perhaps that will give you some idea on how to access the messages wither by IMAP folder or just generally by account.

It's a shame all the examples seem to be in VB when the code is actually in VC#. Anyway I can't seem to get it to work, it won't let me access the messages as a collection using an index number with a For..Next loop or using Foreach..., see my code....

Code: Select all

//Start of my section

            textTotMessages.Text = _representedAccount.Messages.Count.ToString();
            hMailServer.Message[] foldermessages    = _representedAccount.IMAPFolders.get_ItemByName("Inbox").Messages;
            foreach (hMailServer.Message message in foldermessages)
         {
           GridViewMail.CurrentRow.SetValues(message.From, message.Subject, message.Date, "SELECT");
                GridViewMail.Rows.Add();
 
          }
           
//end of my section


GridViewMail is a gridview I added in the Designer. and textTotMessages is a textbox above for total number of messages. _representedAccount is already in the coding and is the account selected in the treeview.
The error seems to be with "hMailServer.Message[] foldermessages = _representedAccount.IMAPFolders.get_ItemByName("Inbox").Messages;" it says I can't convert .Messages into Message[]. How then can I access the messages by index?

Are you looking for ALL messages, or are you only looking for unread messages?


Erm, all messages for the selected account but obviously I will need to do more work to get subfolders etc, so I'll just start with the Inbox for now, thanks. What I meant was that there are no messages for an account that sit in the server (and are only put in the Inbox when an IMAP client connects), or are in an account "Inbox" that was separate to the Imap "Inbox" but it seems the answer is no, so that is fine.

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-03 23:21

There is c/c++ abstraction which receives and store the messages in db/data folder which is the message object source for POP3/IMAP

Both protocols are diffrent and. If you made changes in the IMAP sectlion it will be IMAP only but surely will cause trouble within the underlying storage management system within hms.The interfaces at this layer are private and not exposed to the COM API and not accessible from outside the servercore code.
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
mattg
Moderator
Moderator
Posts: 17596
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Error C3083 compiling hMs

Postby mattg » 2017-08-03 23:46

hottroc wrote:Erm, all messages for the selected account but obviously I will need to do more work to get subfolders etc, so I'll just start with the Inbox for now, thanks.

Code: Select all

   Set oApp = CreateObject("hMailServer.Application")
   Call oApp.Authenticate("Administrator", "topSecretPassword")

   For i = 0 To oApp.Domains.count-1
      Set oDomain = oApp.Domains.item(i)
      For j = 0 To oDomain.Accounts.count-1
         Set oAccount = oDomain.Accounts.Item(j)
         For l = 0 To oAccount.IMAPFolders.Count-1
            Set oIMAPFolder = oAccount.IMAPFolders.Item(l)
            For k = oIMAPFolder.Messages.Count -1 To 0 Step -1
               Set oMessage = oIMAPFolder.Messages.Item(k)
               'do stuff here
            Next
         Next
      Next   
   Next
   
   ' you also have to do the same for #public folders which aren't attached to ANY account
      set oIMAPFolder = oApp.settings.Publicfolders.ItemByName("spam")
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-04 00:12

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?

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

Re: Error C3083 compiling hMs

Postby hottroc » 2017-08-04 00:23

Dravion wrote:There is c/c++ abstraction which receives and store the messages in db/data folder which is the message object source for POP3/IMAP

Both protocols are diffrent and. If you made changes in the IMAP sectlion it will be IMAP only but surely will cause trouble within the underlying storage management system within hms.The interfaces at this layer are private and not exposed to the COM API and not accessible from outside the servercore code.


Not sure I'm following you? This is what I was asking about, so is there an "underlying storage management system" that is separate to the IMAP folders?
And not sure if you're understanding me, I'm just changing the Administrator so I can view messages. Not changing the server code at all. But using the COM API to do so, which does expose the interfaces I need.

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-04 01:10

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

Yes

That has been copied from my Eventhandlers.vbs which is the vbs script that hmailserver reads and uses when scripts are enabled.
hMailserver scripts can only be VBS or JQuery. Most of us use VBS, hence the prolific number of examples using VBS.

The script snippet works for me. There is definitely a 'messages.item(ByVal Index as LONG) as Message' property.
This is also shown in the documentation >> https://www.hmailserver.com/documentati ... t_messages
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation


Return to “Development & alpha discussions”



Who is online

Users browsing this forum: No registered users and 5 guests