Project

General

Profile

Email notification

Added by Novice Novice over 12 years ago

Hello-

Appreciate your assistance with the configuration of email notifications. I can't get it working.

Ubuntu 10.04.3 (lucid) with Redmine 0.9.3-1 (Apache+MySQL) installed from the packages. I created /usr/share/redmine/config/email.yml file and restarted Apache:

production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "10.11.11.2"
port: 25
domain: int.my.domain.org
authentication: :none

10.11.11.2 is my internal SMTP relay with no authentication.

If I go to Administration > Settings > Email notifications > Send a test email I always get:

An error occurred while sending mail (Connection refused - connect(2))

tcpdump doesn't show any 25/tcp attempts to 10.11.11.2.

I also tried to enable 'config.action_mailer.perform_deliveries = true' in environment.rb but it didn't help.

Thanks a lot!


Replies (5)

RE: Email notification - Added by Deoren Moor over 12 years ago

My mail configuration block:

production:
  email_delivery:
    delivery_method: :sendmail
    smtp_settings:
      address: 127.0.0.1
      port: 25

I also use a relay server (does IP checking to make sure it's from an internal system), but I also have a local Postfix mail server setup on the box. It handles the forwarding of email to the relay server on our network.

I like the idea of a local mail server as I've found it's more reliable in the long run. If the relay server is down for any reason, the mail is cached locally until the relay server comes back online.

Here is my Postfix config (main.cf):

smtpd_banner = $myhostname ESMTP $mail_name

biff = no

append_dot_mydomain = no

readme_directory = no

myhostname = host.example.com
mydomain = example.com

myorigin = $myhostname
inet_interfaces = localhost

mydestination = $myhostname, localhost.$mydomain, localhost

mynetworks_style = host

relayhost = mailrelay1.example.com

alias_maps = hash:/etc/aliases

Hope that helps.

Edit:

I forgot to mention that I'm running Ubuntu 10.10 and Redmine 1.3.0, but I've used those settings for some time now, so I'm thinking they'll still work for you.

RE: Email notification - Added by Novice Novice over 12 years ago

Thank you Deoren!

Tried with sendmail -- same issue. I don't even see 25/tcp attempts to localhost.

Could it be because of, as far as I understand, pretty old version of Redmine (0.9.3-1)?

Edit: I mean the error that I receive (Connection refused - connect(2)) is so quick and instant so I have doubts that email.yml is used at all...

RE: Email notification - Added by Deoren Moor over 12 years ago

I'm not sure, but your theory about the config file not being used sounds like a good one. I'll boot into a Ubuntu 10.04.3 (lucid) VM and try a Redmine 0.9.3-1 installation. The config file may be kept in a different place than I'm thinking.

I can't speak for your situation, but I've found that installing and maintaining a Redmine install from SVN has been very easy. I couldn't imagine waiting on distro package updates for it, especially with a LTS release.

Food for thought.

RE: Email notification - Added by Deoren Moor over 12 years ago

Alright, I did the install, but did not stumble across the default example file, but I did find mention of a Debian-specific readme file:

zcat /usr/share/doc/redmine/README.Debian.gz | more

which includes:


* MANUAL EMAIL CONFIGURATION
Email settings are not automatically configured, for a quick setup, copy
/usr/share/doc/redmine/examples/email.yml
to
/etc/redmine/<instancename>/email.yml
and edit the file.
Then change permissions and owner :
chmod 640 /etc/redmine/<instancename>/email.yml
chown root:www-data /etc/redmine/<instancename>/email.yml
then restart redmine and check if it's working by sending a test email in
Administration panel -> Settings -> Email notifications -> Send a test email
or refer to the Redmine Guide.

I didn't find any email example files

root@ubuntu:/usr/share/doc/redmine/examples# ls -l
total 28
-rw-r--r-- 1 root root  883 2010-02-20 04:38 apache2-alias.conf
-rw-r--r-- 1 root root  831 2010-02-20 04:38 apache2-host.conf
-rw-r--r-- 1 root root  444 2010-02-20 04:38 apache2-passenger.conf
-rw-r--r-- 1 root root 1071 2010-02-20 04:38 lighttpd-host-alias.conf
-rw-r--r-- 1 root root  987 2010-02-20 04:38 lighttpd-host.conf
-rw-r--r-- 1 root root 1078 2010-02-20 04:38 lighttpd-socket-alias.conf
-rw-r--r-- 1 root root  994 2010-02-20 04:38 lighttpd-socket.conf

but I did find a /etc/redmine/default directory, where presumably email.yml would go.

Hope that helps.

Even if this works for you, I recommend using the latest version of Redmine for a fresh install unless you have a good reason otherwise.

RE: Email notification - Added by Deoren Moor over 12 years ago

Oh, one last thing:

From the redmine (0.9.3-1 package changelog:

  * Update email.yml example, document in README.Debian a bug with
    delivery method async_smtp. (Closes: #570402)

This mentions an example file, but I didn't find it:

find / | grep -i 'email.yml'

I figured it would be named email.yml or email.example.yml.

    (1-5/5)