kha7iq / pingme

PingMe is a CLI which provides the ability to send messages or alerts to multiple messaging platforms & email.
https://pingme.lmno.pk
MIT License
771 stars 43 forks source link

Can't send email without password #56

Closed BrunIF closed 3 years ago

BrunIF commented 3 years ago

Describe the bug

2021/08/03 11:44:41 failed to send mail: smtp: server doesn't support AUTH: send notification To Reproduce

Steps to reproduce the behavior:

  1. send email without (empty) password
kha7iq commented 3 years ago

Thanks for opening the issue. Can you describe the issue in details, i need more information about this.

  1. send email without (empty) password

Do you mean to say you can not send email when exporting the password via env var ?

pingme email \
  --rec "example@gmail.com" \
  --msg "This is an email from PingMe CLI" \
  --sub "Email from PingMe CLI" \
  --sender "sender@gmail.com" \
  --host "smtp.gmail.com" \
  --port "587" \
  --pass "secretPassword"

If you don't want to specify the password with --pass then you can export it via variable EMAIL_PASSWORD. This is the password for sender's email, which will be used for sending mails to target addresses

BrunIF commented 3 years ago

In my case, I can put any email, but the password does not have to be. I don't know how you could reproduce it. Can this option be made optional?

kha7iq commented 3 years ago

Email uses your existing email provider to send emails, in this example it uses server settings for gmail. For example if you send an email to me you have to provide your gmail account and pass to pingme, then it will use that account to send emails. You can input my email with --rec flag and proceed.

BrunIF commented 3 years ago

image

kha7iq commented 3 years ago

@BrunIF I understand the issue now. pingme uses https://pkg.go.dev/net/smtp#PlainAuth for email, i have set the password to optional in new branch can you please build it locally and test. Let me know if it works for you and i will merge it to master afterwards.

git clone -b disable-require-flag-for-email https://github.com/kha7iq/pingme.git
cd pingme
go build -o pingme main.go
./pingme .......
BrunIF commented 3 years ago

Not working. Most likely this problem is not pingme.