Forum und email

IMAP, POP3, NNTP 함수

소개

이 함수는 IMAP, NNTP, POP3 프로토콜로 작업을 할 수 있게 해 주고, 로컬 편지함에 접근하는 방법을 제공합니다.

몇몇 IMAP 함수는 POP 프로토콜과 정상적으로 작동하지 않습니다.

요구 조건

이 확장은 c-client 라이브러리가 설치되어 있어야 합니다. » ftp://ftp.cac.washington.edu/imap/에서 최신 버전을 받아서 컴파일 하십시오.

IMAP 소스 파일을 시스템 include 디렉토리에 직접 복사하면 안됩니다. 충돌이 생길 수도 있습니다. 대신, 시스템 include 디렉토리 밑에 /usr/local/imap-2000b/(위치와 이름은 설정과 IMAP 버전에 따라 다릅니다)처럼 새로운 디렉토리를 만들고, 새 디렉토리 안에 추가적으로 lib/, include/ 디렉토리를 만듭니다. IMAP 소스 트리의 c-client 디렉토리에서 모든 *.h 파일을 include/에 복사하고, 모든 *.c 파일을 lib/에 복사합니다. 추가적으로, IMAP을 컴파일 할 때 c-client.a가 만들어집니다. 이 파일을 libc-client.a로 이름을 바꾸어 lib/ 디렉토리에 넣으십시오.

Note: c-client 라이브러리에 SSL이나 Kerberos 지원을 추가하여 빌드하려면 패키지 안에 있는 문서를 읽어보십시오.

Note: 맨드레이크 리눅스에서, IMAP 라이브러리(libc-client.a)는 Kerberos 지원을 하지 않습니다. SSL을 지원하는 다른 버전(client-PHP4.a)이 설치됩니다. 라이브러리는 Kerberos를 지원하도록 다시 컴파일해야 합니다.

설치

To get these functions to work, you have to compile PHP with --with-imap[=DIR], where DIR is the c-client install prefix. From our example above, you would use --with-imap=/usr/local/imap-2000b. This location depends on where you created this directory according to the description above. Windows users may include the php_imap.dll DLL in php.ini. IMAP is not supported on systems earlier that Windows 2000. This is because it uses encryption functions in order to enable SSL connections to the mail servers.

Note: Depending how the c-client was configured, you might also need to add --with-imap-ssl=/path/to/openssl/ and/or --with-kerberos=/path/to/kerberos into the PHP configure line.

Warning

IMAP, recode, YAZ, Cyrus 확장은 같은 내부 심볼을 공유하기 때문에, 동시에 사용할 수 없습니다.

실행시 설정

이 확장은 php.ini 설정이 존재하지 않습니다.

실행시 설정

예약 상수

이 확장은 다음의 상수들을 정의합니다. 이 확장을 PHP에 내장했거나, 실행시에 동적으로 읽어들일 경우에만 사용할 수 있습니다.

NIL (integer)
OP_DEBUG (integer)
OP_READONLY (integer)
Open mailbox read-only
OP_ANONYMOUS (integer)
Don't use or update a .newsrc for news (NNTP only)
OP_SHORTCACHE (integer)
OP_SILENT (integer)
OP_PROTOTYPE (integer)
OP_HALFOPEN (integer)
For IMAP and NNTP names, open a connection but don't open a mailbox.
OP_EXPUNGE (integer)
OP_SECURE (integer)
CL_EXPUNGE (integer)
silently expunge the mailbox before closing when calling imap_close()
FT_UID (integer)
The parameter is a UID
FT_PEEK (integer)
Do not set the \Seen flag if not already set
FT_NOT (integer)
FT_INTERNAL (integer)
The return string is in internal format, will not canonicalize to CRLF.
FT_PREFETCHTEXT (integer)
ST_UID (integer)
The sequence argument contains UIDs instead of sequence numbers
ST_SILENT (integer)
ST_SET (integer)
CP_UID (integer)
the sequence numbers contain UIDS
CP_MOVE (integer)
Delete the messages from the current mailbox after copying with imap_mail_copy()
SE_UID (integer)
Return UIDs instead of sequence numbers
SE_FREE (integer)
SE_NOPREFETCH (integer)
Don't prefetch searched messages
SO_FREE (integer)
SO_NOSERVER (integer)
SA_MESSAGES (integer)
SA_RECENT (integer)
SA_UNSEEN (integer)
SA_UIDNEXT (integer)
SA_UIDVALIDITY (integer)
SA_ALL (integer)
LATT_NOINFERIORS (integer)
This mailbox has no "children" (there are no mailboxes below this one).
LATT_NOSELECT (integer)
This is only a container, not a mailbox - you cannot open it.
LATT_MARKED (integer)
This mailbox is marked. Only used by UW-IMAPD.
LATT_UNMARKED (integer)
This mailbox is not marked. Only used by UW-IMAPD.
SORTDATE (integer)
Sort criteria for imap_sort(): message Date
SORTARRIVAL (integer)
Sort criteria for imap_sort(): arrival date
SORTFROM (integer)
Sort criteria for imap_sort(): mailbox in first From address
SORTSUBJECT (integer)
Sort criteria for imap_sort(): message subject
SORTTO (integer)
Sort criteria for imap_sort(): mailbox in first To address
SORTCC (integer)
Sort criteria for imap_sort(): mailbox in first cc address
SORTSIZE (integer)
Sort criteria for imap_sort(): size of message in octets
TYPETEXT (integer)
TYPEMULTIPART (integer)
TYPEMESSAGE (integer)
TYPEAPPLICATION (integer)
TYPEAUDIO (integer)
TYPEIMAGE (integer)
TYPEVIDEO (integer)
TYPEOTHER (integer)
ENC7BIT (integer)
ENC8BIT (integer)
ENCBINARY (integer)
ENCBASE64 (integer)
ENCQUOTEDPRINTABLE (integer)
ENCOTHER (integer)
IMAP_OPENTIMEOUT (integer)
IMAP_READTIMEOUT (integer)
IMAP_WRITETIMEOUT (integer)
IMAP_CLOSETIMEOUT (integer)
LATT_REFERRAL (integer)
LATT_HASCHILDREN (integer)
LATT_HASNOCHILDREN (integer)
TYPEMODEL (integer)

참고

이 문서는 제공하는 함수에 관련한 모든 상세를 설명할 수 없습니다. 자세한 정보는 c-client 라이브러리 소스에 제공되는 문서(docs/internal.txt)에서 제공합니다. 그리고 다음 RFC 문서를 참고하십시오:

더 자세한 사항은 David Wood가 저술한 » Programming Internet Email 과 Dianna Mullet와 Kevin Mullet가 공저한 » Managing IMAP 책에서 확인할 수 있습니다.

Table of Contents

  • imap_8bit — 8비트 문자열을 quoted-printable 문자열로 변환한다
  • imap_alerts — 이 함수는 현재 페이지 요구(page request)동안이나,또는 경고 스택(alert stack)이 리셋(reset)된 이후에 발생한 경고(alert)메시지 (물론 있다면) 모두를 돌려준다
  • imap_append — 특정 메일박스에 문자열 메시지를 덧붙인다.
  • imap_base64 — BASE64로 엔코딩된 텍스트를 디코딩한다
  • imap_binary — 8비트 문자열을 base64문자열로 변환한다
  • imap_body — 메시지의 본문을 읽어온다
  • imap_bodystruct — Read the structure of a specified body section of a specific message
  • imap_check — 현재 메일 박스를 체크한다
  • imap_clearflag_full — 메시지에서 플래그(flags)를 클리어(clear)한다
  • imap_close — IMAP 스트림을 닫는다
  • imap_createmailbox — 새 메일 박스를 만든다
  • imap_delete — 현재 메일 박스에서 삭제될 메시지를 표시한다
  • imap_deletemailbox — 메일 박스를 지운다
  • imap_errors — 이 함수는 현재 페이지 요구(page request)동안에, 또는 에러 스택(error stack)이 리셋(reset)된 이후에 발생한 IMAP 에러(물론 있다면)를 모두 돌려준다
  • imap_expunge — 지움 표시된 모든 메시지를 완전히 삭제한다
  • imap_fetch_overview — 주어진 메시지 헤더의 전체 정보를 읽어 온다
  • imap_fetchbody — 메시지의 본문중에서 특정 부분을 페치한다
  • imap_fetchheader — 메시지에서 헤더를 돌려준다
  • imap_fetchstructure — 특별한 메시지의 구조체를 읽어온다
  • imap_get_quota — Retrieve the quota level settings, and usage statics per mailbox
  • imap_get_quotaroot — Retrieve the quota settings per user
  • imap_getacl — Gets the ACL for a given mailbox
  • imap_getmailboxes — 메일박스의 목록을 읽어오고, 각 메일박스에 대한 상세한 정보를 돌려준다.
  • imap_getsubscribed — subscribed된 모든 메일 박스의 목록을 보여준다.
  • imap_header — Read the header of the message
  • imap_headerinfo — 메시지의 머릿글을 읽어온다
  • imap_headers — 메일박스에서 모든 메시지의 헤더를 돌려준다
  • imap_last_error — 이 함수는 현재 페이지 요구(page request) 동안에 발생한 IMAP 에러(물론 있다면)의 가장 나중것을 돌려준다
  • imap_list — Read the list of mailboxes
  • imap_listmailbox — 메일박스의 목록을 읽어온다
  • imap_listscan — Returns the list of mailboxes that matches the given text
  • imap_listsubscribed — subscribed된 모든 메일박스의 목록을 보여준다
  • imap_lsub — List all the subscribed mailboxes
  • imap_mail_compose — 주어진 envelope와 body 섹션으로 구성된 MIME메시지를 만든다
  • imap_mail_copy — 메일박스에 특정 메시지를 복사한다
  • imap_mail_move — 메일박스에 특정 메시지를 이동시킨다
  • imap_mail — 이메일 메시지를 보낸다
  • imap_mailboxmsginfo — 현재 메일박스에 관한 정보를 가져온다
  • imap_mime_header_decode — MIME 헤더 구성요소(element)를 디코딩한다
  • imap_msgno — 이 함수는 주어진 UID값에 대해 메시지 일련번호(sequence number)을 넘겨준다
  • imap_num_msg — 현재 메일박스의 메시지 갯수를 돌려준다
  • imap_num_recent — 현재 메일박스의 새로운 메시지 갯수를 돌려준다
  • imap_open — 메일박스에 IMAP 스트림(stream)을 연다
  • imap_ping — IMAP 스트림(stream)이 아직 사용가능한지 체크한다
  • imap_qprint — quoted-printable 문자열을 8비트 문자열로 변환한다
  • imap_renamemailbox — 메일박스의 이름을 바꾼다
  • imap_reopen — 새로운 메일박스에 IMAP 스트림(stream)을 다시 연다
  • imap_rfc822_parse_adrlist — 주소 문자열을 해석한다
  • imap_rfc822_parse_headers — 문자열에서 메일 헤더를 해석한다
  • imap_rfc822_write_address — 주어진 메일박스, 호스트, 개인 정보로 적절히 형식화된 이메일 주소를 돌려준다
  • imap_savebody — Save a specific body section to a file
  • imap_scanmailbox — 메일박스의 텍스트중에서 검색 문자열을 갖는 메일박스의 목록을 읽어 온다
  • imap_search — 이 함수는 주어진 검색 기준(criteria)에 부합되는 메시지의 배열을 돌려준다
  • imap_set_quota — Sets a quota for a given mailbox
  • imap_setacl — Sets the ACL for a giving mailbox
  • imap_setflag_full — 메시지에서 플래그(flags)를 셋(set)한다
  • imap_sort — 메시지 헤더의 배열을 정렬한다
  • imap_status — 이 함수는 현재 메일박스 이외의 다른 메일 박스의 상태 정보를 돌려준다
  • imap_subscribe — 메일 박스에 Subscribe한다
  • imap_thread — Returns a tree of threaded message
  • imap_timeout — Set or fetch imap timeout
  • imap_uid — 이 함수는 주어진 메시지의 일련번호(sequence number)에 대한 UID를 돌려준다
  • imap_undelete — 지움 표시된 메시지의 지움 표시를 제거한다
  • imap_unsubscribe — 메일박스를 Unsubscribe한다
  • imap_utf7_decode — modified UTF-7 인코딩된 문자열을 디코딩한다.
  • imap_utf7_encode — 8비트 데이터를 UTF-7 텍스트로 변환한다.
  • imap_utf8 — 텍스트를 UTF8로 변환한다