Skip to content
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

Davmail Compatibility #106

Open
bmclean2 opened this issue Oct 10, 2020 · 9 comments
Open

Davmail Compatibility #106

bmclean2 opened this issue Oct 10, 2020 · 9 comments

Comments

@bmclean2
Copy link

Let me preface this by saying that this very well could be a davmail issue, but I thought I'd put it here for discussion purposes. I use davmail in SMTP/IMAP server mode to connect to exchange servers with msmtp, NeoMutt, isync, calendars, etc. When I use the following config for mailmerge...

[smtp_server]
host = localhost
port = 1025
username = MYDOMAIN\johnny.smith

...I get the following error: "localhost:1025 failed to send message: (530, b'Authentication required', 'My Self [email protected]')"

I don't get a password prompt. I'm not sure if the error is happening with mailmerge or davmail. Maybe some of you can chime in. Is there a hidden verbose mode in mailmerge that can be accessed?

@awdeorio
Copy link
Owner

awdeorio commented Oct 10, 2020 via email

@bmclean2
Copy link
Author

The security parameter is not required for davmail since you are just communicating with a localhost smtp server. The security between davmail and the exchange server, on the other hand, is automatically handled.

@awdeorio
Copy link
Owner

The SMTP library API has no password when using no security. Let me know if there's a security option (password but no encryption) that mailmerge is missing.

@bmclean2
Copy link
Author

I think that's the issue. To connect to davmail, you need the security option of password but no encryption. Are you saying the SMTP library API doesn't offer that, or just that it hasn't been implemented in mailmerge?

@awdeorio
Copy link
Owner

I do not know whether the Python SMTP library offers the option of a password but no encryption. Feel free to take a look!

@awdeorio
Copy link
Owner

awdeorio commented Nov 2, 2020

Here's an idea you could try. Let me know if this works for you.

  1. Create mailmerge_server.conf like this. Change the port if you need to.
[smtp_server]
host = YOUR_HOST_HERE
port = 25
security = STARTTLS
username = YOUR_USERNAME_HERE
  1. Remove these two lines to disable TLS.
  2. Try sending a message with mailmerge

If that works, then we could use it as the basis for creating a localhost only no-password option.

@bmclean2
Copy link
Author

bmclean2 commented Nov 5, 2020

It works! Thank you!

@awdeorio
Copy link
Owner

awdeorio commented Nov 5, 2020

Awesome! Would you be willing to implement a new server config to handle this? It would be more-or-less a clone of the STARTTLS configuration, minus the lines we discussed earlier. In summary:

  • Add a new else to this if statement for a new security configuration. Maybe call it CLEARTEXT or UNENCRYPTED?
  • Add a new section to the sample server config generated by mailmerge --sample
  • Add a unit test to test_sendmail_client.py, mimic test_security_starttls() for a starting point.

@bmclean2
Copy link
Author

bmclean2 commented Nov 7, 2020

Sure! I'm not familiar with python, but I will give it a try on my machine and test it out. The only caveat is that won't get to it for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants