Configure the mail server

To configure the mail server you'll need to tweak the following file on your instance:

/opt/dradispro/dradispro/current/config/initializers/z_03_setup_mail.rb

The file itself will walk you through how to configure the mail server. For example, to use your example.com email, you just need to put your username/password into the SMTP settings. Once you get SMTP set up, your Dradis instance should be ready to send out password reset emails.

Then restart the app and services by running the following commands in the console as dradispro:

$ god restart dradispro-unicorn
$ god restart dradispro-resque-1

Reminder: local changes including the mail server configuration will be overwritten the next time you upgrade. If you make any local changes, make sure to re-apply them every time you upgrade Dradis.

A note about using Gmail

A sample for using your personal gmail account as smtp server:

ActionMailer::Base.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => "gmail.com",
  :user_name            => "example@gmail.com",
  :password             => "personal gmail account password",
  :authentication       => "plain",
  :enable_starttls_auto => true
}

A sample for using an account in your Gsuite with custom domain as smtp server:

ActionMailer::Base.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => "example.com",
  :user_name            => "example@example.com",
  :password             => "gsuite gmail account password",
  :authentication       => "plain",
  :enable_starttls_auto => true
}

As of July 15, 2014, Google increased its security measures and now blocks attempts from apps it deems less secure. You can change your Gmail settings here to allow the attempts. If your Gmail account has 2-factor authentication enabled, then you will need to set an app password and use that instead of your regular password.
(source: https://guides.rubyonrails.org/action_mailer_basics.html)

Also note that when trying to use a Gsuite account with a custom domain with 2FA enabled and an app password, we still needed to choose the option Allow users to manage their acccess to less secure apps in the gsuite admin panel, under Security > Basic Settings > Less secure apps: Customization 19 Even with Less secure apps turned off for the account sending the mails, without that option selected emails may not be sent, and you may keep seeing this error:

Net::SMTPAuthenticationError (535-5.7.8 Username and Password not accepted.)