Hello,
i've got a problem and can't figure out how to solve it. I'm not sure whether it is a bug or if I did something wrong with the configuration. So I file this support request here.
I use Views Send to send E-Mails to selected users from a view. This is working very well.
The problem is that I don't want to use the mailserver on localhost but a specified SMTP server.
I use the SMTP module to set up a connection to the desired SMTP server and use the Mailsystem module to define the system-wide mailsystem as "SMTP module" and tell Views Send and MIME Mail to use the SMTP module aswell.
But Views Send is still sending mails using the machine on localhost.
How to use Views Send to send mails to a specified SMTP server?
Cheers
donSchoe
Comment | File | Size | Author |
---|---|---|---|
#7 | mailsystem-integration-2023977-7.patch | 870 bytes | hansfn |
#4 | mailsystem-integration-2023977.patch | 1.72 KB | donSchoe |
Comments
Comment #1
donSchoe CreditAttribution: donSchoe commentedOkay, after some playing round with the three mentioned modules I've found out that setting the Views Send default mailing system using the Mailsystem module gets reset after each Cron run to MIME Mail.
Custom mailsystem filters like MimeMailSystem_SmtpMailSystem will be overriden and it's impossible to send mails via SMTP module.
Is there a way to fix this that Views Send works together with the Mailsystem/SMTP modules?
Comment #2
hansfn CreditAttribution: hansfn commentedThx for your report.
I haven't really touched this part of the code after I took over this module - I normally send plain text email ;-) Anyway, it's a fact that this module is/was very MIME Mail centric.
The overriding happens in the function views_send_deliver in views_send.module. (It's not cron specific.) I wonder if the call to "mailsystem_set" is really needed? Please test and provide a patch if you have general solution. I haven't time right now to look more at this.
Comment #3
donSchoe CreditAttribution: donSchoe commentedI just found the snipped of code, too.
I'll try to find a solution and keep you up to date.
Comment #4
donSchoe CreditAttribution: donSchoe commentedThis patch does the trick for me. It does not call
mailsystem_set()
directly anymore.I created a wrapper function
_views_send_mailsystem_set()
which checks for the availability of the mailsystem module and if it exists, uses the mailsystem settings instead of the default Views Send settings.If no mailsystem module is available, nothing changes.
Please, review this patch. Thanks!
Comment #5
pipep CreditAttribution: pipep commentedThanks donSchoe your patch did the trick for me !
Comment #6
donSchoe CreditAttribution: donSchoe commentedComment #7
hansfn CreditAttribution: hansfn commentedThe patch has numerous issues because:
So, to be specific:
I have attached a minimal patch that does correctly what you intended. However, I wonder if the best fix is to just use the default mailsystem - remove the call to mailsystem_set?
Comment #8
donSchoe CreditAttribution: donSchoe commentedOk, that's some usefull hints.
format()
module._views_send_mailsystem_set()
from another location in future, I will not know if the check is included, but yeah, your approach looks much smarter.I will test the patch later. On first glance it looks pretty good as it adresses the problem with overriding user sittings in mailsystem with the
mailsystem_get()
function.Comment #9
donSchoe CreditAttribution: donSchoe commentedPatche applied cleanly on 7.x branch.
Tested & confirmed: The module now works as desired, no settings in mailsystem wont be overridden and sending mails through SMTP module is now possible.
Nice patch! :)
Comment #10
hansfn CreditAttribution: hansfn commentedThx for testing.
I'm leaving on holiday tomorrow, but if I have some spare time (with Wifi) I'll commit it before I'm back. If not, I'll do it the 15th of July.
Comment #11
hansfn CreditAttribution: hansfn commentedFixed in commit a2fdd46.
Comment #12
donSchoe CreditAttribution: donSchoe commentedthanks hansfn :)
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedIt looks like this fix was never pushed to a "recommended release". Fyi, I am using 7.x-1.0-rc3.
As background, I use a combination of Mail System and SwiftMailer, and my Views Send mails are bitten by the problem reported here.
Does anyone know if there is a suitable patch for this to 7.x-1.0-rc3?
Also, is 7.x-1.x-dev stable? And does it address this issue such that the Mail System / SwiftMailer combination will work as intended?
Views Send is a very handy module, by the way. It meets needs that are not really suited to Simplenews (and other mailing list solutions).
Thanks in advance for your answers to my questions,
Bob
Comment #15
hansfn CreditAttribution: hansfn commentedHi, Bob.
You are right, the issue isn't fixed in 7.x-1.0-rc3. I have forgotten to create a new release.
Anyway, it's completely safe to use the current 7.x-1.x-dev version. Please try the dev version, and create a new issue if it doesn't work, because then the problem is related to SwiftMailer.
I'll try to create a new release later this week. Maybe 7.x-1.0 ;-)
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks, Hans.
I will keep you posted if there is an issue.
Bob