As far as I can understand, SMTP module provides a full MailSystemInterface implementation, which lets use SMTP module as a standalone mail solution. However, it would be nice to code this in a way it could be integrated with another modules, such as mimemail, which handles HTML, themeing, images and all other stuff.

I really don't know if this is possible, at some extent. If it's not, mimemail should go for it's own smtp implementation, but I dislike that solution.

Issues related:
#1088914: The Mime Mail module should use the Mail System module
#1110876: D7 Status?
#1112872: Must send through an SMTP server, any options for HTML mails?
#1124252: The SMTP module should use or support the Mail System module
#1179792: Integrate with other mail modules

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yettyn’s picture

I fully agree with you! As a co-maintainer I have had zero time lately to work on the module though but as my ordinary life work schedule eases up these are the things I would like to look at and probabbly work together with devs of concerned modules as most likely changes are needed there too.

pillarsdotnet’s picture

wundo’s picture

Sorry, but as I told you in #1124252, IMHO adding another dependency is not way to go. I see you're the maintainer for Mail System module, but pushing other modules to use your API this way doesn't look nice.

pillarsdotnet’s picture

jorge.suarez’s picture

Please be nice, people! We're all trying to help here.

Wundo, you told pillarsdotnet on #1124252 that pushing dependencies is not way to go and asked the benefits, then pillarsdotnet told you and the conversation ended. I suppose that pillarsdotnet didn't convince you? Why? It would be nice to tell us.

I'm not an expert so maybe this is not possible, but isn't there any way to add this as a recommendation rather than a dependency? Check for Mail System module presence and use it accordingly, just if present.

I think you're right when you say that adding dependencies is not very nice, but Mime Mail already depends on Mail System and this solves the integration problem.

pillarsdotnet’s picture

In 7.x Mail System could be a recommendation rather than a dependency, but any module that did so would become larger and more complicated, rather than shorter and simpler. So there is no benefit.

In 6.x, both Mail System and SMTP Authentication Support set the smtp_library variable and define drupal_mail_wrapper(). Only one module can do that, so SMTP Authentication Support 6.x is incompatible with Mail System and also with any other 6..x module that sets smtp_library and defines drupal_mail_wrapper().

Since only one module can define drupal_mail_wrapper(), I think it should be a module designed to cooperate with other mail-sending modules, rather than one designed to exclude other mail-sending modules.

wundo’s picture

Hi Jorge,
I'm beeing nice.
Quoting what I said in the other isse (#1124252: The SMTP module should use or support the Mail System module) was:

"Sorry but I don't see any reason to why SMTP should depend on MailSystem, please explain here what would be the benefits of this dependence."

After that he started to flame (see #4).

wundo’s picture

#6:
Please behave, you have no reason to assume that I "think that cooperation is a bad thing and therefore disagree", all I did was just ask for more info about what would be the benefits from that integration, that is a simple innocent question.

Your last two comments on this thread weren't nice at all, I don't see the reason you got so mad.

Also if you are talking about me please address me directly.

josesanmartin’s picture

I don't think it's good to add dependencies unless there's a strong rationale for that. It makes it harder for users to install and, most important of all, update this module. We should keep in mind the philosophy "if it's working, don't fix it", for 6.x version at least. Mimemail works great with SMTP.

That said, we are all open to discussion, if you (pillarsdotnet) make a strong case for mailsystem. For instance, why should SMTP be a dependency of MailSystem, instead of MailSystem implementing the SMTP integration, the same way Views does with node.module? How does it make our users' life easier?

pillarsdotnet’s picture

Status: Active » Closed (won't fix)

I would rather add a dependency; others would rather duplicate the same code in different modules. Apparently we cannot agree on this.

I really do wish Wundo, and other module authors like him, all the best.

It saddens me somewhat that, after breaking up my module into several pieces so that they would be useful on their own, and after taking
several hours of my time to compose patches to show other module authors how we can work together instead of in competition, my efforts appear to have been wasted.

Perhaps if I were more diplomatic and tactful that would not be the case, but I am who I am.

yettyn’s picture

Priority: Normal » Major
Status: Closed (won't fix) » Active

Please folks, don't let emotions cloud your judgement, and please don't close an issue "won't fix" unless you are maintainer of the module, and don't close someone else issue unless you are maintainer, have a fix commited or it has become irrelevant due to age etc.

Hence, I'm reopening this as it's highly relevant and it's also related to #1124252: The SMTP module should use or support the Mail System module even if I'm not sure what's the correct solution. I think pillar is on the right track although, and I say this without having looked through all code yet, my intuition tells me that Mailsystem (or part of) and SMTP belongs together somehow. But this also needs to be looked at in view of D8 as this is really a "core issues" in my opinion.

But again, and it's the 3rd issue I state this in now, I don't have time to work on this right now so unless someone else is willing to pick it up, it has to wait. Not too long though as even if not critical I think it's major.

pluess’s picture

As many others, I'd like to have several mail sending/formatting modules at the same time. For me it's mimemail, maillog and smpt. Currently this is not possible using the mail_sytem variable. As far as I understand this problem is not solved by using the http://drupal.org/project/mailsystem module.

For this reason I've written a new module called mailwire (http://drupal.org/sandbox/pluess/1179376). It provides two hooks hook_mailwire_sender() and hook_mailwire_formatter(). Using this hooks any mail formatting/sending module can register any number of formatters and senders. Everytime drupal_mail is called the formatters and senders are called depending on module, key and weight settings.

I've written patches for mimemail, maillog and smtp to integrate with mailwire.
See: #1179792: Integrate with other mail modules and http://drupal.org/sandbox/pluess/1179696

I Hope this is pushing the integration of all the nice mail sending and formatting modules ahead!

The Patch is done via "git format-patch"
If the patch is applyed, can you please use:
git am --signoff --ignore-whitespace < integrate_with_mailwire-1125778-12.patch
this should keep the commiter for my account :-).

pillarsdotnet’s picture

@#12 -- Actually, mailsystem *does* provide this facility, but by using the mail_system variable instead of by registering new hooks.

But if you come up with an improved strategy, and convince module authors to adopt your strategy instead of their own, I'll mark Mail system deprecated and support your module, instead.

pluess’s picture

Could you please explain how the mailsystem module can do that?

If I look at the D7 core code in mail.inc this seams to be impossible. drupal_mail_system can return only one MailSystemInterface implementation and drupal_mail calls only this one.

In order to integrate several mail formatting / sending modules we need a solution which can invoke any number of formatting/sending implementation in a configurable order.

IMHO: This is only possible by implementing a mailsystem which does that. Mail formatting/sending modules are not mailsystems but just different ways of formatting and/or sending emails. They should not touch the mail_system variable at all.

pillarsdotnet’s picture

pluess’s picture

I'm happy to see that there's something going on for D8, however we need a solution for D7 (as you can see from the version property) as the D7 core solution isn't enough.

BTW: mailwire is doing what has been proposed in #6.

pillarsdotnet’s picture

Mail System is also doing what was proposed in #6, and is available right now for d6, d7, and d8. The proposed patch (which must be against d8 first, then d7 and d6 if backported) just makes it easier and cleaner for Mail System to do its job.

pluess’s picture

Could you please explain this in detail? I cannot find any documentation or code in the mailsystem module which allows for a number of mail modules to be called in a chain. I would be more than happy to use the mailsystem module if it can do this!

Feel free to contact me on skype or irc so we can take the time to sort this out and then come back with a god solution. Maybe it's just a matter of documentation?

pillarsdotnet’s picture

Druplicon says:

[12:12] <pillarsdotnet> seen pluess?
[12:12] <Druplicon> pluess was last seen in #drupal-gitsupport 1 month 1 week ago saying 'git diff origin/6.x-1.x works, thanks a lot!'.

I guess your module does provide an orthogonal service. Mail System promotes co-existence of separate mail modules, where each one handles a specific module/key/method. Yours, I take it, allows multiple separate modules to format and send the same message.

I think the efforts should be combined, though. I'd also like to add the following features:

  • Keep track of mail domains which enforce a maximum size limit on their incoming emails.
  • Split and/or summarize long messages to meet per-domain size constraints.
  • Combine small messages into periodic batch mailings, on a per-user opt-in basis.
pillarsdotnet’s picture

pillarsdotnet’s picture

I have a patch and a working implementation to allow multiple mailsystems such as HTML Mail and SMTP to cooperate and co-exist.

The Mailwire module has some good ideas, but also many problems.

donSchoe’s picture

Issue summary: View changes

updated related issues

DamienMcKenna’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: -SMTP Authentication, -Features integration

Please don't forget to set the issue status to "needs review" when you upload a patch.

Status: Needs review » Needs work

The last submitted patch, 12: integrate_with_mailwire-1125778-12.patch, failed testing.

The last submitted patch, 12: integrate_with_mailwire-1125778-12.patch, failed testing.

DamienMcKenna’s picture

Title: Integration with another mail modules » Integration with Mailwire
Priority: Major » Normal

The patch should also make Mailwire optional, there's no reason to require it.

wundo’s picture

Status: Needs work » Closed (outdated)

Closing very old (dead) issues, if you think this is still relevant please re-open.