Couldn't send email in Redmine - redmine

I try to send email in Redmine with sendmail method, but I don't receive any email.
Therefore, I tried configuring smtp email setup in Redmine using the following parameters, but I get the error "An error occurred while sending mail (execution expired)".
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "box784.bluehost.com"
port: 465
authentication: :plain
user_name: "username+domain.com"
password: password
enable_starttls_auto: true
my Information:
Environment:
Redmine version 2.1.4.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.8
Environment production
Database adapter MySQL
Redmine plugins:
no plugin installed

After a couple of very late nights playing with all the settings in the configuration.yml file, I have finally been able to get email notifications to work with Redmine on Bluehost. Getting it to work with SMTP was a futile exercise, and Bluehost wasn't very helpful with getting it resolved, however I got it working using sendmail. The trick is to add a couple extra parameters, which really should be documented in the Redmine Wiki help. Here is a copy of my configuration.yml file, which works. It's the enable_starttls_auto and authentication settings that make it work (go figure). Make sure you get the spacing right (each indent has 2 spaces):
production:
email_delivery:
delivery_method: :sendmail
sendmail_settings:
arguments: -i
enable_starttls_auto: false
authentication: :none
Finally! Working Sendmail with Redmine on Bluehost!

This configuration works. You can use the test email feature in Redmine to test this.
Source: https://poopcode.com/configure-outlook-email-in-redmine/

Related

How can I send an email from Apache superset?

I'm facing Authentication unsuccessful error when I try to send mail from Apache Superset.
I checked the document's SMTP integration chapter:https://apache-superset.readthedocs.io/en/latest/installation.html
I changed SMTP_PASSWORD parameter and I entered password manually in my config.py file like SMTP_PASSWORD = "'xxx!!'" (I added '' because my password includes special character like '!'. Also, I tried SMTP_PASSWORD="xx!!" but also I'm getting error.
smtplib.SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful')
I can login with my SMTP user via browser (Exchange). Could you please help me to solve this issue?
Apache Superset version: 1.3.2
Python version:3.8
OS version: RHEL 8
Thanks
You might be able to poke at this by checking your SMTP connection from inside your Superset instance.
From where your Superset instance should be sending the emails, start a Python script and try:
import smtplib
server = smtplib.SMTP('smtpservername.yourdomain', yourportnumber)
If that command fails or hangs indefinitely, you know there's a connection problem. You might try connecting to the GMail SMTP server or another known-to-work set of credentials and seeing if that works to narrow it down.
For instance, if running Superset with docker-compose you would enter the worker container with docker exec -it superset_worker /bin/bash, run python, and try this there.
My scheduled reports were failing and doing this helped me isolate a cause: my Superset instance could not connect to the target unauthenticated SMTP server.

OperationalError, Error 111 connecting to 127.0.0.1:6379. Connection refused. After deploying in heroku

I am getting the below error after I deployed my website on heroku.
Error 111 connecting to 127.0.0.1:6379. Connection refused.
Request Method: POST
Request URL: https://website.herokuapp.com/account/register
Django Version: 3.2.8
Exception Type: OperationalError
Exception Value:
Error 111 connecting to 127.0.0.1:6379. Connection refused.
Exception Location: /app/.heroku/python/lib/python3.8/site-packages/kombu/connection.py, line 451, in _reraise_as_library_errors
Python Executable: /app/.heroku/python/bin/python
Python Version: 3.8.12
Python Path:
['/app',
'/app/.heroku/python/bin',
'/app',
'/app/.heroku/python/lib/python38.zip',
'/app/.heroku/python/lib/python3.8',
'/app/.heroku/python/lib/python3.8/lib-dynload',
'/app/.heroku/python/lib/python3.8/site-packages']
Server time: Sat, 11 Dec 2021 21:17:12 +0530
So basically my website has to send email regarding otp, after registration and also some contract related emails. These email are neccessary to be sent hence can't be avoided. I posted a question earlier here regardig how to minimize the time that sending emails takes so that the user doesn't have to wait the entire time. I was suggested to use asynchronous code for this. So i decided to use celery for this. I followed the youtube video that taught how to use it.
Now after I pushed the code in the website I am getting this error. I am beginner andd have no idea how to rectify it. Please suggest me what shoul I do. Below are the details and configurations.
settings.py
CELERY_BROKER_URL = 'redis://127.0.0.1:6379'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379'
CELERY_ACCEPT_CONTENT =['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SELERLIZER = 'json'
requirements.txt
amqp==5.0.6
asgiref==3.4.1
billiard==3.6.4.0
celery==5.2.1
click==8.0.3
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
colorama==0.4.4
Deprecated==1.2.13
dj-database-url==0.5.0
Django==3.2.8
django-ckeditor==6.1.0
django-filter==21.1
django-js-asset==1.2.2
django-multiselectfield==0.1.12
dnspython==2.1.0
As I mentioned I am beginer, please suggest me a detailed ans as to how I can recctify this error.
Here's the problem:
CELERY_BROKER_URL = 'redis://127.0.0.1:6379'
Redis won't be running on your local dyno. You'll have to run it somewhere else and configure your code to connect to it. A common choice is to run Redis via an addon:
Once you’ve chosen a broker, create your Heroku app and attach the add-on to it. In the examples we’ll use Heroku Redis as the Redis provider but there are plenty of other Redis providers in the Heroku Elements Marketplace.
If you choose to use Heroku Redis, you'll be able to get the connection string to your instance via the REDIS_URL environment variable:
Heroku add-ons provide your application with environment variables which can be passed to your Celery app. For example:
import os
app.conf.update(BROKER_URL=os.environ['REDIS_URL'],
CELERY_RESULT_BACKEND=os.environ['REDIS_URL'])
Your Celery app now knows to use your chosen broker and result store for all of the tasks you define in it.
Other addons will provide similar configuration mechanisms.
All quoted documentation here, and most links, come from Heroku's Using Celery on Heroku article. I suggest you read the entire document for more information.

Docker SMTP Server for Django Container SMTP backend

I am looking to have one of my django docker containers setup a smtp backend so I can send input from a contact form to a gmail address as well as possibly send out an email when someone puts in their email to subscribe for updates: https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend
How do I go about setting up the SMTP server? Is it a separate docker container? How do I set it up?
The email backend is just an imported module. You can just use it like it is described in the docs: https://docs.djangoproject.com/en/1.11/topics/email/#email-backends
Before that, you have to configure the data for the smtp server. You just have to configure the settings, like your smtp host, username and password, etc. Here are the docs to configure it: https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend
You can use an existing smtp server. If you have a package with a domain you probably have a an email account included.
There is no need for another container. But you can setup your own in a a separate container. There are already some docker-ready solutions present. Here are a few:
https://github.com/namshi/docker-smtp
https://mailu.io/
https://github.com/tomav/docker-mailserver
just do changes in some file
#add it in docker_compose.yml
maildev:
image: maildev/maildev
ports:
- "49180:80"
# add it in your settings.py file
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'maildev'
EMAIL_PORT = 25
# then run docker-compose up -d
# when it done then run docker build -t <your tag Name> .
happy coding.......
refrence link:
[1]: https://melvinkoh.me/configure-and-send-email-in-django-for-both-development-and-production-cjye4y0l7000nuns1m43vstaq

Can't deploy app because of database connection error

does anyone know why I can't deploy my application? I'm using the exact same configuration/changes I did to my other app which I can deploy to cc without any problems (different credentials, of course).
database.yml:
production:
adapter: postgresql
encoding: unicode
reconnect: false
pool: 3
database: xxx
host: horton.elephantsql.com
port: 5432
username: xxx
password: xxx
This is the error message I get:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
/srv/tmp/builddir/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `initialize'
/srv/tmp/builddir/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `new'
/srv/tmp/builddir/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `connect'
Any suggestions?
Since during push the Add-on credentials are not yet available (they're only available during run-time) you have to set the following option to tell Rails to not try to initialize the database during asset precompilation.
config.assets.initialize_on_precompile = false if ENV['BUILDPACK_RUNNING']
You can find this and other Rails related settings here: https://www.cloudcontrol.com/dev-center/Guides/Ruby/RubyNotes.

Django email backend with local smtp

I want send email from django application.
I want send an email to my mail id from other username without authentication. Just i used smtp server for the authenticated mail.In the django mail api How it is supposed to send an mail with the local smtp?
As stated on the docs: https://docs.djangoproject.com/en/dev/topics/email/?from=olddocs you need to:
On your settings.py define the following:
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025
Then, in another shell run the following command:
python -m smtpd -n -c DebuggingServer localhost:1025
That will run a dummy SMTP server, that actually will not send any email but you'll be able to see the output and check if that's correct. If you want to actually send your emails during development, you will need to install a SMTP server like sendmail and use that in your configuration.