Skip to main content
Topic: Requesting Help on Post/reply by email  (Read 1175 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Requesting Help on Post/reply by email

1. I am using KnownHost server with Cpanel.
2.  Installed Elkarte 1.1.6
3. Enabled Core/Post by Email Management
4. Enabled: Maillist configuration / settings : Enable Maillist Functions (master on/off setting) and Allow posting to the forum by Email
5. Setup forwarder for Pipe through Cpanel as per https://github.com/elkarte/Elkarte/wiki/Posting-by-Email-Feature
6. Permission 755 for both emailpost.php and emailtopic.php
7. Staff at KnownHos says forwarding is  working fine and there are no errors.
8. Notification emails are sent out and received correctly.
9, When replied they are not posted.
10, For Post new topics I have setup Receiving email addresses and Board to post new messages to.
11. However when email is sent new topics are not created.
12. Email boxes correctly receives mails. There are no returned or failure message.
13. First line of script: #!/usr/bin/php -q
Can someone guide me to make the feature work?
Thank you.


Re: Requesting Help on Post/reply by email

Reply #1

Sounds like you are doing all the right things.  There are generally only a few reasons why this may not be working.

1) Maybe you don't have the correct path to the systems PHP CLI. Currently you have /usr/bin/php which is the most common, the next most common one is /usr/local/bin/php so you can try that in that shebang line e.g. #!/usr/local/bin/php -q

2) The email is not being piped correctly or the path is wrong.  Sounds like you have this setup and have checked the setting with your host.  If it is wrong there would be error log entries somewhere, probably in the postfix log

3) Some other error in the chain.  If 1 and 2 are correct then we need to capture the php error so we can fix it.  To see the error we need to allow the script to output the error.   To do so in emailpost.php you would find the line that says error_reporting(0); and change it to say error_reporting(E_ALL);

Then reply via email to a message, the error should come back to you in a bounced email, and if for some reason you do not get that bounced mail, there should at least be something in your php error log ... both assuming # 2 is correct., i.e. the mail is being piped to the script properly.

One thing to note, If you have enabled bad behavior, turn it off.  There is an error with having that running and using the post by email functions.  I've fixed this in 1.1.7 but that version of ElkArte is not released yet.

Once setup its a great feature but sometimes it can be difficult to get things entered correctly since its server dependent.

Re: Requesting Help on Post/reply by email

Reply #2

Thank you for the reply.
I changed error_reporting(0); to  error_reporting(E_ALL);
Then the mail bounces with:
PHP Notice:  SSI.php was unable to load a session!  This may cause problems with logout and other functions - please make sure SSI.php is included before anything else in all your scripts! in /home/waasnet/public_html/gl21/bootstrap.php on line 439

I added #!/usr/local/bin/php -q
Even then I get the same above error.



Re: Requesting Help on Post/reply by email

Reply #3

Strange, it should not be running that area of the code when its called from the command line (CLI) ...

You can leave the shebang line as it was, they must have a smylink so either works.

On a positive note we know that the email is being sent to the script and the script is running since you get an error message, thats progress.

We can try a test to see if it helps.  In your bootstrap.php file, on line 437 you should see
Code: (find) [Select]
		if (isset($_SERVER['REMOTE_ADDR']) && session_id() === '')
replace that line with this one and try again.
Code: (replace) [Select]
		if (!defined('STDIN') && isset($_SERVER['REMOTE_ADDR']) && session_id() === '')