Is being generated after submitting a comment to a subscribed node. The complete message is:

warning: mail(): SMTP server response: 503 must have sender and recipient first in d:\websites\profoliocom\modules\user.module on line 322.

Drupal is able to send emails to new users, lost passwords, etc. So I'm guessing that part of the configuration is OK, but for some reason I get these errors when it tries to send subscription notifications.

I'm running Drupal 4.3.1 w/ Subscriptions 4.3.0 on a Windows 2003 Server including IIS 6, PHP 4.3.

Thanks!

Radi

Comments

dziemecki’s picture

Assigned: Unassigned » dziemecki

I just downloaded and tested the latest 4.3.0 version of the module, but I couldn't duplicate it. The mailer call appears only once, is pretty simple, and has never been a problem. Is it possible that the subscribed account is missing an email address? If that's what's causing the error, I might be able to trap that.

NaSPA1’s picture

Hmm, I replied to the email generated from the last post - but since it didn't appear here, I'm posting it directly to make sure you get it...

No the subscribed accounts have email addresses in their profiles, so that shouldn't be it. :) It's 100% reproducible here using the following steps:

1) Login as account w/ administrator role (not account #1)
2) Subscribe to item
3) Add a comment to item just subscribed in #2... Following messages appear when "post" is clicked...

warning: mail(): SMTP server response: 503 must have sender and recipient first in d:\websites\profoliocom\modules\user.module on line 322.
warning: Cannot modify header information - headers already sent by (output started at d:\websites\profoliocom\includes\common.inc:63) in d:\websites\profoliocom\includes\common.inc on line 472.

4) No email is sent

Also, I noticed in my SMTP servers log that it appears to be using the default "from" address specified in php.ini as opposed to the one specified in administer > configuration.

A slightly different behavior occurs when:

1) Login as account "Gianna" (regular user)
2) Subscribe to item/thread
3) Logout
4) Login as account "Radi" (regular user)
5) Post comment to thread subscribed by Gianna in #2., following message is issued - but things appear to work:
warning: mail(): SMTP server response: 503 must have sender and recipient first in d:\websites\profoliocom\modules\user.module on line 322.

6) User "Gianna" receives email notification that the item has been updated.

Hope this helps you to track down the potential trouble spot...

Thanks!

Radi

dziemecki’s picture

Still can't dupe the error message. Is it possible you have miss-matched modules (like a HEAD users and a 4.3.X subscriptions? Do you have the very latest subscriptions (12/21/03)? This looks like it may be related to a corrupted header - the only things used to populate that variable is the "site mail" address. Is that populated? Is anyone else getting this?

Whether or not the email is sent is by design. A poster is never notified of their own post. Seems like they'd know.

NaSPA1’s picture

Makes sense that a user isn't notified of their own posts. :) As for there being a mis-match, I just double checked and I am using the 4.3.1 version of "user" and the 4.3.0 version of subscriptions (downloaded this morning). So there shouldn't be a problem there... Here's the id information from both of those modules:

user.module,v 1.245.2.3 2003/11/28 20:59:34 dries
subscriptions.module,v 1.4.2.8 2003/12/21 00:43:24 weitzman

Are you suggesting I should try to use the HEAD versions of both modules?

Radi

dziemecki’s picture

Priority: Normal » Minor

I wouldn't suggest you run the HEAD version of anything unless you're running the head version of everything. However, I'm running the same version of user and subscriptions you are, in both my dev and production environments, and I can't dupe your error. I'm afraid I'm going to have to let this bug sit until someone else can prove it isn't peculiar to your environment.

NaSPA1’s picture

OK, since we've "ruled out" the code since we're both running the same versions. Perhaps it has something to do with my SMTP server? I'm running Imail 8.0 on Windows 2003 Server. I would appreciate it if you would give it a try using my SMTP server to see if that makes the difference. Just send me an email with your IP address so I can open my server for you to test against.

Thanks for all your help!

Radi

NaSPA1’s picture

Title: warning: mail(): SMTP server response: 503 must have sender and recipient ... » Found a clue!

Hi Again! Not being one to give up easily on these kinds of things... I went and did a little digging to see if I could narrow the field a bit with this bug. Thanks to your earlier tip about user.module I added a "print" statement just before user_mail returns with "mail(" circa line 318. Here's the output I received:

using php mail ** *From: rshourbaji Message-Id: *
warning: mail(): SMTP server response: 503 must have sender and recipient first in d:\websites\profoliocom\modules\user.module on line 324.
using php mail *radi@si-star.com* *From: profolio@si-star.com Reply-to: profolio@si-star.com X-Mailer: Drupal Return-path: profolio@si-star.com Errors-to: profolio@si-star.com*
warning: Cannot modify header information - headers already sent by (output started at d:\websites

Note the two occurances of "using php mail" which is coming from the print statement that I added to print that label plus the contents of the $mail and $header variables just before returning the mail call... Anyway, it seems that for whatever reason - user_mail is getting called twice. The first time it doesn't have the right parms, and generates the warning. The 2nd call is correct and proceeds as expected with the message being delivered.

As for not being able to reproduce there, it just occurred to me that since this is coming out as a "warning" message from PHP, you might have warnings suppressed in your systems?

Radi

dziemecki’s picture

From issue opener:

> I did as you suggested and added print stmts throughout
> subscriptions which narrowed the field to the "rogue mail call" happening
> sometime after a call to subscriptions_link. But since it didn't pinpoint
> the problem, I did some more research and discovered the Drupal "Devel"
> module - which led me to the xdebug extension. After getting it added to my
> configuration, I also changed my print stmts in user_mail to include a call
> to xdebug_call_function(), which revealed the true culprit!
>
> As it turns out, I had installed but not fully configured the
> "ListHandler" module (it was activated but that is all) and the revised
> print statement showed that the rogue call was coming from it and not from
> "Subscriptions". Though for whatever reason, ListHandler did not generate
> the rogue calls when Subscriptions was not active.