Advertisement:

Author Topic: Import messages from a mailing list into SMF?  (Read 1935 times)

Offline rayarachelian

  • Newbie
  • *
  • Posts: 5
Import messages from a mailing list into SMF?
« on: January 13, 2019, 05:10:18 PM »
Hi, there's a mailing list I'd like to convert to a SMForum, is there a guide somewhere that says how to add messages to a board and link the replies to them? I can script all that stuff, just want to know what the formats are for doing this, and whether there'd be issues with invalid users on the boards, etc.

I have a standard mailbox in thunderbird that contains all the messages.


Also, I had trouble registering because of DNS issues with simplemachines.org:

postfix/smtpd[17409]: NOQUEUE: reject: RCPT from unknown[66.71.247.155]: 554 5.7.1 <httpd4.localdomain>: Helo command rejected: Host not found; from=<noreply@simplemachines.org> to=<my email address here> proto=ESMTP helo=<httpd4.localdomain>

I think the issue is that the sending machine isn't listed in DNS (see unknown and helo). Reverse DNS for 66.71.247.155 shows fw01.atl.forceitx.net.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,502
  • Gender: Male
    • Kindred-999 on GitHub
Re: Import messages from a mailing list into SMF?
« Reply #1 on: January 13, 2019, 05:50:54 PM »
You would need to convert the Thunderbird messages into a sql file...
1- identify the users (minimum of username and email address)
2- create a script that creates the users .... either a sql and a css with a separate php which processes the css
3- separate the messages, identify them by thread (original message and all replies, in order)
4- create a script that imports the messages (title, body, author, original message, save original message Id and import all replies into that thread... then do the same for every message/thread

It’s not simple...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline rayarachelian

  • Newbie
  • *
  • Posts: 5
Re: Import messages from a mailing list into SMF?
« Reply #2 on: January 13, 2019, 07:21:00 PM »
Fair enough, but what happens to the actual users when they aren't registered and try to join?

Would they just be able to do a "Forgotten password" step to get access again? Or should I generate fake email addresses for the messages?
Is there anything else I need to worry about there?

I expect the actual users to want to join the forum after this is done.  You mention generating usernames, but what if they want to change their username after they join? Is that something they'd be able to do, or something that will require administrator help?

Are there any pointers to code I could start with for some other imports, maybe from some other forum to SMF, whatever code is the cleanest readable example?

Any documentation somewhere that describes the database relations I'll need to mess with (other than just opening up postgres and messing with \d and friends?) Anything I can do to keep this portable to SMF owners who might be using something other than postgres?

Sorry for the n00b questions, no worries, I can code, I only need to find the right path to get started, and will take it from there. :)

Many thanks.

If I get this working I'll certainly share my scripts.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,502
  • Gender: Male
    • Kindred-999 on GitHub
Re: Import messages from a mailing list into SMF?
« Reply #3 on: January 13, 2019, 07:33:07 PM »
It would be best if you did not deal with straight sql...  instead, use the existing smf functions to create users and create messages.

You can look at the various converters that are available, like mybb to smf and phpbb to smf

I would suggest creating real users and then letting them use the forgot password, yes...   changing the display name is easy. Changing the login name is more difficult and does require an admin, because the password gets bashed based on the username.

But they can use the email address to login...
« Last Edit: January 14, 2019, 03:17:22 PM by Kindred »
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,559
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Import messages from a mailing list into SMF?
« Reply #4 on: January 13, 2019, 07:34:33 PM »

As Kindred said either check out the convertor or I  would use the function database https://support.simplemachines.org/function_db/ and use the SMF code itself to load the database. Start with a fresh empty install of SMF create and setup your boards.
Then register your member's and then createposts/topics using these functions below

registerMember http://support.simplemachines.org/function_db/index.php?action=view_function;id=594
createPost http://support.simplemachines.org/function_db/index.php?action=view_function;id=323

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 rayarachelian

  • Newbie
  • *
  • Posts: 5
Re: Import messages from a mailing list into SMF?
« Reply #5 on: January 14, 2019, 08:12:11 AM »
Awesome! Thank you guys!
 :)