Applying encryption on email.yml / configuration.yml at Bitnami Redmine? - redmine

I'm a newbie on REDMINE(my version is 1.4.4)
I just got a question that is there any way that I can encrypt my email password on configuration.yml file which is to set up email configuration.
FYI, current setting is like below.
email_delivery:
delivery_method: :smtp
smtp_settings:
tls: true
address: smtp.gmail.com
port: 587
domain: smtp.gmail.com
authentication: :plain
user_name: "myEmailAddress#gmail.com"
password: "myEmailPassword" # I don't want to reveal my pw here :(
enable_starttls_auto: true
Thx in advance.

Yes you can but the only way I know to do it is to install and use Postfix as the relay and setup stunnel to handle the encrypted password exchange.
I had my system setup that way for a while but now I use Postfix without stunnel because Amazon SES service now supports starttls.
I had help from this site in my original setup:
http://quietmint.com/linux/postfix-relaying-mail-through-an-smtps-smarthost-on-port-465/
My latest setup I derived help from here:
http://blog.duoconsulting.com/2012/01/30/using-amazons-ses-with-postfix-as-a-smarthost-forwarder/

Related

Odoo : Outcomin Mail Server

I use Odoo 10 installed on VM , i have this problem with Outcoming Mail Server
enter image description here
Hello #Koussay Abdouli
Please change the port to 465 and check again.
Configuration:
Gmail Server: smtp.gmail.com
Port: SSL – 465 / STARTTLS – 587
You should put 465 into the smtp port used by google:
Then create google application password and insert those informations into Security and Authentication menu:

Wso2 5.9 Overriding files

I try to deploy in a development server a copy of wso2 5.9, when i make changes in for example catalina-server.xml for allow reverse proxy in port 443. All my changes overriding.
I already try add the proxyPort in deployment.toml without success.
[server]
hostname = "mydomain.com"
node_ip = "xxx.xxx.xxx..xxx"
base_path = "https://$ref{server.hostname}:${carbon.management.port}"
proxyPort = "443"
Can't found in documentation how i should specify this configuration in new toml file.
This should work.
[transport.https.properties]
proxyPort=443
Seems this is not documented yet. Figured out looking at the repository/resources/conf/templates/repository/conf/tomcat/catalina-server.xml.j2 file.
Seems like this is documented here under Proxy servers in the deployment checklist
so you should use the following
[transport.https.properties]
proxyhost= "you.proxy.host"
proxyPort= "443"

Send email using smtp.gmail.com with 465 port from php on google cloud compute engine

I have Google cloud compute server instance. And i want to send email using smtp.gmail.com with port 465 using PHPMailer function. but it return error : "SMTP error: Could not authenticate."
I don't want to used any third party mail provider like Sendgrid, Mailgun, Mailjet and G Suite.
On other server like AWS we just have to enable email setting and port to send email. I don't want to integrate any 3rd party email provider.
I am new to google cloud server configuration. Please someone help me to send email using smtp.gmail.com with port 465 from google cloud compute engine.
Thanks in advance.
As documented here, you will have to use a SMTP relay agent service using a GSuite domain. This is only if you do not want use the third party email providers. Using the SMTP realy agent service, you can only use port 465 or 587.
I know your question was asked in February of 2019, but I came across it and wanted to give more information for those who may find your question.
PHP is great for sending email because it is fast. PHP mail settings are configured in your PHP.ini file and most issues with it can be resolved via some setting in there. Google cloud has ports 465 (ssl) and 587 (tls) open for you to use. In fact, only port 25 is closed. You specified you were using 465, so you are good to go there. The issue is that you are trying to use Google's SMTP system and likely have not set up the proper configuration - hence the system cannot authenticate you. PHP just creates the message and hands it off to the system to send. The system's smptp system requires a valid login to send mail though. Remember, PHP does NOT require authentication for you to use it.
You can use POST SMTP, which is a free wordpress plugin, to help you configure things if you are using Wordpress.
Walk through this document to see what settings you may need to configure.
https://cloud.google.com/compute/docs/tutorials/sending-mail/
You said you didn't want to use GSuite, but you should read through the documentation for the setup so you can see how to configure the SMTP settings. I am including the link to read the document because email on Google Compute Engine is not trivial and there are little things to configure here and there that you should know about.
https://www.jvfconsulting.com/blog/php-mail-function-vs-smtp-guaranteed-delivery/

Parse server with ElastiCache redis server and password

I have set up a working Parse server on Elastic Beanstalk. I have added an AWS ElasticCache Redis server to use for caching but I can't get the connection to work when using a password, only without. In my Parse server index.js file where I create the new Parse server I connect with Redis like this:
// Redis cache server
var RedisCacheAdapter = require('parse-server').RedisCacheAdapter;
var redisurl='rediss://:'+process.env.REDIS_PASS+'#'+process.env.REDIS_URL
var redisOptions = {url: redisurl};
var redisCache = new RedisCacheAdapter(redisOptions);
Where my URL looks like REDIS_URL=clustercfg.xxxx.xxxx.use1.cache.amazonaws.com
I have tried both redis:// and rediss://. I understand that the RedisCacheAdapter takes only one option - the URL. I thought I could add in the password directly in the link but it does not seem like the adapter parses into password and URL but just expects the URL.
My question is am I doing something wrong here or is there another way to use a password? If it is not possible to use the password I wonder what the reason is (is it because ElastiCache is hidden from the internet and only seen by the server on EC2)?
Update:
Base on comments from #MarkB I tested a few different settings for ElastiCache with my code above modified to also use a password.
var redisOptions = {url: redisurl, password: process.env.REDIS_PASS};
Running ElastiCache with cluster mode, encryption at rest, encryption in transit, and Redis password fails.
Running ElastiCache with encryption at rest, encryption in transit and Redis password fails.
Running ElastiCache with encryption at rest, and encryption in transit, no password fails.
Running ElastiCache without encryption at rest, encryption in transit and no password succeeds.
Seems to me that using encryption at rest and in transit when connecting from Parse server causes a problem I am not sure how to fix. As #MarkB mentioned, the connection between Parse server (EC2) and ElastiCache is restricted to VPC so I am OK with not having the security options, but still, it would be nice.
According to the Parse Server documentation here, the redisOptions will be passed directly to the redis client documented here which supports a password field. I believe that's how you need to be specifying a password instead of specifying it in the URL.
Also note it says if you are using a Redis Client version <2.5 you need to specify auth_pass instead of password.
As you mentioned, with ElastiCache being restricted to your VPC many people consider that secure enough without adding password authentication, unless that is required for something like PCI or HIPAA compliance reasons.

Sending email with AWS SES via SMTP,error 421

So I have a domain purchased through SES which I have verified with SES.I have tested that sending/receiving works by signing into the email with the workmail web app.I am getting the following error when trying to send email with my spring app.
javax.mail.MessagingException: Could not connect to SMTP host: email-smtp.eu-west-1.amazonaws.com, port: 25, response: 421
Appconfig.Java
#Configuration
#PropertySource("app.properties")
#EnableTransactionManagement
public class AppConfig {
#Autowired
private Environment env;
#Bean
public JavaMailSender getJavaMailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost("email-smtp.eu-west-1.amazonaws.com");
mailSender.setPort(25);
mailSender.setUsername("noreply#mydomain.com");
mailSender.setPassword("mypassword");
Properties props = mailSender.getJavaMailProperties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.starttls.required", "true");
props.put("mail.debug", "true");
return mailSender;
}}
EmailServiceImpl.java
#Component
public class EmailServiceImpl {
#Autowired
public JavaMailSender emailSender;
public void sendSimpleMessage(String toAddress, String subject, String text)
{
SimpleMailMessage message = new SimpleMailMessage();
message.setTo(toAddress);
message.setSubject(subject);
message.setText(text);
emailSender.send(message);
}
}
EmailServiceImpl is autowired into my web controller where I send an email after generating a password reset token
First of all,you have done everything right as said in the AWS docs.
You are right in using your smtp credentials as you are using their smtp interface to send mail,and not their aws sdk(if you use,aws sdk,you have to use acces key and password).
But,here comes some other issues which might help you resolve the issues which we have to do as it is not there in the docs.
You have to troubleshoot the error code sent by smtp.
Mostly,SMTP error code 421 shows up when the recipient mail server is very busy as it is receiving a lot of messages,so it temporarily defers your message by giving this error code or your recipient client have some problems.
You can study here.
https://sendgrid.com/blog/smtp-server-response-codes-explained/#:~:text=421%20%E2%80%93%20Your%20message%20was%20temporarily,locked%20or%20is%20not%20routable.
https://www.arclab.com/en/kb/email/smtp-response-codes-error-messages.html#:~:text=The%20SMTP%20error%20421%20is,see%20SMTP%20Error%20451%20below).
You can try sending the mail after sometime or you can try sending with different port.
My Incident:
I was using AWS SES for sending mail from my Springboot Application.
I was also using SMTP interface of AWS ses like you.
There are 3 ports which are listed on AWS management console to send mail.
But,when I was using Port 465,it was not working.
But,when I was using Port 25 or Port 587,it was working.
But,even then,It is always recommended to use 587 as it is recommended by IETF and is safest to use with TLS.
Using Port 465 is least recommended.You can study here but AWS supports it.There are many clients still supporting it but it is not widely in use.
As,I told you in my case it was failing.
You can study here about all the 3 ports and how port 465 functioning is different from port 25 and 587
But,you can solve the issue of port 465 by using smtps protocol with it.
Port-25,587(use smtp as protocol)
Port-465(use smtps as protocol,as in this case client has to initiate the tls encryption)
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
You can get a guide from where to chose a port.
https://pepipost.com/blog/25-465-587-2525-choose-the-right-smtp-port/
You are using port 25. SES uses port 465 or 2465. Also remember to use SES SMTP credentials and not your IAM credentials (AccessKey).
Connecting to the Amazon SES SMTP Endpoint