squirrelmail과 imap 설치중 에러.

lacovnk의 이미지

0. debian woody, uw-imapd( 2001adebian), squirrelmail(1.2.6-1.4), php4(4.1.2-7.0.1),apache(1.3.26-0woody)

1. imap이 접속이 안됩니다. 일단 connect 되었다가 끊겨 버리는군요 -_-

[root@lacovnk:/]# telnet localhost imap
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

143포트를 /etc/services, /etc/inetd.conf에서 열어주었고, inetd restart도 한 상태입니다.

2. squirrel은, 첫 로그인 화면에서 다음으로 넘어가질 않습니다.

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 9097 bytes) in /usr/share/squirrelmail/functions/imap_general.php on line 137

구글해보니, php.ini에서 메모리를 늘려라.. 라고 되어 있는데 늘려봤자 타임아웃만 걸릴뿐이군요 -_-;; 것도 늘리면 다시 메모리 아웃이고..

apache 쪽에서 설정을 해주어야 하는게 있는건가요? 찾다 보니 apache2는 어쩌구 저쩌구 있던데..

참고로, 저 부분의 소스는 제일 아래에 붙여놓겠습니다.

3. sendmail이나, imap이나 pop3 등등을 설정안하고, squirrelmail만 설치한다면, squirrelmail에서 에러가 나야지, 저런 이상한 증세를 내뱉는게 이해가 안가는군요; 버그인가요? 아니면 제가 뭘 잘못 생각하고 있는지... :oops:

mail server를 설치 안해도, squirrelmail에서 다른 서버(smtp나 imap등등)을 지원하는 서버를 이용해서 사용할 수 있는 것 아닌가요?

4. 아, mutt로 보니, portsentry가 뭔가 한건 한것 같군요;; tcp 119포트를 차단했다는데, 어쩌다가 -_-;; 그간 한건 telnet과 썬더버드인데.. 으음.

역시 내용은 제일 아래에 달아놓겠습니다.

아래는, 문제가 생긴 함수의, 앞부분입니다. 길군요 -_-

     44 /*
     45  * Reads the output from the IMAP stream.  If handle_errors is set to true,
     46  * this will also handle all errors that are received.  If it is not set,
     47  * the errors will be sent back through $response and $message
     48  */
     49 function sqimap_read_data_list ($imap_stream, $pre, $handle_errors, &$response, &$message, $quer        y = '') {
     50     global $color, $squirrelmail_language;
     51
     52     $read = '';
     53     $bufsize = 9096;
     54     $resultlist = array();
     55
     56     $more_msgs = true;
     57     while ($more_msgs) {
     58         $data = array();
     59         $total_size = 0;
     60
     61         while (strpos($read, "\n") === false) {
     62             if(!($read .= fgets($imap_stream, $bufsize))) {
     63                 break;
     64             }
     65         }
     66
     67         /* if (ereg("^\\* [0-9]+ FETCH.*\\{([0-9]+)\\}", $read, $regs)) { */
     68         if (preg_match('/^\* [0-9]+ FETCH.*\{([0-9]+)\}/', $read, $regs)) {
     69            $size = $regs[1];
     70         /* } else if (ereg("^\\* [0-9]+ FETCH", $read, $regs)) { */
     71         } else if (preg_match('/^\* [0-9]+ FETCH/', $read, $regs)) {
     72             /* Sizeless response, probably single-line */
     73             $size = -1;
     74             $data[] = $read;
     75             $read = fgets($imap_stream, $bufsize);
     76         } else {
     77             $size = -1;
     78         }
     79         while (1) {
     80             while (strpos($read, "\n") === false) {
     81                 if(!($read .= fgets($imap_stream, $bufsize))) {
     82                     break;
     83                 }
     84             }
     85             /* If we know the size, no need to look at the end parameters */
     86             if ($size > 0) {
     87                 if ($total_size == $size) {
     88                     /* We've reached the end of this 'message', switch to the next one. */
     89                     $data[] = $read;
     90                     break;
     91                 } else if ($total_size > $size) {
     92                     $difference = $total_size - $size;
     93                     $total_size = $total_size - strlen($read);
     94                     $data[] = substr ($read, 0, strlen($read)-$difference);
     95                     $read = substr ($read, strlen($read)-$difference, strlen($read));
     96                     break;
     97                 } else {
     98                     $data[] = $read;
     99                     $read = fgets($imap_stream, $bufsize);
    100                     while (strpos($read, "\n") === false) {
    101                       $read .= fgets($imap_stream, $bufsize);
    102                     }
    103                 }
    104                 $total_size += strlen($read);
    105             } else {
    106                 /* if (ereg("^$pre (OK|BAD|NO)(.*)", $read, $regs) || */
    107                 if (preg_match("/^$pre (OK|BAD|NO)(.*)/", $read, $regs) ||
    108                     /* (($size == -1) && ereg("^\\* [0-9]+ FETCH.*", $read, $regs))) { */
    109                     (($size == -1) && preg_match('/^\* [0-9]+ FETCH.*/', $read, $regs))) {
    110                     break;
    111                 } else if ( preg_match('/^\* OK \[PARSE.*/', $read, $regs ) ) {
    112                     /*
    113                      * This block has been added in order to avoid the problem
    114                      * caused by the * OK [PARSE] Missing parameter answer
    115                      * Please, replace it with a better parsing if you know how.
    116                      * This block has been updated by
    117                      * Seth E. Randall <sethr@missoulafcu.org>.  Once we see
    118                      * one OK [PARSE line, we just go through and keep
    119                      * tossing them out until we get something different.
    120                      */
    121                     while ( preg_match('/^\* OK \[PARSE.*/', $read, $regs ) ) {
    122                         $read = fgets($imap_stream, $bufsize);
    123                     }
    124                     $data[] = $read;
    125                     $read = fgets ($imap_stream, $bufsize);
    126                 } else if (preg_match('/^\* BYE \[ALERT\](.*)/', $read, $regs)) {
    127                     /*
    128                      * It seems that the IMAP server has coughed up a lung
    129                      * and hung up the connection.  Print any info we have
    130                      * and abort.
    131                      */
    132                     echo _("Please contact your system administrator and report the following er        ror:") . "<br>\n";
    133                     echo $regs[1];
    134                     exit;
    135                 } else {
    136                     $data[] = $read;
    137                     $read = fgets ($imap_stream, $bufsize);
    138                 }
    139             }
    140         }

Active System Attack Alerts
=-=-=-=-=-=-=-=-=-=-=-=-=-=
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Ignoring TCP response per configuration file setting.
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Ignoring TCP response per configuration file setting.
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Host: 211.55.72.20 is already blocked. Ignoring
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Host: 211.55.72.20 is already blocked. Ignoring

Possible Security Violations
=-=-=-=-=-=-=-=-=-=
Aug 30 01:09:09 lacoserver sshd[27935]: Bad protocol version identification '' from 211.55.72.20
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Ignoring TCP response per configuration file setting.
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Ignoring TCP response per configuration file setting.
Aug 30 01:20:09 lacoserver saslpasswd: failed to set plaintext secret for sendmail: requested change was not needed
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Host: 211.55.72.20 is already blocked. Ignoring
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:31:54 lacoserver portsentry[482]: attackalert: Host: 211.55.72.20 is already blocked. Ignoring
Aug 30 01:35:23 lacoserver smbd[27051]:   read_data: read failure for 4. Error = No route to host
Aug 30 01:35:23 lacoserver smbd[27051]:   read_data: read failure for 4. Error = No route to host

Unusual System Events
=-=-=-=-=-=-=-=-=-=-=
Aug 30 01:02:27 lacoserver inetd[27455]: imap2/tcp: bind: Address already in use
Aug 30 01:06:31 lacoserver imapd[27925]: Null command before authentication host=UNKNOWN
Aug 30 01:06:34 lacoserver imapd[27925]: Missing command before authentication host=UNKNOWN
Aug 30 01:09:09 lacoserver sshd[27935]: Bad protocol version identification '' from 211.55.72.20
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Ignoring TCP response per configuration file setting.
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Connect from host: 211.55.72.20/211.55.72.20 to TCP port: 119
Aug 30 01:10:39 lacoserver portsentry[482]: attackalert: Ignoring TCP response per configuration file setting.
Aug 30 01:12:15 lacoserver inetd[27455]: imap2/tcp: bind: Address already in use
Aug 30 01:12:15 lacoserver inetd[27455]: pop-2/tcp: unknown service
Aug 30 01:12:15 lacoserver inetd[27455]: imap2/tcp: bind: Address already in use
Aug 30 01:12:15 lacoserver inetd[27455]: pop-2/tcp: unknown service
Aug 30 01:12:15 lacoserver inetd[27455]: imap2/tcp: bind: Address already in use
Aug 30 01:12:15 lacoserver inetd[27455]: pop-2/tcp: unknown service
Aug 30 01:12:15 lacoserver inetd[27455]: imap2/tcp: bind: Address already in use
Aug 30 01:12:15 lacoserver inetd[27455]: pop-2/tcp: unknown service
Aug 30 01:12:27 lacoserver inetd[27455]: imap2/tcp: bind: Address already in use
Aug 30 01:12:59 lacoserver ipop3d[28002]: Command stream end of file while reading line user=??? host=localhost [127.0.0.1]
Aug 30 01:13:07 lacoserver ipop3d[28004]: Command stream end of file while reading line user=??? host=[211.55.72.20]
Aug 30 01:16:26 lacoserver imapd[28009]: Missing command before authentication host=UNKNOWN
Aug 30 01:16:27 lacoserver imapd[28009]: Missing command before authentication host=UNKNOWN
Aug 30 01:16:54 lacoserver inetd[28031]: imap2/tcp: bind: Address already in use
Aug 30 01:16:54 lacoserver inetd[28031]: pop-2/tcp: unknown service
lacovnk의 이미지

일단,

[root@lacovnk:/etc/mail]# telnet localhost 220
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4REV1 X-NETSCAPE LOGIN-REFERRALS AUTH=LOGIN] localhost IMAP4rev1 2001.315 at Mon, 30 Aug 2004 02:40:59 +0900 (KST)
^]
telnet> quit
Connection closed.

였습니다. port 143은 imap2 이고, port 220이 imap3인데, imap3만 구동이 되고 있었군요. (이렇게 다른건줄 몰랐지요 흑)

그래서 썬더버드에서는 잘 접속이 되었습니다! ㅎㅎㅎ

이제 문제는... 외부에서 여기로 보내는 메일이 안오는 군요. 요건 무료 도메인 을 좀 파봐야 할테고..

여기서 외부와 아직 소통이 안되는군요. 으음... 뭐 더 열심히 건드려봐야겠군요 ㅎㅎ

(자꾸 portsentry가 겁을 줍니다 ㅠㅠ 119 port의 정체는 과연 무엇일까요 -_-; )

lacovnk의 이미지

공유기에서 25포트를 안열어줘서, 메일이 들어오지 않고 있었고,

메일이 나간건.. 스팸으로 분류되어 있었군요 -_-;;;;

squirrelmail 말고, 또 다른 웹메일이 debian에 없을까요? (소스 설치는 역시 귀찮아서.. -_-;; apt 만세 ㅠㅠ)

아, 그리고 webmail.kldp.org 안열리던걸요? 으음;

codebank의 이미지

lacovnk wrote:
아, 그리고 webmail.kldp.org 안열리던걸요? 으음;

현재 webmail은 프로젝트 메니져의 사정으로 잠시 멈춤 상태입니다.
소스를 가져다가 사용하는 사람의 심각할 정도의 질문(원인은 찾아보지 않는...)에
조금 민감하게 반응을 하신것 같다는 생각을 했는데 결국은 프로젝트를 잠시보류시키는
일까지 벌어졌더군요.
Open 소스의 잘못된 생각때문에 (특히 사용자 입장...) 발생한 안타까운 사건이 아닌가
생각이 듭니다.

실은 저도 개발자님이 빨리 마음추수리고 돌아오셨으면하는 바램을 가지고 있는
사람중에 한명이죠.

------------------------------
좋은 하루 되세요.

lacovnk의 이미지

여전히 imap에 연결하려면, 220포트를 써야 하는데..

대부분 143을 기본으로 잡으므로 상당히 불편합니다;

/etc/services

imap2           143/tcp         imap            # Interim Mail Access Proto v2
imap2           143/udp         imap

...
imap3           220/tcp                         # Interactive Mail Access
imap3           220/udp                         # Protocol v3

위의 imap을 imap3로 바꾸고 inetd를 restart했지만 안되는군요;;
servicename, port/protocal, aliases.. 라 해서 여기서 설정하는 줄 알았는데 요 ㅠㅠ

codebank의 이미지

사용하는 imap의 설정파일이 있을겁니다.
보통은 /etc 아래있으니 그 디렉토리를 살펴보시기 바랍니다.
현재 제가 사용하는 imap은 courier-imap을 사용하는데 해당 설정파일에
포트를 지정하는 부분이 있더군요.
사용하시는 imap의 설정파일을 한번 찾아보시기 바랍니다.

------------------------------
좋은 하루 되세요.

lacovnk의 이미지

[root@lacovnk:]# netstat -anp | grep 220
tcp        0      0 0.0.0.0:220             0.0.0.0:*               LISTEN      4624/inetd
tcp        0      0 192.168.1.4:220         211.55.72.20:1540       ESTABLISHED 4024/imapd
tcp        0      0 192.168.1.4:220         211.55.72.20:1602       ESTABLISHED 4625/imapd
[root@lacovnk:]# netstat -anp | grep 143
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      29673/portsentry

이렇게 있었습니다 -_-; portsentry! -_-;

/etc/portsentry/portsentry.conf 에서 143을 제거해주고, inetd를 재구동하니

[root@lacovnk:]# netstat -anp | grep 143
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      4681/inetd

그리고 접속하니 잘 연결됩니다 ㅎㅎ

[root@lacovnk:]# netstat -anp | grep 143
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      4681/inetd
tcp        0      0 192.168.1.4:143         211.55.72.20:1814       ESTABLISHED 4728/imapd
tcp        0      0 192.168.1.4:143         211.55.72.20:1815       ESTABLISHED 4729/imapd
tcp        0      0 192.168.1.4:143         211.55.72.20:1816       ESTABLISHED 4730/imapd

wc-impd 사용하는데, 설정화일을 찾을수가 없더군요; *imap* 으로 검색해도 비스무리한게 안나오는군요;

wintsky의 이미지

Debian Sarge, Exim4, Cyrus21설치되어있습니다.
포트센트리 때문에 imap이 안되던걸 이쓰레드를 보고서 해결했었습니다.
서비스가 정상적으로 실행되던때와 cyrus의 설정이나
portsentry의 설정이 바뀐것은 없습니다.
그런데 언제부터인지 imap과 pop3가 접속이 안됩니다.
텔넷으로 연결하면 아래처럼 접속하자마자 연결이 혼자서 끊어져 버립니다.

$ telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Connection closed by foreign host.

$ telnet localhost imap
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Connection closed by foreign host.

netstat을 해보면 정상적으로 실행되어있습니다.
$ sudo netstat -anp |grep 143
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN     2811/cyrmaster
tcp6       0      0 :::143                  :::*                    LISTEN     2811/cyrmaster
$ sudo netstat -anp |grep 110
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN     2811/cyrmaster
tcp6       0      0 :::110                  :::*                    LISTEN     2811/cyrmaster

smtp는 정상적으로 됩니다.
$ telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 rellab2.snu.ac.kr ESMTP Exim 4.34 Thu, 24 Feb 2005 12:03:28 +0900

의심가는 게 있으시면 알려주시면 감사하겠습니다.
접근방향을 몰라 구글링도 못하고 있습니다. :cry:
codebank의 이미지

wintsky wrote:
그런데 언제부터인지 imap과 pop3가 접속이 안됩니다.
텔넷으로 연결하면 아래처럼 접속하자마자 연결이 혼자서 끊어져 버립니다.

항상 하는 이야기이지만 어느날 갑자기 안되는 일은 없습니다.
무언가 선행작업이 있었기 때문에 일이 발생하는 것이죠.
대부분의 로그는 /var/log 아래 적당한 파일에(messages, syslog등등) 원인이
적혀있기도 합니다.
일단 문제가 발생하면 그런 파일들부터 찾아보는게 좋습니다.

접속이 안되는 문제에 관해서 찾아보니

http://qmail.kldp.org/phpbb/viewtopic.php?t=5994&highlight=telnet

이런 내용이 있더군요. 파일위치는 실행시키는 방법에서는 차이가 있을지 모르지만
제가 볼때는 tcp.cdb파일에 문제가 발생하지 않았나 생각이 드는군요.
해당 프로그램을 처음 설치하고 설정을 어떻게 잡았는지를 되세기면서 찾아보면
바뀐부분이 있을겁니다. 그부분을 수정하면 되지 않을까 생각됩니다.

------------------------------
좋은 하루 되세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.