Jump to content


Photo

Moving E-mails Between Local Accounts.


  • Please log in to reply
7 replies to this topic

#1 gsb

gsb
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 29 June 2006 - 06:51 PM

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

#2 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 29 June 2006 - 07:31 PM

I'm not sure if this will help you but the only example I can produce is:

imap_mail_move($mbox,$movmsgid,'INBOX.send');

#3 gsb

gsb
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 29 June 2006 - 08:25 PM

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

#4 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 29 June 2006 - 10:07 PM

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.

NoGray.com


#5 gsb

gsb
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 30 June 2006 - 06:35 PM

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

#6 gsb

gsb
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 30 June 2006 - 07:02 PM

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

#7 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 30 June 2006 - 08:31 PM

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.

NoGray.com


#8 gsb

gsb
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 30 June 2006 - 10:36 PM

Thank you again.

Yes I am familiar with the 2-newline breaks separator, it bit me some years ago now.
This looks quite doable from here now thanks to your guidance.

Regards,

gsb




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users