Project

General

Profile

Sending email - getaddrinfo: Name or service not known

Added by Gary Pickrell over 15 years ago

When I click on 'Send a test email' I get the following message in Redmine

An error occurred while sending mail (getaddrinfo: Name or service not known)

I'm running Ubuntu and have been able to get Bugzilla to send email via postfix. I don't know if this is a ruby issue or a Ubuntu one. My research has come up empty. Ideas?


Replies (15)

RE: Sending email - getaddrinfo: Name or service not known - Added by Anonymous almost 15 years ago

Gary Pickrell wrote:

When I click on 'Send a test email' I get the following message in Redmine

[...]

I'm running Ubuntu and have been able to get Bugzilla to send email via postfix. I don't know if this is a ruby issue or a Ubuntu one. My research has come up empty. Ideas?

I had a similar problem that turned out to be caused by /etc/resolv.conf not being readable by all users (and the Redmine server was being run as a non-priviliged user www-data). This is how I fixed it:

chmod o+r /etc/resolv.conf

You may also want to check that /etc/hosts is readable by all users as well:

chmod o+r /etc/hosts

If you do any debugging from the command-line, such as running the sendmail command, make sure you run it as the user that owns the Redmine server process.

RE: Sending email - getaddrinfo: Name or service not known - Added by Gary Pickrell almost 15 years ago

Thanks! That did help. It wasn't the permissions but I had a wrong entry.

-Gary

RE: Sending email - getaddrinfo: Name or service not known - Added by Finees Mendez over 14 years ago

Gary Pickrell wrote:

When I click on 'Send a test email' I get the following message in Redmine

[...]

I'm running Ubuntu and have been able to get Bugzilla to send email via postfix. I don't know if this is a ruby issue or a Ubuntu one. My research has come up empty. Ideas?

Hi,

I am having the same problem! I can't tell if my email.yml settings are set properly. Do I need to require :login for SMTP always? Also, do I need to create a seperate email account solely for Redmine to send out emails via SMTP?

Thank you.

RE: Sending email - getaddrinfo: Name or service not known - Added by Tom von Drudel over 14 years ago

Gary,

No you only need "login" if it is required by the SMTP server you are using. If it is not required, you can use "none".
No, you don't need a separate email account. However, it may be practical to create a new account but that is another issue :-)

Regards, Tom

RE: Sending email - getaddrinfo: Name or service not known - Added by chris cauley over 14 years ago

Gary Pickrell wrote:

Thanks! That did help. It wasn't the permissions but I had a wrong entry.

-Gary

It would have been awesome if you had said what that entry was :-p Here is my email.yml (verbatim). I'm using a SMTP server with no log in so I decided to use the topmost example in email.yml.example provided by Redmine.

production:
  delivery_method: :smtp
  smtp_settings:
    address: 10.0.10.20
    port: 25

Unfortunately, production.log shows no sign of an error, but the webpage returns the error above. Any thoughts? Thank you in advance.

-Chris

RE: Sending email - getaddrinfo: Name or service not known - Added by Gary Pickrell over 14 years ago

Chris,

Here is what my successful configuration looks like:

production
delivery_mthod: :smtp
smtp_settings:
address: localhost
port: 25
domain: garypickrell.com

I have the email server I'm using on localhost. I probably could configure it to directly use my ISPs server also.

RE: Sending email - getaddrinfo: Name or service not known - Added by chris cauley over 14 years ago

I was missing the domain. It's working now. Thank you for the speedy reply.

RE: Sending email - getaddrinfo: Name or service not known - Added by Eduardo Rodríguez Castillo over 13 years ago

Hi, I was having same issue there:

Mi configuration properties looks like:

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: "localhost" 
      port: 25
      domain: "mydomain.com" 

My SMTP works without autentication. Then to correct this I must comment default properties (on configuration.yml):

default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: localhost
      port: 25
      domain: 'mydomain.com'
  # COMMENT THIS ->    authentication: :login
  # COMMENT THIS ->   user_name: "redmine@example.net" 
  # COMMENT THIS ->   password: "redmine" 

Hope this will help you

RE: Sending email - getaddrinfo: Name or service not known - Added by Bruno Medeiros about 13 years ago

I got this bug and fixed putting the email_delivery for production below the production that already exists in the file. If you uncommented one of the existing production blocks in the beginning of file, they will be ignored and the default configuration will be used.

RE: Sending email - getaddrinfo: Name or service not known - Added by Thomas Nichols almost 13 years ago

Removing an extraneous 'production' section is what it needed for me, together with tweaking /etc/hosts and /etc/hostname so that
$ hostname
giblet
$ hostname -f
giblet.highly.improbable.com

-- Thomas

RE: Sending email - getaddrinfo: Name or service not known - Added by Jasmina Dževlan over 10 years ago

Anonymous wrote:

Gary Pickrell wrote:

When I click on 'Send a test email' I get the following message in Redmine

[...]

I'm running Ubuntu and have been able to get Bugzilla to send email via postfix. I don't know if this is a ruby issue or a Ubuntu one. My research has come up empty. Ideas?

I had a similar problem that turned out to be caused by /etc/resolv.conf not being readable by all users (and the Redmine server was being run as a non-priviliged user www-data). This is how I fixed it:

chmod o+r /etc/resolv.conf

You may also want to check that /etc/hosts is readable by all users as well:

chmod o+r /etc/hosts

If you do any debugging from the command-line, such as running the sendmail command, make sure you run it as the user that owns the Redmine server process.

hi .... This didn't work for me, can what else might be the cause of this problem , please HELP I have just started to use redmine :(

RE: Sending email - getaddrinfo: Name or service not known - Added by Jean-Baptiste Barth over 10 years ago

If you have this exact message, it's a sure sign your redmine instance cannot lookup the DNS name you gave it. You may want to test out nslookup <the-server> in the same conditions as the redmine process (same user, security options, etc.)

RE: Sending email - getaddrinfo: Name or service not known - Added by Jasmina Dževlan over 10 years ago

as reply I got ";; connection timed out; no servers could be reach " ..... you where right that is a problem how can I fix that ? I gotta do this as my final project at school ,so I really need a lot of help ... :( thank you

RE: Sending email - getaddrinfo: Name or service not known - Added by Jean-Baptiste Barth over 10 years ago

You have to configure a DNS server. If you're on Linux it's usually in "/etc/resolv.conf", you can put there "nameserver 8.8.8.8" (google public name servers). If you're in a school/enterprise network I think you should find help from an IT administrator...

    (1-15/15)