ivx wrote:Hi,
Funny Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName should work and some time ago i tried with mono 2.4 all worked.
I will try that out, if won't work,, yes these lines can be replaced with both-working ones.
(As i get right, you replaced these in 3 palces only ?)
Yes, only at these 3 places.
The thing is, it works when you have binfmt-support installed.
Meaning, when you can start a .NET .executable with ./filename.exe
But when I have to compile mono 2.6, and the distro is still on 2.4, I can't change the binfmt-support, because that might brake other applications.
So in order to start it with mono 2.6 and not system-default mono 2.4, I have to start with mono-2.6 ./filename.exe
Think of it as an interpreter and a compiler.
With binfmt, think of it as running filename.exe standalone/compiled, so the process is filename.exe
Without binfmt, think of it as if running filename.exe interpreted, with the process being the interpreter at /usr/bin/mono-2.6 and not filename.exe.
ivx wrote:
Only thing with latest may be sqllite, it needs to load right lib for linux.
Shouldn't be a problem. SQlite works fine on Linux, never had a problem.
Though SQlite uses some native dll's, so you need to know that you have to replace them with the Linux version.
ivx wrote:
>I didn't look at it closely, but it looked to me like you seem to be reading and writing XML manually.
Nope, standard .NET DataSet with default values.
Yep, makes sense when you work with a bare database, without nhibernate.
ivx wrote:
>I still get a filenotfound exception on startup using trace, and when I stop the server, I get an exception Socket Interrupted <filename unknown>
>EventArgs.AcceptCallback <filename unknown>
>Is there still one more occurence of incorrect filename/log somewhere ?
Do you get this if not default smtp,pop3,imap ports ?
Don't know, will have to try when I get home.
ivx wrote:
>One question Ivar: Where do I set Mailstore-Directory in the MailServerManager ?
>I didn't find the option, so I had to change it in the XML file directly.
On API propereties ... in UI.
API properties ? I don't see any such item anywhere.
But it's not really important.
ivx wrote:
XML will go off soon, i switch sqllite instead. XML not safe when many writes, whole file needs to be rewritten each time.
Probably i deprecate all other API, will leave possibility to code them but wont maintain other than sqllite by myself.
sqllite has workd ok for imap messages indexing, so seems fast and stable enough.
XML writing is never save when you use multithreading, such as in ASP.NET/MailServer, you need to properly lock the file, but that will get you performance problems, if you have many users at the same time. Actually it happened to me that it isn't even save in single-treading, because you can make a web-page (for one user only) with Flash in it (Flash is always asynchronous and uses async http requests), so it can send the next web request to a ashx-handler before the first request has been finished. If both ashx-handlers need to write to the same xml-file --> boooom
If you use SQlite (or at least FirebirdEmbedded), you'll have the same problem if your application is multithreaded, because it will write to the same file at the same time ---> boooom
You need to have the database in a separate, single threaded process, and make tcp connections to it. The database then must queue your request, and process the queue from one and the same thread at all times.
BTW, I'd use Nhibernate, it supports SQlite, MS-SQL, PG-SQL, MySQL, Sybase, Oracle, Firebird, etc.
That way you can keep one code, one API, for all databases.
Then, you only need to take care of views and procedures/functions in the different database yourself, something one can do oneselfs, if one absolutely wants to use lsMailServer with some other database.
One other thing is, if you use Firebird (OpenSource version of InterBase) embedded instead of SQlite (it's not as popular as SQlite), you can use one and the same database/procedure/functions for embedded and non-embedded.
It's a bit hard to get started with Firebird though, since you need something like sql management studio (http://www.sqlmanager.net/products/studio/ibfb), and the thing is while getting a 'free' version isn't difficult, it's not very intuitive. Once you've created the first db file however, it's just as simple, the challenge is creating the first one (one needs to install Firebird server first, connect to it, create the database, then one can take the file and connect to it via embedded-firebird).
The advantage over SQlite is, that you can put the Firebird-file right back into the fully-blown database at any time, without the slightest modification.