When trying out the smtp module I found two bugs which prevented mails from being accepted by our server:
- The
Fromwas missing in the header - Some header entries occurred double e.g.:
Content-Type
So our server rejected these mails, which is absolutely correct, since such mail is invalid.
To fix these issued I introduced a from address field into the settings form. Sure, you can set the smtp_from elsewhere; however it is highly desirable to have it also in the settings of the very module. Furthermore I fixed the multiple header problem in drupal_mail_wrapper()
Currently we are doing some maintenance on our SVN server so I rather submit a link to fixed module in a zip file, but to publish the link to the repository: http://wp5.e-taxonomy.eu/download/smtp_fixed_2007-07-05.zip
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | smtp.from_.field_.added_.headers.fixed_.devel_.debug_.added_.patch | 3.72 KB | dragonwize |
Comments
Comment #1
dragonwize commentedI looked over and tested the changes in your file and it works great. I've made a cvs patch for the changes.
Changes:
1. Added a From Field option to the config page. The address will be used if the from field is empty when the system is going to send.
2. Several header modifications to ensure headers are correct.
3. Added a development debug option on line 246.
@Andreas: The only change I didn't include in the patch is below because I was not sure exactly what it was doing.
if($this->do_debug >= 2) {
echo "sending line:" . $line_out . $this->CRLF;
}
Disclaimer: All work in this patch was done by Andreas Kohlbecker. I only reviewed, copied, tested, and created a cvs patch for the code.
Thanks Andreas.
Comment #2
ryan_courtnage commentedI just applied this patch and it works great. It fixed a problem for me where sending email would fail with (in watchdog):
Comment #3
oadaeh commentedThe headers fix has been committed here: http://drupal.org/cvs?commit=90617
I did not include all the extra header checks, just the main one. I can add the extra ones if still necessary when I get done with everything else I'm trying to accomplish.
Comment #4
oadaeh commentedCommitted the admin from field here: http://drupal.org/cvs?commit=90660
The rest of the headers have been committed here: http://drupal.org/cvs?commit=90661
Comment #5
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.