Jump to content

Moving E-mails Between Local Accounts.


gsb

Recommended Posts

I am trying to move e-mails from one account, say info@my-domain.com to another user account like, salesman@my-domain.com.

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=24808&st=0&p=90240&#entry90240\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...240&#entry90240[/a]

I did a search and found one (old) thread concerning imap_mail_move() which does not seem to address multiple accounts but rather the sub-boxes under the original account.

A little direction, similar thread, or example would help.

Regards,

gsb
Link to comment
Share on other sites

Thank you Ashh for a quick response but I do not believe that is going to help me.

I am trying not to use a forward or actual send that would change the headers, but that is the only solution I have come up with.

Regards,

gsb
Link to comment
Share on other sites

It depends how your server is set up to store the mail, most servers will store each account (and folder) in a text file. Some will store each message in a folder for that email account. If you have access to your mail folder, you can read the files using PHP and extracting any message you want. You can also place it in another email account as well.
Link to comment
Share on other sites

Thank you nogray,

This sounds like a possible solution.
I use a commercial server, "Lunar Pages" and will need to learn if I have such access or not.

Is there a "standard" location where I might look for such files?
Yes this is a dumb question I guess, but at this point for me, worth asking.

Regards,

gsb
Link to comment
Share on other sites

Yes was a dumb question.
I found the mail storage and it is a text file as nogray said above.

Which leads me to another question:
Does anyone have a good idea of how to extract an email from one such file and insert it into another?
I'm thinking that the imap functions do well at the extraction but I am unsure as to the insertion operation into another's input mail box.

Regards,

gsb
Link to comment
Share on other sites

If it's one file message will be seprated by two line breaks and the From email@domain.com

some the file might look like this

From someone@somewhere ......
... more headers ....

message

From someone@somewhere ......
... more headers ....

message

From someone@somewhere ......
... more headers ....

message

usually the first section is the setting of the email account, so you can split the text file using "\n\nFrom" as the sperator and check each if for whatever you want it to match (the email, subject, etc)

To add the message to another account, you can just place it in the bottom of that file (just make sure it has \n\n before it and after) you should include the headers for it to show up in the email manager (I think).

You'll need to make some tests and test some more for this to work like you want it.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.