Problems setting up email notifications

Added by Andre Lopes over 8 years ago

Hi all,

I'm trying to configure redmine to send email notifications through a MS Exchange Server. I've followed the instructions in the HowTo(http://www.redmine.org/wiki/redmine/HowTo_configure_Redmine_to_mail_to_MS_Exchange_server) but when running the send email test...

An error occurred while sending mail (530 5.7.1 Client was not authenticated )

Searching for an answer i've think i've found that the server does not support SMTP AUTH LOGIN, is just supports AUTH NTLM

andre@redmine-tst:~/redmine$ telnet myserver 25
Trying myserver_ip...
Connected to myserver.
Escape character is '^]'.
220 myserver Microsoft ESMTP MAIL Service ready at Tue, 24 Mar 2009 18:12:18 +0000
ehlo
250-myserver Hello [myserver_ip]
250-SIZE
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH NTLM
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-XEXCH50
250 XRDST
auth login
504 5.7.4 Unrecognized authentication type

please correct me if i am wrong.

So what configuration do i need to use in my email.yml file? The current one is:

production:
  delivery_method: :smtp
  smtp_settings:
    address: myserver
    port: 25
#    domain: mydomain
#    authentication: login
#    user_name: user
#    password: pass

development:
  delivery_method: :smtp
  smtp_settings:
    address: 127.0.0.1
    port: 25
    domain: example.net
    authentication: :login
    user_name: redmine@example.net
    password: redmine

My system settings are:

About your application's environment
Ruby version              1.8.7 (i486-linux)
RubyGems version          1.2.0
Rails version             2.1.2
Active Record version     2.1.2
Action Pack version       2.1.2
Active Resource version   2.1.2
Action Mailer version     2.1.2
Active Support version    2.1.2
Application root          /home/andre/redmine
Environment               development
Database adapter          mysql

and i am starting the server with

ruby script/server webrick -e production &> ~/redmine/log/run.log &

So i think that i am configuring the email to the right environment.

Many thanks
AL

Replies (7)

RE: Problems setting up email notifications - Added by Azamat Hackimov over 8 years ago

You tried launch Redmine in production mode, but production section commented off, so Redmine trying send mail to Exchange as relay. You need change email.yml:

production:
  delivery_method: :smtp
  smtp_settings:
    address: <IP-addr-of-exchange>
    port: 25
    domain: <your-domain>
    authentication: login
    user_name: <your-username>
    password: <your-password>

RE: Problems setting up email notifications - Added by Andre Lopes over 8 years ago

Hi Azamat,

I've changed the email.yml file just as you said, but now Redmine is complaining about other stuff that i can't understand what is it, probably some bad configuration...

An error occurred while sending mail (wrong number of arguments (3 for 2))

RE: Problems setting up email notifications - Added by Nikki Erwin Ramirez over 8 years ago

I also encountered the following error:

An error occurred while sending mail (wrong number of arguments (3 for 2))

This post helped me fix it: http://www.redmine.org/boards/2/topics/4833#message-5189

RE: Problems setting up email notifications - Added by Sam Chen almost 6 years ago

A quick fix of this problem is made as folowing. Hope it's useful for u.

1. copy ntlm.rb to /usr/lib/ruby/1.8/net/
2. update smtp.rb to /usr/lib/ruby/1.8/net/
3. modify /etc/redmine/default/email.yml

production:
  delivery_method: :smtp
  smtp_settings:
    address: <server ip>
    port: 25
    domain: <domain name>
    authentication: :ntlm
    user_name: "domain\\user_id" 
    password: "password" 

--
Sam

ntlm.rb Magnifier (20 KB)

smtp.rb Magnifier (28.8 KB)

RE: Problems setting up email notifications - Added by Sutruk Oshi about 5 years ago

Hello Sam,
Thank you very much for your quick fix,I have tried it, but still appears the message "(hostname does not match the server certificate)".
I'm using Ruby 1.9.1. Any idea where I can look for problems?

RE: Problems setting up email notifications - Added by Konstantin Strelkov about 5 years ago

Hello, Sutruk Oshi 

You need avoid certificate validation.

 smtp_settings:
   openssl_verify_mode: none

Who use Ruby 1.9.1, Please see attachments. there are files for this version.

ntlm.rb Magnifier (20.8 KB)

smtp.rb Magnifier (31.5 KB)

(1-7/7)