This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Integration trials
#1

Still playing around to find the best way to set things up for multiple pages.
Until now even a range of pages with the same topic show the module just fine. And that is awesome, just what I needed.

I found that also without the code in the top of the (Smarty template) page:
{php}
session_start();
ob_start();
{/php}

everything works as it should? Do I really have to include it?

Secondly, when a comment is posted, the module disappears. (with and without the above mentioned code piece)
Only after loading the page again, it returns. Is this a misconfiguration of me?

Thanks
JohN
Reply
#2

Hi,

Regarding the disappearing, it sounds like a PHP error. Try this FAQ.

I've never used a Smarty template so I can only respond in general:

session_start();

If your page has already started a session then there's no need to add the session_start() line. If you don't start a session at all, then a couple of things won't work quite right although you probably won't even notice. A session is used so that the user doesn't have to complete the captcha again after doing a preview, and a session is also used to help prevent a double-submit if the user clicks on the refresh button after posting a comment.

ob_start();

The ob_start() is used to help prevent any 'headers already sent' errors which can happen when the script tries to set a cookie. The script tries to set a cookie if the user selects the "Remember my form details on this computer" checkbox, or if the user is banned for whatever reason. If you're not seeing any 'headers already sent' errors at these times then it's probably fine to leave the ob_start() out.

Also, I'm not sure if you've seen this thread but it might help.

Have you completed the interview?
Reply
#3

OK, I understand it will be better to include that code. After all it is not that much trouble and it does not give problems..

As far as the php error includes, you're right. The front end reports an error.

I have not enough php knowledge to analyze it, so I hope you can shed a light on it:

frontend:
Code:
[14-Aug-2012 22:49:41] PHP Fatal error:  Uncaught exception 'Swift_RfcComplianceException' with message 'Address in mailbox given [comments@mydomain.com] does not comply with RFC 2822, 3.6.2.' in /home/dvdr/domains/mydomain.com/public_html/comments/includes/swift_mailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php:319
Stack trace:
#0 /home/dvdr/domains/mydomain.com/public_html/comments/includes/swift_mailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(238): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('comments@dingvi...')
#1 /home/dvdr/domains/mydomain.com/public_html/comments/includes/swift_mailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(96): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array)
#2 /home/dvdr/domains/mydomain.com/public_html/comments/includes/swift_mailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(60): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array)
#3 /home/dvdr/domains/mydomain.com/public_html/comments/includes/swift_mailer/lib/classes/Swift/Mime/SimpleMimeEntity.php(581): Swi in /home/dvdr/domains/mydomain.com/public_html/comments/includes/swift_mailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php on line 319

All configured email addresses are valid

I say the thread about including in a Smarty template, but that did not make any sense to me.

Thanks for the quick response Steven
Reply
#4

Okay. I've just done some searching and the only reason I can find is that one of the email addresses isn't valid. Can you double check that all of the email addresses in Settings -> Email -> Editor are correct, including the 'From Email' and 'Reply Email'. Also, is the email address entered when posting a comment on the frontend correct, and is the email address actually real?

I think the 'Swift Mailer' script, (which Commentics uses for sending emails), is very (too) strict about the standard of the email address. What you could do is disable the check that it carries out. I found this tutorial which explains how. The line numbers are a little different. If you search the file for "_assertValidAddress" then you'll find the right function, then comment out the 4 lines that it shows. The file is:

/comments/includes/swift_mailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php

If you receive the email then you'll know that the Swift Mailer check is too strict.

P.S. I'm sure Pier would be happy to explain his Smarty template solution if you ask him.

Have you completed the interview?
Reply
#5

I have disabled the RFC Standard Check in Swift Mailer and that resulted in showing the Commentics module after a new post with the 'thank you' message. Haven't seen that before so that's positive. I wonder though if I should leave that check disabled or not.

But the emails are not send at all, so my guess is, that there is something else where Swift responds to..

So I ran a new error front end report, and the error message is the same even without the RFC Standard Check in Swift Mailer. BUT I now see that there is a email address in the error message that I did not configure ????
I am missing something. email addresses are configured in Settings/Admin and in Settings/email ? Or is there somewhere also another email setting?
Reply
#6

Yes, those are the only two places that the email addresses are from.

If you PM me your admin panel URL and login info then I wouldn't mind taking a look to see if anything's amiss.

I think in the next version I'm going to provide an option not to use Swift Mailer and to just use the standard PHP mail() function.

Have you completed the interview?
Reply
#7

Hi,

I had a look at your admin panel settings. They seem fine. There's nothing wrong with the validity of your email address because I tried with my own email address (which I use for the demo on this website) and I got the same error message but with my email address. So it's difficult to say what the real problem is.

I noticed you use the SMTP method, is this method working for the other scripts on your website? Your port number for SMTP appears to be different to the one in Reports -> PHP Info. It might be worth asking your host about it.

The "comments@yoursite.com" email address is the default setting which the installer creates, however these have all been replaced with your own email address so there shouldn't be any reason for it to be used. I suppose it could be a cache issue with the server.

As a temporary solution, you could turn off the email sending in Settings -> Administrator. This would stop the blank response after posting a comment.

Have you completed the interview?
Reply
#8

The port of the smtp is correct. I'm hosting my own websites and on this server it's that port.

The comments@.... address is gone and replaced by the actual email address. Guess you're right
about the cache.

I tried switching to the most basic protocol: Sendmail
With this protocol I still get the error: Uncaught exception 'Swift_RfcComplianceException' ....
Though the comment is accepted and shows at a reload of the page, as the disappearing of the
module after a submission is still the same.

Strangely turning the email off does not keep the Swift error away. Assuming that is not a cache
cause, my guess is that the Swift module is causing the problem. Changing that for an other one at
a next release would be highly appreciated (by me) :-)
A nice donation would be your share as I like Commentics a lot.

Thanks for your efforts to help me out Steven
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by paulkienitz
06-Dec-2024, 08:53 PM
Last Post by nsuomine
20-Jan-2023, 08:32 AM
Last Post by Steven
23-Jan-2019, 02:07 PM
Last Post by news
18-Dec-2017, 09:15 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)