Ticket #4854 (closed Bug: fixed)
E-mail pages to others broken
| Reported by: | Anonymous User | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.1.2 |
| Component: | Infrastructure | Keywords: | |
| Cc: |
Description (last modified by hannosch) (diff)
When E-mailing a page to someone, the submission fails with an "informational" messages:
"Unable to send mail: Invalid email address: None"
I see two problems:
Looking at SecureMailHost.py, lines 208-210:
result = self.validateSingleEmailAddress(mfrom)
if not result:
raise MailHostError, 'Invalid email address: %s' % addr
It appears that the code is validating "mfrom", but reports the value of "addr", when the validation fails. "addr", at the moment, is type None, so the "%" operator reports the email address that failed as "None".
Correcting this problem:
result = self.validateSingleEmailAddress(mfrom)
if not result:
raise MailHostError, 'Invalid email address: %s' % mfrom
The error message reported now becomes:
"Unable to send mail: Invalid email address: postmaster@localhost"
The address I specified for a from address was my own. However, when I monitored validateSingleEmailAddress, it appeared that it was being called twice: once for my address, which passed, and once for postmaster@localhost. It appears that postmaster@localhost is failing the EMAIL_RE regular expression defined at line 46 in the same source file. I believe the RE is only passing fully qualified E-mail addresses, but postmaster@localhost is coming from constant in the code somewhere.
All of this is IMHO. I'm new to python, so I may have it wrong. I'm not trying to play in someone else's sandbox: I just don't want someone else to have to spend the time I did tracking it down.
(Ignoring the value returned by the RE works around the problem, but allows all kinds of strange addresses to be passed to sendmail.)
Thanks, Chip Bennett Laurus Technologies, Inc.
Change History
comment:2 Changed 6 years ago by Anonymous User
Ahhh... the return-path can be set by the Plone admin from portal settings. I missed that one. Thanks!
(As far as I'm concerned, the only bug, at this point, was the incorrect error message, which has apparently been fixed, so I'll leave it up to others whether this issue should remain open.)
Chip Bennett
comment:3 Changed 6 years ago by hannosch
- Component changed from Infrastructure to Mail
- Description modified (diff)
comment:4 Changed 6 years ago by hannosch
- Status changed from new to closed
- Resolution set to fixed
The error message isn't great but this special problem doesn't justify any special validator. If you want to send mail from your portal, you really should visit the mail config dialog in the control panel and there you see the 'postmaster@localhost' which you obviously should change to a meaningful value.

i've committed the simple output bug fix to the SecureMailHost trunk. the reason why the mail form is failing, though, is because the "email_from_address" property, visible by clicking on the 'properties' tab of the plone site root in the ZMI, is still set to the default address of 'postmaster@localhost'. this address is used as the 'return-path' address for the message envelope.
the error message is not very helpful, however, so i'm leaving this issue open until this is handled in a better manner.