An error occurred while sending mail (Connection refused - connect(2) for "localhost" port 25)

Added by Sajjad Ahmed about 1 month ago

Hello,

When I try to send test email, I am getting the red box error.

An error occurred while sending mail (Connection refused - connect(2) for "localhost" port 25)

Below is my configuration.yml

production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: 89.19.*.***
port: 587
authentication: :login
domain: *.com.tr
user_name: mailer@
.com.tr
password: *
***

the productin.log shows some IP address, which is not of the redmine server or anything. Any help would be appreciated, as I am struck with this for 2 days.

Rendered layouts/base.html.erb (11.7ms)
Completed 200 OK in 334ms (Views: 206.9ms | ActiveRecord: 115.8ms)
Started POST "/redmine/admin/test_email" for 192.168.1.5 at 2021-10-13 07:42:20 +0000
Processing by AdminController#test_email as HTML
Parameters: {"authenticity_token"=>"OcO3EG16LqjnaSKmcLUGDx7Vy+lDNSGMH2yI/t3q0o25Db2KYcaokojZVM7bWIbgIbSsGAoeg35mrcBn1qdnuA=="}
Current user: admin (id=1)
Rendering mailer/test_email.text.erb within layouts/mailer
Rendered mailer/test_email.text.erb within layouts/mailer (0.6ms)
Rendering mailer/test_email.html.erb within layouts/mailer
Rendered mailer/test_email.html.erb within layouts/mailer (3.2ms)

Sent email "Redmine test" (5ms)
bcc:
Redirected to http://192.168.1.**/redmine/settings?tab=notifications
Completed 302 Found in 94ms (ActiveRecord: 53.9ms)
Started GET "/redmine/settings?tab=notifications" for 192.168.1.5 at 2021-10-13 07:42:20 +0000
Processing by SettingsController#index as HTML
Parameters: {"tab"=>"notifications"}
Current user: admin (id=1)

The below IP address, where is this being picked up. I have not given this or not part of this installation.

Started POST "/redmine/admin/test_email" for 192.168.1.5 at 2021-10-13 07:42:20 +000
Started GET "/redmine/settings?tab=notifications" for 192.168.1.5 at 2021-10-13 07:42:20 +0000

Thanks in advance.

Replies (1)

RE: An error occurred while sending mail (Connection refused - connect(2) for "localhost" port 25) - Added by Laszlo Toth 17 days ago

Hi, same (or similar) problem here...
Did you manage to solve your problem?
I have a remote smtp server in my configuration.yml, but (according to the test email error message) the server still wants to connect to the local smtp server: "An error occurred while sending mail (Connection refused - connect(2) for "localhost" port 25)". Why?

(1-1/1)