How difficult would it be to redirect some messages from Privatemsg.module to SMTP?
The reason I ask, is that I am developing a system that will receive POP3 messages and put them into the Privatemsg database as a new Privatemsg. This is not theoretical, its almost ready and I should have it finished by tommrow. I would like users to be able to reply to those new POP messages and it seems that the only thing preventing that is to change the "check for recipient" to redirect the real email addresses to the SMTP server if the recipient is a real address. Seems easy enough.
Any mail that is sent to messages-uid@edomain.com is parsed and put into the DB. My other module notifies them that they have a new message waiting. The check their messages and see the new email. They reply and send to the SMTP server:
user: hardcode
pass: hardcode
server: hardcode
return: messages-uid@edomain.com
from: username@domain.com
This way they will only get messages that have been replied to, which is just fine. No user configuration changes needed. Maybe a checkbox to disable this feature in the Admin settings.
Comments
Comment #1
Fusion_Sushi commentedWish I could edit that post, a couple typos.. I was not being clever, all domains should be the same.
Comment #2
Fusion_Sushi commentedwhadda think? I'll take a crack at it myself if you can point me in the right direction... thanks!
Comment #3
Fusion_Sushi commentedHere is the code that throws the error:
Comment #4
Fusion_Sushi commentedAccording to the docs this is the code to send mail via Drupal:
So I need to merge the two..
Comment #5
Fusion_Sushi commentedSomething like this?? *not tested*
Comment #6
Fusion_Sushi commentedSeems that this is more like what I am looking for but, this code hoses the module:
Comment #7
Fusion_Sushi commentedK, that did'nt work. I think I was trying to send mail from the wrong line can someone help me catch the form data and send it?
Something like that?
Comment #8
Fusion_Sushi commentedA little progress:
just removed this code. then put the send mail request at the end of the else statements right before the sql and it is now sending but.. I'm not catching the form data yet.
Comment #9
Fusion_Sushi commentedOk, here is the way to send email via this module:
on or about line 520 remove exactly these chars:
then right before the original line 541:
add this:
Comment #10
Fusion_Sushi commentedNeed a function to decide if a message is a PM or an email. On the new line 540, put this in to check for email... this does not put the email it into the database.
Comment #11
Fusion_Sushi commentedAlright #10 was a misstep, don't use that. Here is an Alpha that has worked a couple times so far:
Comment #12
Fusion_Sushi commentedChange this line:
Comment #13
Fusion_Sushi commentedChange line 417 to include hostname:
Change line 434 to send to the host(I'm using that field to store the actual recipient) you'll need my other script that retrieves the email and puts it into the database to have that field populated.
Finally edit line 507 to remove the use of the hostname. I would like to save that function but it does not really do anything so, it's better used to store email addresses:
Comment #14
Fusion_Sushi commentedAnd change, from line 429
Comment #15
Fusion_Sushi commentedOne small change, I missed removeing this symbol in post #13
Comment #16
litwol commentedI apologize for pinging the participants, i'm closing out old issues. Privatemsg already implements some of these features. Please file a feature request against the latest DRUPAL-6 version if still relevant.
Specific to routing messages. privatemsg module now has API that allows other messages to expand it's functionality to react to events. one relevant event here is "user is receiving message", so then you can route it to mail. please submit feature request (and patch :) ) if this is still relevant.