Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't make -smtp mandatory #177

Closed
arp242 opened this issue Feb 10, 2020 · 8 comments · Fixed by #184
Closed

Don't make -smtp mandatory #177

arp242 opened this issue Feb 10, 2020 · 8 comments · Fixed by #184
Labels
Milestone

Comments

@arp242
Copy link
Collaborator

@arp242 arp242 commented Feb 10, 2020

You need -smtp to self-host a production instance of GoatCounter. This should remain an option but shouldn't be required as it is now.

@arp242 arp242 added the enhancement label Feb 10, 2020
@arp242 arp242 added this to the Version 1.1 milestone Feb 10, 2020
@schoentoon

This comment has been minimized.

Copy link

@schoentoon schoentoon commented Feb 13, 2020

Wouldn't this already just work besides https://github.com/zgoat/goatcounter/blob/master/cmd/goatcounter/serve.go#L102 stopping this? As your zmail package will just print the email to stdout if SMTP is empty https://github.com/zgoat/zhttp/blob/master/zmail/zmail.go#L35

@arp242

This comment has been minimized.

Copy link
Collaborator Author

@arp242 arp242 commented Feb 13, 2020

Yeah, but printing to stdout isn't really a good option for many people I think? If the UI says "an email was sent" then it should probably send an email :-)

It's not a very hard thing to fix though, the net/smtp package can just send emails. It's just something that needs documenting, testing, etc.

@schoentoon

This comment has been minimized.

Copy link

@schoentoon schoentoon commented Feb 13, 2020

That's fair actually. I'm interested in hosting it myself and don't need this feature. Hence why I looked into it. I'll look if I can find the time to make changes for it.

@arp242

This comment has been minimized.

Copy link
Collaborator Author

@arp242 arp242 commented Feb 13, 2020

You can perhaps use mailtrap in the meanwhile; it's what I used at my last job and before I implemented the print-to-stdout, and find it works pretty well.

@schoentoon

This comment has been minimized.

Copy link

@schoentoon schoentoon commented Feb 13, 2020

I prefer to simply /dev/null emails in most of the software I selfhost, definitely not send it to a third party at least.

@arp242

This comment has been minimized.

Copy link
Collaborator Author

@arp242 arp242 commented Feb 13, 2020

Alright. You need emails for logins, so that'll be hard to do at the moment. You could run a simple socket daemon which simply prints the emails (I did something similar for Rails years ago).

arp242 added a commit that referenced this issue Feb 15, 2020
WIP

Fixes #177
@codermehraj

This comment has been minimized.

Copy link

@codermehraj codermehraj commented Feb 17, 2020

Great

arp242 added a commit that referenced this issue Feb 19, 2020
WIP

Fixes #177
arp242 added a commit that referenced this issue Feb 21, 2020
Not necessarily the recommended method; but okay for simple use. Using a
local smtp relay is probably better for serious use.

Fixes #177
arp242 added a commit that referenced this issue Feb 21, 2020
Not necessarily the recommended method; but okay for simple use. Using a
local smtp relay is probably better for serious use.

Fixes #177
@arp242 arp242 closed this in #184 Feb 21, 2020
arp242 added a commit that referenced this issue Feb 21, 2020
Not necessarily the recommended method; but okay for simple use. Using a
local smtp relay is probably better for serious use.

Fixes #177
@arp242

This comment has been minimized.

Copy link
Collaborator Author

@arp242 arp242 commented Feb 21, 2020

Alright, this is now implemented. The default is now -smtp stdout, which will print the emails to stdout only. with -smtp '' GoatCounter will now contact the MX servers directly to try and deliver the email.

Note this is not necessarily recommended; delivering emails is hard, and implementing a full SMTP relay with queuing ad retries is a bit beyond the scope of GoatCounter, but it should work well enough for most simple use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.