Giter Club home page Giter Club logo

Comments (8)

flashmob avatar flashmob commented on May 13, 2024 2

Go program just needs to get the result to see if the send was successful. Of course, you do not need to use Go for that - there are many ways to skin a cat. This is really a Producer–consumer problem, whatever way you use to solve it should be fine :-)

from go-guerrilla.

flashmob avatar flashmob commented on May 13, 2024

For sending email, it's much more tricky since there's a lot of moving parts such as DKIM, SPF, feedback loops, IP address reputation and more. Perhaps a cloud offering such as mailgun.com or mandrill.com could be used, or you could DIY and configure an instance of postfix if you are familar with setting all that up.

We are currently refactoring the server to be more modular so that it would be easier to add new features in the future.

from go-guerrilla.

jojo05 avatar jojo05 commented on May 13, 2024

Is Postfix better than Exim? (I've used Exim in the past and it's slightly complicated).
Thanks

from go-guerrilla.

jojo05 avatar jojo05 commented on May 13, 2024

I've done some research and Postfix seems better (more modular, better confi). For the Go solution, I've found these libraries (in rough order of priority):

https://godoc.org/github.com/eaigner/dkim
https://godoc.org/github.com/toorop/go-dkim
https://godoc.org/github.com/emailfabric/dkim

https://github.com/gopistolet/gospf
https://godoc.org/github.com/zaccone/goSPF/spf
https://godoc.org/github.com/cathalgarvey/gospf
https://github.com/daniellockard/gospfquery

from go-guerrilla.

flashmob avatar flashmob commented on May 13, 2024

This is how email is sent on Guerrilla Mail:

For DKIM key generation, the dkim tools package is very useful:

apt install opendkim-tools

and then the following command to generate the keys:

opendkim-genkey -r -b 2048 -d guerrillamail.com -s selector_name --hash-algorithms=sha256 --directory=/path/to/somewhere

(Where selector_name can be any name you choose)

Then the DNS is updated with the public key, the private key is used for signing. You only need to do this once every year or so. Also the SPF is also set in the DNS records, no need to use any other tools / programs.

Guerrilla Mail has all the DKIM and SPF admin procedure fully automated.

As for sending, a Go program is used to read messages from a queue and schedule them for sending. To do the actual sending, the Go program executes a legacy PHP script through a FastCGI backend ( https://github.com/flashmob/go-fastcgi-client ). The PHP does the signing, reads the MX records, chooses the best MX server and uses https://github.com/PHPMailer/PHPMailer to do the actual sending and returns the result to the Go program...

The packages you have linked to are mostly for validating DKIM / SPF, but validation is only used for spam filtering, we just have to sign the message with our key when sending and make sure that our SPF and DMARC records are configured + any other administrative tasks.

from go-guerrilla.

jojo05 avatar jojo05 commented on May 13, 2024

Thanks, this is very useful.

For a webmail solution, where I get messages I care about, I would need to filter spam (on the received messages) using DMARC (DKIM+SPF), that's why I thought I would need the validating libs.

from go-guerrilla.

flashmob avatar flashmob commented on May 13, 2024

Welcome, Thanks for asking.
A quick way to setup a spam filter would be to
apt-get install spamassassin spamc

/etc/init.d/spamassassin restart
and then do something like in this example: https://github.com/saintienn/go-spamc

from go-guerrilla.

aftabnaveed avatar aftabnaveed commented on May 13, 2024

I know this issue is closed, but I am just wondering why would you need "Go" to process the output of PHP script (that is used to send emails via PHPMailer like mentioned above)?

from go-guerrilla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.