awdeorio / mailmerge

A simple, command line mail merge tool.
MIT License
144 stars 41 forks source link

Davmail Compatibility #106

Open bmclean2 opened 4 years ago

bmclean2 commented 4 years ago

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 myself@mydomain.com')"

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 commented 4 years ago

Would it help to use the security parameter? There are several examples in mailmerge_server.conf, which you can produce with mailmerge --sample.

On Fri, Oct 9, 2020 at 9:42 PM bmclean2 notifications@github.com wrote:

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 myself@mydomain.com')"

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?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/awdeorio/mailmerge/issues/106, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZHZHJ667B7HTWHEM7Z54LSJ63ZPANCNFSM4SKWZTFQ .

bmclean2 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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
  2. Remove these two lines to disable TLS.
  3. 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 commented 4 years ago

It works! Thank you!

awdeorio commented 4 years ago

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:

bmclean2 commented 4 years ago

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.