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

Question related to deployment in production #147

Closed
girardinsamuel opened this issue Jan 12, 2021 · 4 comments
Closed

Question related to deployment in production #147

girardinsamuel opened this issue Jan 12, 2021 · 4 comments

Comments

@girardinsamuel
Copy link

Hi ✋ !

I am planning to develop an app which needs to act on emails receiving and have some questions about production deployment with Salmon.

  1. Do you have some guidelines or documentation about configuring Salmon behind Postfix or Sendmail as advised ?
  2. Is it possible to have a Django app running behind Nginx on a server and a Salmon process running behing Postfix or Sendmail on the same server with Salmon and Django interacting with each other ? (I have seen a quick demo code in Salmon documentation about this)

Thank you in advance,

@moggers87
Copy link
Owner

  1. There's this which should get you started: https://github.com/moggers87/salmon/wiki/Configuring-the-mail-server
  2. I'm not quite sure what you mean by "interact" here. If you mean making emails available to your Django app then that's as simple as storing the emails somewhere both Salmon and Django can access.

@girardinsamuel
Copy link
Author

Thank you, I will take a look and play a bit with postfix config

I was thinking about running django code upon email reception. As I understand, when an email matching a rule is received Salmon will execute the function corresponding to this route. In this function we can do whatever we want, but we are not "inside" django scope so I guess I have to find a way to tell Django an email has been received (local api, sockets.. ?)

@moggers87
Copy link
Owner

Oh, sorry I misunderstood.

You can call any Django code from within Salmon and it'll work fine as long as you've called django.setup() via your boot module. Something like this:

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings')
django.setup()

Then you can use Django code you want in Salmon

@girardinsamuel
Copy link
Author

Oh yes okay sure, I'll try 👍
I am closing this issue then.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants