pop icon indicating copy to clipboard operation
pop copied to clipboard

Resend API key required even with custom SMTP

Open ro78 opened this issue 2 years ago • 8 comments

Describe the bug Since a recent release, we can use an external (custom) SMTP instead of Resend. But when I try to use it, it's still asks me to configure a Resend API key.

To Reproduce Steps to reproduce the behavior:

  1. Install pop on a clear host
  2. Run the command pop --smtp.host localhost --smtp.port 25 --from [email protected]
  3. See error

Expected behavior Pop doesn't display any error related to Resend

Screenshots 2023-08-14_113536

Desktop (please complete the following information):

  • OS: Debian 11
  • Browser: N/A
  • Version: 0.2

ro78 avatar Aug 14 '23 09:08 ro78

I found that username & password is mandatory. I think it's better to accept using SMTP without them, as some hosts are trusted relays without any auth.

ro78 avatar Aug 15 '23 13:08 ro78

Any update on this?? still having the same issue.

p-i-c-o avatar Aug 31 '23 12:08 p-i-c-o

@ro78 any update??

p-i-c-o avatar Sep 13 '23 14:09 p-i-c-o

Any update from me? No, I reported this bug and I don't have any update from the developer.

ro78 avatar Sep 13 '23 14:09 ro78

Any update from me? No, I reported this bug and I don't have any update from the developer.

Ok, thank you anyways

p-i-c-o avatar Sep 14 '23 06:09 p-i-c-o

Looks like currently it's a feature, not a bug. You can't set smtp credential via command line, you have to set them via environment variables.

ltdangle avatar Nov 01 '23 09:11 ltdangle

That’s a bug. You should be able to post though a local SMTP without authentication.

compare

$ export POP_SMTP_HOST=localhost
$ export POP_SMTP_PORT=25
$ pop

   ERROR   RESEND_API_KEY  environment variable is required.

   You can grab one at https://resend.com/api-keys

with:

$ export POP_SMTP_HOST=localhost
$ export POP_SMTP_PORT=25
$ export POP_SMTP_USERNAME=foo
$ export POP_SMTP_PASSWORD=bar
$ pop
                                       
 From foo                              
 To [email protected]                    
 Subject Hello!                        
                                       
 ┃ # Email                             
…

Anyway, you can work around that limitation by setting: a bogus POP_SMTP_USERNAME and a bogus POP_SMTP_PASSWORD and POP_SMTP_ENCRYPTION=none

$ export POP_SMTP_HOST=localhost
$ export POP_SMTP_PORT=25
$ export POP_SMTP_USERNAME=foo
$ export POP_SMTP_PASSWORD=bar
$ export POP_SMTP_ENCRYPTION=none
$ pop

(it works!)

Also, pop makes a(nother) very unwelcome assumption, for a TUI software: it forces the use of fully qualified From and To email addresses ([email protected]). From a "terminal" perspective, especially with POP_SMTP_HOST=localhost a user expects being able to send emails from & to local addresses:

$ pop
                                       
 From user1                              
 To user2                    
 Subject Hello!                        
                                       
 ┃ # Email                             
…

An email address of the form "user" is perfectly legitimate on the local system.

p4tpr0 avatar Sep 24 '24 21:09 p4tpr0