Workaround when the provider does not allow Email-Piping

Started by SMiFFER, March 14, 2018, 01:35:00 AM

Previous topic - Next topic

SMiFFER

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?
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

butch2k

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.

SMiFFER

As said: The one and only sender is my own programme. It writes only couple lines of plain text.

Quote from: butch2k on March 14, 2018, 08:55:10 AM
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?
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

butch2k

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).

SMiFFER

You leave me in the dark completely.
Can you be a bit more precise as to where I must start my search?
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

SMiFFER

Any ACTUAL HELP available please and not such "vague theory-talk" only?
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

vbgamer45

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

SMiFFER

Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

vbgamer45

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

SMiFFER

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?
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

vbgamer45

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

SMiFFER

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?
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

vbgamer45

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

SMiFFER

Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!


Advertisement: