I have installed the SMTP module to enter specific authentication in order to send messages via smtp.strato.com:587 and using username/password. When I send out a test message (which is an option in the SMTP module), the message is sent succesfully. Now, when I try to notify my users through the messaging module, I get the following message:

warning: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (Connection refused)

I have checked the variable table and the variables concerning smtp are correctly pointing to the Strato settings.What am I overlooking?

CommentFileSizeAuthor
#5 Picture 2.png24.78 KBgreggles

Comments

edvanleeuwen’s picture

Temporarily solved it

1. By adding a variable fetch from SMTPAuth in messaging_phpmailer.module:

  // Uncomment the following line to get debug information printed out during mail sends
  //$mail->SMTPDebug = TRUE;
  $host = variable_get('messaging_phpmailer_smtp_server', variable_get('smtp_host', ini_get('SMTP')));

2. By filling in the fields in class.phpmailer.php.

I think the latter is not proper, but it fixes my problem for now. Could anyone comment?

greggles’s picture

Title: Messaging uses wrong SMTP server » allow use of remote SMTP server
Category: support » feature

I have this problem as well. I think it should be configurable through the admin interface to use a remote SMTP server.

jose reyero’s picture

Status: Active » Fixed

New settings form an configurable smtp server in the module.

greggles’s picture

Thanks, Jose!

When you say "New" do you mean "6.x-1.1" or "6.x-1.x-dev as of a few hours ago" ?

I'm trying the latter, but it would be nice to have this issue marked as a duplicate of the issue where you implemented this feature or linked to a commit message where the feature was added or something like that to give some context to the fix.

greggles’s picture

Title: allow use of remote SMTP server » allow use of remote SMTP server (with username and password)
Status: Fixed » Active
StatusFileSize
new24.78 KB

It seems that this allows Drupal to use a remote SMTP server, but only if that server is open to relaying from your Drupal site, right?

I'm currently using the smtp module - http://drupal.org/project/smtp - to send mail via an stmp server that uses authentication. I think it would be great if the Messaging module could just use the default Drupal mailer (which in my case would be the SMTP module).

cglusky’s picture

Just a heads up on SMTP module - If you are going to use this with Mail2Web the SMTP module modifies headers (last time we used it anyway - about 4 months ago) so maintaining integrity of email headers as it passes through different modules needs to be watched carefully.

jose reyero’s picture

@greggles,
Yes, no support yet for authentication, unless someone wants to post a patch..
The messaging_mail module uses the default Drupal mailer, it should work with smtp, though I haven't tried

@cglusky
Maybe you mean this issue, just fixed, #363001: messaging_phpmailer does not use passed headers - fails with mail2web module

Again, patches for phpmailer improvements will be welcomed. I'm just not using it for any site.

greggles’s picture

Status: Active » Fixed

Ok, then I guess we can call this fixed. Thanks for letting me know about messaging_mail.

cglusky’s picture

jose,
i would have to take a look at it again, but i still expect there might be issues with the SMTP module and Mail2Web. I would have to see what the headers look like after they pass through notifications and messaging and then get sent via SMTP Authentication module. I am sure your fix works great for this specific issue, but last i used SMTP Auth module it was modifying headers before the email was sent. mail2web also modifies headers in very specific ways to handle threading etc and i do not believe the two are currently compatible. but that is OT for this issue and probably belongs in the SMTP Auth and/or M2W queues. It's on my very long list of things to do.
R,
C

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

WeRockYourWeb.com’s picture

Working for me too now (with Messaging + Rules + SMTP + Native Drupal Mail). But only if I send the email to a non-aliased email address on my host - interesting.