| 1 | <? |
| 2 | include("../config/config.php"); |
| 3 | include("../functions/strings.php"); |
| 4 | include("../functions/page_header.php"); |
| 5 | include("../functions/imap.php"); |
| 6 | |
| 7 | $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString); |
| 8 | if (!$imapConnection) { |
| 9 | echo "Error connecting to IMAP Server.<br>"; |
| 10 | echo "$errorNumber : $errorString<br>"; |
| 11 | exit; |
| 12 | } |
| 13 | $serverInfo = fgets($imapConnection, 256); |
| 14 | |
| 15 | fputs($imapConnection, "1 login $username $key\n"); |
| 16 | $read = fgets($imapConnection, 1024); |
| 17 | echo $read; |
| 18 | |
| 19 | if ($subfolder == "INBOX") |
| 20 | fputs($imapConnection, "1 create \"user.$username.$folder_name\"\n"); |
| 21 | else |
| 22 | fputs($imapConnection, "1 create \"user.$username.$subfolder.$folder_name\"\n"); |
| 23 | |
| 24 | fputs($imapConnection, "1 logout\n"); |
| 25 | |
| 26 | echo "<BR><BR><A HREF=\"folders.php\">Return</A>"; |
| 27 | ?> |
| 28 | |
| 29 | |