-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtual domains #9
Comments
It seems straightforward if I just add multiple domain support to SMTP. Virtual user directory then will be “user@domain”. So all domain users will have the account in the same folder. To make the user folder like “user/domain” will require more work, and more work to make each domain home folder configurable, for instance /var/mail/accounts/domain1/user and /etc/domain2/user. Could do the change incrementally though. I have checked in the multiple domain support for SMTP. I’ll try to add the proper user account folder handling this week.
|
That's very generous of you - let me know if I can help out with anything. Cheers |
No problem. I’m happy to get the feedback and good suggestions for enhancement.
|
I checked in the second change, i.e. the user account folder for user@domain is domain/user.
|
Excellent - thanks for adding this in - I'll try it out this afternoon. I also need to read through the code thoroughly - I read http://javiermunhoz.com/blog/2014/04/19/detecting-and-removing-computer-virus-with-ocaml.html last year - I might try and find some time to see if I could add something to imaplet. Thanks for making this available. |
Cool. It’ll be great if this system is improved/grown by the community.
|
Just doing an install - everything fine until I do a: sudo imaplet_create_account -u [email protected]:mysecretpassword I get an error of : failed: invalid domain I have edited imaplet.cf and added the domain of example.com and created the directory /var/mail/accounts/example.com/john.doe, but not started anything - ie sudo imaplet What's the best way forward here? :) |
It works for me. Can you email your imaplet.cf file? You don’t need to create the directory for domain, imaplet_create_account creates necessary directory.
|
|
One day I'll master markdown! |
Yeah, this is better :-)
|
I see the issue, the domain is commented out: domainexample.com;anotherexample.com;yetanotherexample.com domain example.com;anotherexample.com;yetanotherexample.com
|
aha! OK, thanks |
No pr.
|
just one more thing - I'm trying to set up my android/gmail client. When it gets to the imap set up, I'm getting a read error: Can't safely connect to server. Have you come across this before? |
This looks like its trying to use SSLv3, which is unsupported. Any idea how to get your setup to use TLS 1.0 instead (most really should by default).
|
Well, I had ssl/tls set to 'accept all certificates'. Changing it to default ssl/tls throws the error: Can't safely connect to server. I also am unable to get my desktop thunderbird client to connect to imap/smtp. I am, however, able to telnet in on port 25 |
I might just try another android client to see what happens. Don't understand why thunderbird doesn't connect - all I've done is a default install on the cubieboard2 |
I can connect with iPhone, iPad, Thunderbird on Ubuntu, and Android. I have not used Android for a while though. I’ll charge it up and test.
|
first think to test is to see if you can connect via telnet for plain connection or via openssl for ssl.
|
thanks - not too sure how to test this with openssl - I've already telnet'd into port 25 and this works. What do I need to do for openssl |
OK, I've just tried: openssl s_client -connect 192.169.1.10:993 -crlf and it just hangs - looks like I need to restart it and set it up for debug logging - here we go ... |
to test IMAP: openssl s_client -connect ip:port -tls1 -crlf you should get a prompt from the server. try go login with this command: a login name password then logout with: a logout If this works then you successfully tested IMAP server. To test SMTP: openssl s_client -connect ip:port -tls1 -starttls smtp -crlf when you get the prompt just type: quit. This verifies you SMTP over ssl. If you got both working then you should be in good shape. Are you testing the server on the LAN? If it’s WAN then 25 and 587 ports might be blocked. Try a different SMTP port, like 2587.
|
Need to add ‘-tls1’
|
Thanks for all of this - both smtp and imap hang with openssl. I'll set it up for debugging and start looking at the logs. Has to be something simple or something I've missed. Very best. |
No pr. Let me know if you need help. You can also try to configure the server not use ssl and see if that works.
|
Looking at the logs for imap, I'm getting a client request exception:
The domain/user/cert directory exists with server.key and server.pem - could this be a problem with the server not picking up these files with the new virtual user setup? |
Do you run imaplet as ‘sudo imaplet’? Does the server.key look like binary? If you use the domain the user name to login should have the domain, i.r. user@domain. This could be the problem too.
|
Yes, I was using : ‘sudo imaplet’ Just ssh'd into the cubieboard, did a ‘sudo imaplet’ and I can access the imap daemon via openssl. Haven't the slightest idea why it works now as I haven't changed anything. However, I've just tried to both receive an external email and send an email from my local thunderbird. My entry in users is:
An error occurred while sending mail. The mail server responded: 5.7.8 : From address rejected: User unknown in local. Please check the message recipient [email protected] and try again. Also, the console output (sudo imaplet) throws out: Fatal error: exception Invalid_argument("Lwt.wakeup_result")
Delivery to the following recipient failed permanently: Technical details of permanent failure: The error that the other server returned was: |
My guess is that Thunderbird sends “nick.betteridge” as the user name and not “[email protected] mailto:[email protected]”. How did you configure your email account (SMTP) in Thunderbird? I’m not sure about the error. It looks like OCaml core library crashes. I’ll have to try to reproduce it. As far as sending email from gmail. Gmail can not resolve the example.com http://example.com/ domain via DNS, i.e. there is no email server bound to the example.com http://example.com/. You can only send email to globally accessible email servers and usually you need a DNS MX record configured for this domain because SMTP relay (i.e. when it has to relay message to another server) usually verifies MX record to filter out spam email. Or you can send email within your LAN and refer to your server directly by ip or host name. Does your email work if you don’t have the domain setup? It’s better to start with something simpler and make sure it works, and then move towards more complex configuration.
|
|
You have repeated the user name twice, it should be vrfy [email protected] mailto:[email protected]
|
Strange, I'm sure I didn't (might have been copy/paste via email)- just did the same thing again and got the same error: vrfy [email protected] mailto:[email protected] |
Hm, you have again two user names in the command…
|
Good old markdown - believe me the angled brackets are there in the second field! :)
By the way, just looked at the smtp log:
Maybe this makes more sense? |
Sorry, are you typing in two user names or one? You don’t need the brackets and you don’t need the ‘mailto:’, just one user name vrfy user@domain
|
Oh, OK, I was just mimicking your original set of commands.
|
Ok, by bad. When I added the domain I didn’t update the vrfy command. I checked in the fix. Can you pull from the repo, rebuild, and try to run it?
|
Apologies - had to go to a sports day! rebuilt and installed:
Also, when I fire up thunderbird, it notifies me it was logged out by the server - this is the log:
|
No pr.
|
The server.key in /var/mail/accounts/example.com/nick.betteridge/cert is binary with permissions 644 and I'm running sudo imaplet |
I can't seem to be able to track down the problem with:
I've also noticed that the imap log starts with:
Shouldn't the 'user' be 'domain/user' - this might also be true of locating the certificates ? On the otherhand, SMTP (looking at the smtp log) seems to be rejecting false email addresses correctly :) |
Does the server key look like a binary or a text? When the server starts, the user is not known yet, when the user logs in with user@domain then %user% is replaced with domain/user. I can add some debugging to the code that retrieves the keys and we can figure out what is going on. I’ll send you a file to replace a bit later in the day.
|
Server key is binary OK, I'll sit tight for the debugging code. Thanks. |
Please replace _ssl.ml with attached in lib/commands. The log goes to imaplet.log, Also set the log level to info3
|
|
ok, just did.
|
OK, this is what I got via the imap log:
On thunderbird, my username for the imap server is [email protected] |
I also just tried to send an email from gmail and this is the failure I got from gmail:
and from the smtp log:
|
I can’t find anything wrong so far. It looks as if it fails to decrypt the key which is encrypted with concat of user and password. So it would seem like either user or pswd is incorrect. Is it possible that what you put different password when auth_required false
|
Does VRFY work?
|
For imap, I set auth_required false, and then sudo imaplet, I still get : client_requests exception: Invalid_argument("No RSA keys") For smtp, VRFY gives me :
Also, when I tried to send a mail from thunderbird via smtplet, I also get a 'User unknown in local'
I'm pretty sure the password is OK - is there any way I can redo the password? |
|
Well, I just tried creating another account and the password was 'password'. the imap client seems to work - ie I can log in and see the folders. Sending an email from gmail to the new account gives the following in the smtp log:
Sending an email from the client to gmail results in an exception:
and an smtp log:
it looks as though the imap server is still running |
|
I don’t have password complexity checking.
|
Does [email protected] have an account? Is syntactics.com configured in imaplet.cf?
|
yes, I created another account with [email protected] - but forgot to change it to example.com! Yes, it's configured in imaplet.cf for the domain and exists in users |
Cool, so it works now?
|
No - I meant that the account exists but I hadn't filtered this issue and replaced n.betteridge with example.com |
Would be excellent if there was more than one domain, with virtual users - is this much work to fix?
The text was updated successfully, but these errors were encountered: