Split PHPMailer and SMTP classes from smtp.module

jsm174 - February 21, 2008 - 13:51
Project:SMTP Authentication Support
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

Hello.

I was just looking over some proposed From values patches at http://drupal.org/node/224601?mode=2&sort=2

The proposed patch was a diff that contained all the lines from both the original and updated file. Since the PHPMailer and SMTP classes are both included inside smtp.module, it was a lot of code to look through -- not the end of the world, but you know what I mean.

Anyway, this proposed patched splits out PHPMailer and the SMTP classes into phpmailer.inc. This file will get included only once in the drupal_mail_wrapper() method.

There are no other changes in this patch from dev. It's just to help out with maintainability.

-- Jason

AttachmentSize
smtp_split.patch170.01 KB

#1

Wim Leers - February 26, 2008 - 19:33

Big +1 from me.

Subscribing.

#2

open-keywords - February 27, 2008 - 07:44

Well, IMHO, since this branch of the PHPMailer classes has been stable for a few years, I don't see the need for a change.
And since the integration isn't exactly trivial, the PHPMailer's source can't be interchanged on the fly (having separate files could lead think it is the case)

#3

Wim Leers - February 27, 2008 - 10:07

Huh? We're only asking to move that huge class into a separate file, that's all…

#4

jsm174 - February 27, 2008 - 13:23

open-keywords,

I'm sorry, but I have to disagree. The purpose of splitting isn't so it would be easier to maintain the PHPMailer portion of the code. The PHPMailer and SMTP classes shouldn't really be changed anyway unless there is a bug or an update to those classes.

However, IMHO, I would think Drupal modules should be small and compact. Everytime the SMTP module is loaded, no matter what, it has to parse the PHPMailer and SMTP classes. With the patch provided, you get two benefits. 1) a smaller, more maintainable Drupal module and 2) two very large PHP classes that are only pulled in at the time of sending an email.

If it's a question of getting a patch applied, I would be more than willing to learn the Drupal patch procedure. It's something I have wanted to do for quite some time.

-- Jason

#5

oadaeh - February 27, 2008 - 14:44
Status:active» needs work

I will do this, but I want to have the patch(es) from http://drupal.org/node/224601 included first. Then I'll do a code clean up. Don't worry about submitting a corrected patch (based on http://drupal.org/patch/create), as it's a straightforward change.

#6

oadaeh - June 17, 2008 - 05:54

Upon further investigation into this issue, and based on http://drupal.org/node/66113, I've decide to totally delete the two classes from the module and have people download the PHPMailer package from http://phpmailer.codeworxtech.com/ instead.

My preliminary tests have shown that it will work, but I'm going to do a bit more testing before I make the change.

#7

smk-ka - July 14, 2008 - 15:21

Is this (and other changes) still going to be backported to D5? The D5 and D6 branches are quite out of sync, that's why I'm asking.

#8

oadaeh - July 17, 2008 - 13:47

@smk-ka: yes, my plan is to back port most of the changes (not all of them are compatible) done in the 6.x branch. I'm waiting until I feel I have a fairly stable, bug-free release, however, so that I'm not back-porting the bugs as well.

#9

Wim Leers - November 3, 2009 - 16:12
Status:needs work» won't fix

The Drupal 5 version of this module is no longer maintained.

 
 

Drupal is a registered trademark of Dries Buytaert.