[GH-ISSUE #57] Are gmail "app passwords" supported? #53

Closed
opened 2026-03-03 01:19:24 +03:00 by kerem · 11 comments
Owner

Originally created by @sc0ttj on GitHub (Nov 15, 2020).
Original GitHub issue: https://github.com/d99kris/nmail/issues/57

Originally assigned to: @d99kris on GitHub.

Is it possible to use 2FA Gmail with nmail? ... I setup my Gmail, create an "App password", which you give your app instead of your password, if using 2FA, and it doesn't work..

App passwords let you sign in to your Google Account from apps on devices that don't support 2-Step Verification. You'll only need to enter it once so you don't need to remember it.

https://support.google.com/accounts/answer/185833?hl=en-GB


To be specific: I can see my emails, I can read emails, but I cannot delete them, or send them .. I am able to create drafts, which end up in the drafts folder (can see them in my browser), but they won't send from nmail..

Is this related to the fact I'm using 2FA with an "App password"? My SMTP settings seem to be OK..

Originally created by @sc0ttj on GitHub (Nov 15, 2020). Original GitHub issue: https://github.com/d99kris/nmail/issues/57 Originally assigned to: @d99kris on GitHub. Is it possible to use 2FA Gmail with `nmail`? ... I setup my Gmail, create an "App password", which you give your app instead of your password, if using 2FA, and it doesn't work.. > App passwords let you sign in to your Google Account from apps on devices that don't support 2-Step Verification. You'll only need to enter it once so you don't need to remember it. https://support.google.com/accounts/answer/185833?hl=en-GB --- To be specific: I can see my emails, I can read emails, but I cannot delete them, or send them .. I _am_ able to create drafts, which end up in the drafts folder (can see them in my browser), but they won't send from `nmail`.. Is this related to the fact I'm using 2FA with an "App password"? My SMTP settings seem to be OK..
kerem closed this issue 2026-03-03 01:19:25 +03:00
Author
Owner

@d99kris commented on GitHub (Nov 16, 2020):

Hi @sc0ttj - yes, GMail "app passwords" should work. I set up 2FA and generated an app password for one of my GMail accounts just now, and it works fine with nmail (reading, deleting, moving, composing, sending) for me.

I'll add some note about GMail app passwords to the README to make it clear for future users.

Regarding your issues, it almost seems as if you have "read-only" access - although I am not aware if there are such types of restricted GMail app passwords.

To create the app password I assume you used https://myaccount.google.com/apppasswords from a web browser and selected app "Mail"? Are you using nmail from the same machine / public IP address, or different?

For nmail setup / configuration, did you use the built-in setup wizard nmail -s gmail?

Are you getting any error message in the UI (bottom of screen) when trying to delete an email for example?

One troubleshooting step could be to try using the same app password with another email client, like Thunderbird, and see if everything is working there?

Another option would be to run nmail --verbose and try sending an email and deleting an email, and then sharing the ~/.nmail/log.txt with me (d99kris at gmail dot com).

FWIW - I am using nmail with my primary GMail account, under both macOS Catalina and Ubuntu 20.04, on daily basis with no IMAP or SMTP issues.

<!-- gh-comment-id:727702141 --> @d99kris commented on GitHub (Nov 16, 2020): Hi @sc0ttj - yes, GMail "app passwords" should work. I set up 2FA and generated an app password for one of my GMail accounts just now, and it works fine with `nmail` (reading, deleting, moving, composing, sending) for me. I'll add some note about GMail app passwords to the README to make it clear for future users. Regarding your issues, it almost seems as if you have "read-only" access - although I am not aware if there are such types of restricted GMail app passwords. To create the app password I assume you used https://myaccount.google.com/apppasswords from a web browser and selected app "Mail"? Are you using `nmail` from the same machine / public IP address, or different? For `nmail` setup / configuration, did you use the built-in setup wizard `nmail -s gmail`? Are you getting any error message in the UI (bottom of screen) when trying to delete an email for example? One troubleshooting step could be to try using the same app password with another email client, like Thunderbird, and see if everything is working there? Another option would be to run `nmail --verbose` and try sending an email and deleting an email, and then sharing the `~/.nmail/log.txt` with me (d99kris at gmail dot com). FWIW - I am using `nmail` with my primary GMail account, under both macOS Catalina and Ubuntu 20.04, on daily basis with no IMAP or SMTP issues.
Author
Owner

@sc0ttj commented on GitHub (Nov 16, 2020):

Thanks for getting back to me... I have managed to send/delete emails with other clients, so have sent u an email with some extra info.

<!-- gh-comment-id:728429221 --> @sc0ttj commented on GitHub (Nov 16, 2020): Thanks for getting back to me... I have managed to send/delete emails with other clients, so have sent u an email with some extra info.
Author
Owner

@d99kris commented on GitHub (Nov 17, 2020):

Hi @sc0ttj - thanks for sharing the log-file. I can see that there's a mismatch between what nmail thinks your trash-folder is named ([Gmail]/Trash) vs. its actual name ([Gmail]/Bin). Please try edit your ~/.nmail/main.conf and change the line
trash=[Gmail]/Trash
to
trash=[Gmail]/Bin

This should fix the deletion issue.

As for the sending issue I am not sure yet. I can tell from the log that you're running fossapup64 9.5. Could you please help share the steps you took to install the nmail dependencies?

I tried finding some info on puppy linux package management, but it seems there are many ways to install software. I figure I'll be more lucky in reproducing the issue if I install the dependencies the same way as you.

<!-- gh-comment-id:728841828 --> @d99kris commented on GitHub (Nov 17, 2020): Hi @sc0ttj - thanks for sharing the log-file. I can see that there's a mismatch between what `nmail` thinks your trash-folder is named (`[Gmail]/Trash`) vs. its actual name (`[Gmail]/Bin`). Please try edit your `~/.nmail/main.conf` and change the line ```trash=[Gmail]/Trash``` to ```trash=[Gmail]/Bin``` This should fix the deletion issue. As for the sending issue I am not sure yet. I can tell from the log that you're running `fossapup64 9.5`. Could you please help share the steps you took to install the nmail dependencies? I tried finding some info on puppy linux package management, but it seems there are many ways to install software. I figure I'll be more lucky in reproducing the issue if I install the dependencies the same way as you.
Author
Owner

@sc0ttj commented on GitHub (Nov 17, 2020):

Thanks, I renamed the Trash folder in my nmail config, and can delete emails now..

...As for the rest:

I installed the deps using Pkg, but they could also be installed using the default package manager (a GUI program called 'Puppy Package Manager'.. in Menu -> Setup -> Puppy Package Manager).

Here's the output if me (re)installing the deps:

# pkg add libetpan-dev libssl-dev libncurses-dev libxapian-dev libsqlite3-dev markdown_1.0.1-10
Skipping libetpan-dev (already built-in)..
Skipping libssl-dev (already built-in)..
Skipping libncurses-dev (already built-in)..
Package libxapian-dev already installed.
Use the -f option to force installation: pkg add libxapian-dev -f
Skipping libsqlite3-dev (already built-in)..
Download markdown from focal-universe repo:
URL: http://archive.ubuntu.com/ubuntu/pool/universe/m/markdown/markdown_1.0.1-10_all.deb
Downloading markdown_1.0.1-10_all.deb. Please wait: 100%
Downloaded: /root/pkg/markdown_1.0.1-10_all.deb
Install package markdown_1.0.1-10_all:
Installed: markdown_1.0.1-10_all
To run, type any of these commands:
  markdown
To view the docs, type any of these commands:
  man markdown.1
  man Markdown.3

Resolving dependencies..
No missing dependencies.

Here's a list of the relevant installed packages:

# pkg LI | grep -E 'libetpan-dev|libssl-dev|libncurses-dev|libxapian|libsqlite3-dev'
libxapian30_1.4.14-2_amd64
libxapian-dev_1.4.14-2_amd64
libetpan-dev_1.9.4-2
libncurses-dev_6.2
libsqlite3-dev_3.31.1
libssl-dev_1.1.1f

Note, these are standard Ubuntu .deb packages from the Ubuntu focal repos..

..and the output of using cmake, from the 'build' dir:

# cmake .. && make -s
-- Found ccache
-- Using build type 'Debug' (default).
-- Found libetpan
-- Configuring done
-- Generating done
-- Build files have been written to: /root/sites/github/nmail/build
[  4%] Building CXX object CMakeFiles/nmail.dir/src/addressbook.cpp.o
[  8%] Building CXX object CMakeFiles/nmail.dir/src/body.cpp.o
[ 12%] Building CXX object CMakeFiles/nmail.dir/src/cacheutil.cpp.o
[ 16%] Building CXX object CMakeFiles/nmail.dir/src/config.cpp.o
[ 20%] Building CXX object CMakeFiles/nmail.dir/src/contact.cpp.o
[ 25%] Building CXX object CMakeFiles/nmail.dir/src/crypto.cpp.o
[ 29%] Building CXX object CMakeFiles/nmail.dir/src/flag.cpp.o
[ 33%] Building CXX object CMakeFiles/nmail.dir/src/header.cpp.o
[ 37%] Building CXX object CMakeFiles/nmail.dir/src/imap.cpp.o
[ 41%] Building CXX object CMakeFiles/nmail.dir/src/imapcache.cpp.o
[ 45%] Building CXX object CMakeFiles/nmail.dir/src/imapindex.cpp.o
[ 50%] Building CXX object CMakeFiles/nmail.dir/src/imapmanager.cpp.o
[ 54%] Building CXX object CMakeFiles/nmail.dir/src/lockfile.cpp.o
[ 58%] Building CXX object CMakeFiles/nmail.dir/src/log.cpp.o
[ 62%] Building CXX object CMakeFiles/nmail.dir/src/loghelp.cpp.o
[ 66%] Building CXX object CMakeFiles/nmail.dir/src/main.cpp.o
[ 70%] Building CXX object CMakeFiles/nmail.dir/src/searchengine.cpp.o
[ 75%] Building CXX object CMakeFiles/nmail.dir/src/serialized.cpp.o
[ 79%] Building CXX object CMakeFiles/nmail.dir/src/smtp.cpp.o
[ 83%] Building CXX object CMakeFiles/nmail.dir/src/smtpmanager.cpp.o
[ 87%] Building CXX object CMakeFiles/nmail.dir/src/status.cpp.o
[ 91%] Building CXX object CMakeFiles/nmail.dir/src/ui.cpp.o
[ 95%] Building CXX object CMakeFiles/nmail.dir/src/util.cpp.o
[100%] Linking CXX executable nmail
[100%] Built target nmail

Thanks

<!-- gh-comment-id:729132001 --> @sc0ttj commented on GitHub (Nov 17, 2020): Thanks, I renamed the Trash folder in my nmail config, and can delete emails now.. ...As for the rest: I installed the deps using [Pkg](https://gitlab.com/sc0ttj/Pkg), but they could also be installed using the default package manager (a GUI program called 'Puppy Package Manager'.. in Menu -> Setup -> Puppy Package Manager). Here's the output if me (re)installing the deps: ``` # pkg add libetpan-dev libssl-dev libncurses-dev libxapian-dev libsqlite3-dev markdown_1.0.1-10 Skipping libetpan-dev (already built-in).. Skipping libssl-dev (already built-in).. Skipping libncurses-dev (already built-in).. Package libxapian-dev already installed. Use the -f option to force installation: pkg add libxapian-dev -f Skipping libsqlite3-dev (already built-in).. Download markdown from focal-universe repo: URL: http://archive.ubuntu.com/ubuntu/pool/universe/m/markdown/markdown_1.0.1-10_all.deb Downloading markdown_1.0.1-10_all.deb. Please wait: 100% Downloaded: /root/pkg/markdown_1.0.1-10_all.deb Install package markdown_1.0.1-10_all: Installed: markdown_1.0.1-10_all To run, type any of these commands: markdown To view the docs, type any of these commands: man markdown.1 man Markdown.3 Resolving dependencies.. No missing dependencies. ``` Here's a list of the relevant installed packages: ``` # pkg LI | grep -E 'libetpan-dev|libssl-dev|libncurses-dev|libxapian|libsqlite3-dev' libxapian30_1.4.14-2_amd64 libxapian-dev_1.4.14-2_amd64 libetpan-dev_1.9.4-2 libncurses-dev_6.2 libsqlite3-dev_3.31.1 libssl-dev_1.1.1f ``` Note, these are standard Ubuntu .deb packages from the Ubuntu focal repos.. ..and the output of using `cmake`, from the 'build' dir: ``` # cmake .. && make -s -- Found ccache -- Using build type 'Debug' (default). -- Found libetpan -- Configuring done -- Generating done -- Build files have been written to: /root/sites/github/nmail/build [ 4%] Building CXX object CMakeFiles/nmail.dir/src/addressbook.cpp.o [ 8%] Building CXX object CMakeFiles/nmail.dir/src/body.cpp.o [ 12%] Building CXX object CMakeFiles/nmail.dir/src/cacheutil.cpp.o [ 16%] Building CXX object CMakeFiles/nmail.dir/src/config.cpp.o [ 20%] Building CXX object CMakeFiles/nmail.dir/src/contact.cpp.o [ 25%] Building CXX object CMakeFiles/nmail.dir/src/crypto.cpp.o [ 29%] Building CXX object CMakeFiles/nmail.dir/src/flag.cpp.o [ 33%] Building CXX object CMakeFiles/nmail.dir/src/header.cpp.o [ 37%] Building CXX object CMakeFiles/nmail.dir/src/imap.cpp.o [ 41%] Building CXX object CMakeFiles/nmail.dir/src/imapcache.cpp.o [ 45%] Building CXX object CMakeFiles/nmail.dir/src/imapindex.cpp.o [ 50%] Building CXX object CMakeFiles/nmail.dir/src/imapmanager.cpp.o [ 54%] Building CXX object CMakeFiles/nmail.dir/src/lockfile.cpp.o [ 58%] Building CXX object CMakeFiles/nmail.dir/src/log.cpp.o [ 62%] Building CXX object CMakeFiles/nmail.dir/src/loghelp.cpp.o [ 66%] Building CXX object CMakeFiles/nmail.dir/src/main.cpp.o [ 70%] Building CXX object CMakeFiles/nmail.dir/src/searchengine.cpp.o [ 75%] Building CXX object CMakeFiles/nmail.dir/src/serialized.cpp.o [ 79%] Building CXX object CMakeFiles/nmail.dir/src/smtp.cpp.o [ 83%] Building CXX object CMakeFiles/nmail.dir/src/smtpmanager.cpp.o [ 87%] Building CXX object CMakeFiles/nmail.dir/src/status.cpp.o [ 91%] Building CXX object CMakeFiles/nmail.dir/src/ui.cpp.o [ 95%] Building CXX object CMakeFiles/nmail.dir/src/util.cpp.o [100%] Linking CXX executable nmail [100%] Built target nmail ``` Thanks
Author
Owner

@d99kris commented on GitHub (Nov 18, 2020):

Thanks a lot for the detailed information! Very useful!

Could you try installing the following package, then start nmail and try send an email again:

pkg add libsasl2-modules

Please let me know if it fixes the issue. Later I'll see how I can improve documentation or UI to cover this indirect dependency.

<!-- gh-comment-id:729633362 --> @d99kris commented on GitHub (Nov 18, 2020): Thanks a lot for the detailed information! Very useful! Could you try installing the following package, then start nmail and try send an email again: ``` pkg add libsasl2-modules ``` Please let me know if it fixes the issue. Later I'll see how I can improve documentation or UI to cover this indirect dependency.
Author
Owner

@d99kris commented on GitHub (Nov 18, 2020):

Leaving the issue open until confirmed fixes the problem.

<!-- gh-comment-id:729643005 --> @d99kris commented on GitHub (Nov 18, 2020): Leaving the issue open until confirmed fixes the problem.
Author
Owner

@sc0ttj commented on GitHub (Nov 19, 2020):

I installed the dep, which was indeed not yet installed... Unfortunately, it still did not send the email..

I ran nmail with -ee, and have the logs from when i tried to send.. If they're of any use to you?

Full disclosure, I'm using a VPN, but this didn't stop claws-mail or aerc from sending emails OK..

<!-- gh-comment-id:730047285 --> @sc0ttj commented on GitHub (Nov 19, 2020): I installed the dep, which was indeed not yet installed... Unfortunately, it still did not send the email.. I ran nmail with `-ee`, and have the logs from when i tried to send.. If they're of any use to you? Full disclosure, I'm using a VPN, but this didn't stop claws-mail or aerc from sending emails OK..
Author
Owner

@d99kris commented on GitHub (Nov 19, 2020):

That is quite odd. I was able to reproduce your issue under fossapup64 9.5 until I installed the modules. I might've run the command:

pkg add libsasl2

but as far as I could tell it installed the libsasl2-modules package, which is the important part.

I'm preparing a new version of nmail which will have it query libsasl2 for system installed authentication mechanisms and log it to the log file, but it's not ready yet. Meanwhile, yeah the extended verbosity log would be interesting to see, thanks.

<!-- gh-comment-id:730347956 --> @d99kris commented on GitHub (Nov 19, 2020): That is quite odd. I was able to reproduce your issue under `fossapup64 9.5` until I installed the modules. I might've run the command: ``` pkg add libsasl2 ``` but as far as I could tell it installed the libsasl2-modules package, which is the important part. I'm preparing a new version of `nmail` which will have it query libsasl2 for system installed authentication mechanisms and log it to the log file, but it's not ready yet. Meanwhile, yeah the extended verbosity log would be interesting to see, thanks.
Author
Owner

@d99kris commented on GitHub (Nov 19, 2020):

VPN should not be an issue (as it's working fine with other email clients like you mentioned).

<!-- gh-comment-id:730349271 --> @d99kris commented on GitHub (Nov 19, 2020): VPN should not be an issue (as it's working fine with other email clients like you mentioned).
Author
Owner

@sc0ttj commented on GitHub (Nov 19, 2020):

Good news! I found a bug in my system (dpkg-deb related, specifically "pkgbinarymangler") that prevented the libsasl2 package from working OK once installed..

I fixed that, re-ran pkg add libsasl2-modules_2.1.27+dfsg-2, and opened nmail..

I sent an email .. Didn't get any error message, checked with recipient, they received it OK.

So looks like the problem was indeed that my system did not have libsasl2-modules_2.1.27 installed.. Now that it is (finally) installed, I'm happy to say nmail works for sending, receiving and deleting emails.

Thanks for all your help! Sorry for the troubles..

<!-- gh-comment-id:730363999 --> @sc0ttj commented on GitHub (Nov 19, 2020): Good news! I found a bug in my system (dpkg-deb related, specifically "pkgbinarymangler") that prevented the `libsasl2` package from working OK once installed.. I fixed that, re-ran `pkg add libsasl2-modules_2.1.27+dfsg-2`, and opened `nmail`.. I sent an email .. Didn't get any error message, checked with recipient, they received it OK. So looks like the problem was indeed that my system did not have `libsasl2-modules_2.1.27` installed.. Now that it _is_ (finally) installed, I'm happy to say `nmail` works for sending, receiving and deleting emails. Thanks for all your help! Sorry for the troubles..
Author
Owner

@d99kris commented on GitHub (Nov 19, 2020):

That's great to hear! Thanks for the update. I will close this issue for now.

<!-- gh-comment-id:730423559 --> @d99kris commented on GitHub (Nov 19, 2020): That's great to hear! Thanks for the update. I will close this issue for now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nmail#53
No description provided.