Content
email setup without authentication
Added by Tamas Csabina over 10 years ago
Hi,
Is it possible to configure the email-engine not authenticate at all?
I have an internal smtp server that is configured to alloy relaying. I want to use this smtp server to send emails.
My configuration.yml looks like:
@
default:
email_delivery_method: :smtp
smtp_address: smtp.company
smtp_port: 25
@
I haven’t added the smtp_authentication:
entry, as I don’t need one.
But the emails are not being delivered.
My questions:
- is it possible at all not to use an smtp-auth?
- how can I troubleshoot the email delivery (logfiles, trace, etc)? Is the config ok? Is the smtp server being reached? Is the smtp server refuses to deliver? Is the config+smtp_server is fine, and there are issues somewhere else?
Thanks in advance for any tips.
Tamas
Replies (5)
Hi Tamas,
first, you should post things like this in the forum for “installation” topics.
Yes. I am not the expert on this, but in our environment we also use an internal SMTP server without authentication and without encryption.
Our settings in configuration.yml are like this:
Everything else (smtp_authentication=, smtp_user_name=,..etc.) is not necessary, we disabled these by adding # at the beginning of the line.
That looks more or less similar to your configuration, but, it seems to me, that you did not use the right format. In .yml it is very important to keep the indenting! Only “default:” must be without indenting, everything beneath belonging to “default:” must be indented.
For instance, if you just edit a user and change its password, by default an email is generated.
You did not provide us with information about your environment. In Debian or Ubuntu environments you can see all what happened in the openproject’s log directory - there are different logfiles for each environment.
Hope that helps, regards
Christoph
Hi Christoph,
Thank you for your reply. I made some progress.
The .yml file’s indent was okay, but when I quoted it, that extra 2 spaces got lost.
I’ve modified the syntax a bit, based on your reply:
And with this, some emails are being delivered, some emails are not:
Whenever the admin is changing a password for example, an email is being delivered to the user.
Whenever a user makes a modification on a work package, there is no email is being sent, and this is what I see in the logs:
@
Sent mail to tamas@mycompany.com (25.8ms)
2014-04-04T08:45:24+0200: [Worker(delayed_job host:openproject pid:13049)] Class#work_package_updated failed with Net::SMTPSyntaxError: 501 Syntax: HELO hostname
- 2 failed attempts
@
This error (501 Syntax: HELO hostname) is coming from the smtp server. Whenever I make a telnet session on port 25 to the smtp server, and type “HELO”, this is the reply I got. If I use “helo myhost”, I got a proper reply, so I guess I’ve missed some host related configuration during OpenProject setup.
Will dive into this…
Finally made this work.
As the password change task was generating an email, and the work package update was not generating it, I took a closer look on the differences.
The work package update email is being sent in a delayed_job. But the delayed_job queue was not properly update after I have modified the .yml file (I guess). Even apache restart hadn’t involved the queue cleanup, so I had to do it manually:
Stopped the queue with:
@
RAILS_ENV=production bundle exec script/delayed_job stop
@
Followed by:
@
RAILS_ENV=production bundle exec script/delayed_job start
@
to start the queue again.
After this email delivery for work package updates are working fine.
I hope this helps out someone…
Tamas Csabina wrote:
I’m having the same issue. I went through the reconfiguration wizard to setup SMTP but there was not option for no authentication.
Test emails return “An error occurred while sending mail (SMTP-AUTH requested but missing user name)”
Here is my configuration.yml
Hi Andrew,
Sorry Andrew, but I cannot really help, as at the end it was all working fine for us (no auth required).
What might be the problem for you is that int the configuration.yml file there are multiple entries about the smtp auth. Maybe you have edited the beginning of the file but a the end of the file there is still an old value overwriting your changes? I am just guessing.
Maybe post the complete .yml file, but as I said, at the end we have no issues to run the smtp stuff without authentication.
Regards,
Tamas