Advertisement:

Author Topic: Workaround when the provider does not allow Email-Piping  (Read 1574 times)

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Workaround when the provider does not allow Email-Piping
« on: March 14, 2018, 01:35:00 AM »
I would like to discuss a possible solution or workaround for the following problem:

There is a mod that allows to have an email posted to an SMF-forum:
http://custom.simplemachines.org/mods/index.php?mod=2843

I really like the idea and so I tried it, until I found out that my provider does not allow Email-Piping.

What I would like to do now is circumvent this issue. I have written a program that creates a text-file on my FTP-server
and what I need now is help to fetch this file, read its contents and post it to my forum.

The file already contains this:
subject
topicID (where to have the following posted)
text

This is how far I got.
Any help maybe?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: Workaround when the provider does not allow Email-Piping
« Reply #1 on: March 14, 2018, 08:55:10 AM »
As an admin of a forum where post by email is possible i may share some insights on the matter.

I think you might want UserID/User Email/User Name or any other way to link the reply to a user, you need to filter any spam or error message as well (think of the "user address unknown" messages you might get back).

You can add a job which check the email directory for any new file whenever the index page is displayed for instance.

Make sure the content and subject is correctly encoded as many email client base64 some of the stuff, corect UTF-8 if needed, and you need to take care of the tags as well. You do not want to insert <script> tags in the DB...

It is no small undertaking.

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Re: Workaround when the provider does not allow Email-Piping
« Reply #2 on: March 15, 2018, 09:43:32 PM »
As said: The one and only sender is my own programme. It writes only couple lines of plain text.

You can add a job which check the email directory for any new file whenever the index page is displayed for instance.

And how is precisely this part done?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: Workaround when the provider does not allow Email-Piping
« Reply #3 on: March 16, 2018, 05:46:42 AM »
You can get inspiration by the way email is sent in SMF or else add some javascript code to index.template.php which will call a php script on your server (best to do it randombly, i.e: call the script once in 10 page openings for instance).

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Re: Workaround when the provider does not allow Email-Piping
« Reply #4 on: March 31, 2018, 04:08:29 AM »
You leave me in the dark completely.
Can you be a bit more precise as to where I must start my search?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Re: Workaround when the provider does not allow Email-Piping
« Reply #5 on: April 16, 2018, 04:00:16 PM »
Any ACTUAL HELP available please and not such "vague theory-talk" only?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,394
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Workaround when the provider does not allow Email-Piping
« Reply #6 on: April 16, 2018, 04:21:03 PM »
Can you access the file via http not just ftp is it a public folder that can be read?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Re: Workaround when the provider does not allow Email-Piping
« Reply #7 on: April 18, 2018, 09:12:07 AM »
If that is really necessary: Yes, I can.
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,394
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Workaround when the provider does not allow Email-Piping
« Reply #8 on: April 18, 2018, 09:32:43 AM »
That woudl probably be the easily since then you can easily fetch the file with file_get_contents from php.
Otherwise you have to use an ftp or sftp class to connect to your ftp server and fetch which can be done but is more work.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Re: Workaround when the provider does not allow Email-Piping
« Reply #9 on: April 19, 2018, 12:03:16 PM »
The file in question would be transmitted using FTP and then accessed by HTTP as you said.
But how exactly do I then take the contents and create a post from it?

Can you provide an example how that can be done?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,394
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Re: Workaround when the provider does not allow Email-Piping
« Reply #11 on: April 19, 2018, 06:36:58 PM »
Thanks,
But how exactly do I then take the contents and create a post from it?

Can you provide an example how that can be done?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,394
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Workaround when the provider does not allow Email-Piping
« Reply #12 on: April 19, 2018, 06:37:53 PM »
Use smf's createpost api. You can see an example of this in my rss feed poster modification
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 357
Re: Workaround when the provider does not allow Email-Piping
« Reply #13 on: April 20, 2018, 02:08:11 AM »
Link?
...coming from VB, using SMF since 2012, now hosting it myself, currently SMF 2.0.15 on PHP 5.6.32
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."

Offline tinoest

  • Development Contributor
  • Jr. Member
  • *
  • Posts: 228