mirror of
https://github.com/d99kris/nmail.git
synced 2026-04-27 02:06:00 +03:00
[GH-ISSUE #22] [Bug] Cannot send emails in Solus Linux using an Exchange account #20
Labels
No labels
bug
enhancement
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nmail#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @d99kris on GitHub (Jan 29, 2020).
Original GitHub issue: https://github.com/d99kris/nmail/issues/22
Originally assigned to: @d99kris on GitHub.
From @kabouik in #13:
@d99kris commented on GitHub (Jan 29, 2020):
Hi @kabouik - please help share a log-file for when sending fails, and I'll take a look. If you could drop a note here as well when you've sent the log-file it would be great, as I don't check my spam-folder all the time.
@Kabouik commented on GitHub (Jan 29, 2020):
Thanks, I'll send you a log file later today.
This is a good excuse to ask you how to add attachments with nmail (#23).
@Kabouik commented on GitHub (Jan 29, 2020):
I just sent you the log file (hopefully it went through). However I forgot to add myself as CC and I used disroot.org, so I can't check myself due to #20.
@d99kris commented on GitHub (Jan 30, 2020):
Unfortunately I did not receive any email (yep checked my Spam folder as well). Could you try send again (d99kris at gmail dot com)? Perhaps you could try sending using a different email client (although I don't have issues sending email attachments using
nmailmyself).@Kabouik commented on GitHub (Jan 30, 2020):
I just sent the message again, with a different client this time.
@d99kris commented on GitHub (Jan 31, 2020):
Thanks! I received the email. In the log I see
But I'm not sure what causes it. Just for my reference so I know what library versions you are using, could you help run
and share the output?
@d99kris commented on GitHub (Jan 31, 2020):
Actually I might not need the
lddoutput, I did a test using an outlook account on a Linux system and I am also encountering some send issue. Hopefully it's the same issue you are facing. Let me try debug.@d99kris commented on GitHub (Jan 31, 2020):
The issue I faced on Linux with Outlook was trying to send using port 465. Once I switched to 587 the problem went away. Perhaps you could try using port 587 - just to see if it makes any difference?
In
~/.nmail/main.confit's the following line:smtp_port=587@Kabouik commented on GitHub (Feb 1, 2020):
It seems to work indeed. Weird, I remembered I actually started with STARTTLS and 587 but it didn't work, and then changed it to 465 to check if it would be better (it was not). Most likely, it was on my computer that fails to send from any account. On the phone, I confirm STARTTLS works on an Exchange account. Thanks.
Problem half solved because I know from other clients that 465 should work too with this account.
@d99kris commented on GitHub (Feb 2, 2020):
Ok, thanks for checking!
Ok, yep we'll leave the bug open. Hopefully I'll encounter some other SMTP server where I can reproduce the same problem you were seeing. It turns out the issue I faced when using outlook.com was "connection refused" on port 465, so most likely a server-side issue and not the same issue you were facing.
@d99kris commented on GitHub (Feb 10, 2020):
Hi again!
I've done some additional tests on the only Exchange server I have access to
smtp-mail.outlook.comand even using other email clients (Thunderbird) it does not accept sending emails using SSL/TLS (port 465). It only accepts STARTTLS (port 587).Could you please help double-check that you are able to send using SSL/TLS (port 465) with other email clients with your Exchange server?
The reason for asking is that nmail is working fine for me to send emails using SSL/TLS (port 465) for other email service providers that does support it.
Thanks!
@Kabouik commented on GitHub (Feb 11, 2020):
I'm sorry I have been (and still am) very busy lately and had no time at all to tinker with all this, but I carefully sorted all the notification emails I received and got pretty excited by the recent development and updates. New features, major fixes, I am looking forward to trying all this and make nmail my computer client too (it is my phone client at the moment, due mainly to #28).
Please bear with me, I'm sorry for leaving you hanging there, but I'll get back to it later (perhaps second half of next week or sometime this week-end).
@d99kris commented on GitHub (Feb 11, 2020):
No worries, I fully understand. And definitely no rush :)
@Kabouik commented on GitHub (Mar 24, 2020):
I can confirm I could send an email with port 465 from the Exchange account using Mailspring. It took a long time compared to sending emails with 587, so maybe there were some errors/time-outs (I'm not sure how to access logs with Mailspring), but it was successfully sent eventually.[Edit] Forget that. Port was set to 465 in my test but the protocol was still STARTTLS. I guess that's why sending took longer: it was likely trying with 465 first and then reverted to the default STARTTLS port. I can't connect to the SMTP server when setting port 465 and SSL/TLS protocol.
As I said some weeks ago, I did try both 465 and 587 in nmail but 587 did not work while 465 was working with Disroot from nmail installed on my phone, so I changed my configuration files to 465 for all accounts. However, the test was perhaps biased, because I might have been using the Solus computer at the time, and later realized that this machine could not send any email because of the libetpan issue. Therefore, I tried again to set the Exchange account to port 587, but still no dice. I'm sending you the logs in a minute.
@d99kris commented on GitHub (Mar 26, 2020):
Thanks for sharing the log! I'll need to study it a little before concluding next step.
@d99kris commented on GitHub (Mar 29, 2020):
So just to try narrow down on the scope of the issue - the problem you have is sending email using an Exchange account only under Solus Linux, is that correct?
The good news is I tested Solus Linux with a Hotmail/Outlook-account and I'm also unable to send emails, so I can reproduce the issue.
The bad news is that it seems it's not a bug in nmail, but rather in the underlying libraries it uses to send email.
If I build libetpan from source and try send using its built-in test program, it works fine under Ubuntu but fails in Solus Linux. For my own reference I send using:
The error seem to originate from a libsasl2 call, so it's probably not a libetpan bug. Possibly it's (again) some libetpan build config issue, but I've tried some different libetpan build options without finding a working config (yet).
Will see how to troubleshoot/debug this further.
@Kabouik commented on GitHub (Mar 30, 2020):
I can confirm I'm not having the issue from Exchange and my arm64 Debian container on the phone.
@d99kris commented on GitHub (May 21, 2020):
Finally got a chance to take a look at this. It appears that Cyrus SASL packaged
for Solus Linux is not built with LOGIN authentication support, which is
what Outlook / Exchange servers require.
Some Linux distros package SASL plugins separately (for example named libsasl2-modules) but I didn't see any such package for Solus Linux.
We can work around this by building / installing Cyrus SASL from source.
First make sure that Cyrus SASL and libetpan are not installed:
Install build pre-requisites (edit: updated as of Jan 2021):
Get latest Cyrus SASL release:
Configure
And make sure configure step outputs:
Build and install
Add symbolic link for libetpan to find library
Get latest libetpan release:
Configure
Build and install
Get latest nmail:
Configure, build and install
Please let me know if it works, and feel free to re-open if the problem is not solved. FYI - I have not reported any request with the Solus project regarding LOGIN support in Cyrus SASL. Please feel free to do so.
@Kabouik commented on GitHub (May 21, 2020):
Is there a specific file that could show whether LOGIN authentication is supported in the system packages? Solus'
eopkghas a convenientsfoption to search files, maybe they included the required modules in another package. Is there a chance for instance thatcyrus-sasl-develwould be what we need? If not, I'll create a new task right away on the Solus dev board, and will follow the manual build procedure you documented (thanks a lot for detailing it so much!).@d99kris commented on GitHub (May 23, 2020):
I am not sure if Cyrus SASL uses some standard for this, but In my Ubuntu 20.04 LTS installation LOGIN authentication is provided by this file:
No, I don't think
cyrus-sasl-develis sufficient. I installed that package while I was doing initial troubleshooting on Solus and tried running the libetpan test program, and it failed to find the SASL2 LOGIN mechanism.@Kabouik commented on GitHub (Jun 18, 2020):
I carefully followed the guide you posted (I did it already when you posted it, but here I started from scratch to make sure there was no conflict), checked that LOGIN was enabled, but something still seems to be off: when sending the email I composed with the Exchange account, this time
nmaildidn't show the failure warning, but the message does not appear in the Sent, Outbox or Drafts folders, and the recipient (myself for testing) didn't receive the message.I understand this may not be a
nmailissue though (Solus devs moved thecyrus-sasltask I opened on their todo list, so there's hope), but I wanted to keep you posted. Also, I hope the Solus update will actually solve this issue, but today's test got me concerned.On the bright side, it seems theIn fact crashes are still frequent on the Exchange account (and rare on others).nmailsession configured to the Exchange account does not crash as often as it used to (#13), although it still happens. Could that be related tocyrus-sasl?@Kabouik commented on GitHub (Jun 18, 2020):
Hum. The exact same test (same sender, same recipient, different object) 5 minutes later made the first email finally go through. The second is still missing.
When sending the second, I could see the status bar briefly showing "Connected" before going back to "Idle". Manually refreshing with "L" did not suffice to actually send the first email, but trying to send a second one worked. Refreshing still does not suffice to send the second email. However now, after navigating through
nmailviews, I'm "Connected" again but still no second email showing in the recipient account.@Kabouik commented on GitHub (Jun 18, 2020):
I kept repeating the same test after restarting
nmailand now it seems to work better, with emails actually being received a few seconds after sending them innmail, without needing to send another one. Perhaps there was some performance issues with my Exchange server when I tried. The second test email arrived much later than the subsequent tests, despite being sent to and from the same accounts, so I'm not sure what was wrong.Also, messages started to appear in the Sent folder after I set
client_store_sent=1inmain.conf. I thought this was not necessary for Exchange, but I was wrong.