squirrelmail과 imap 설치중 에러.
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
일단 반쯤 해결했습니다;
일단,
였습니다. port 143은 imap2 이고, port 220이 imap3인데, imap3만 구동이 되고 있었군요. (이렇게 다른건줄 몰랐지요 흑)
그래서 썬더버드에서는 잘 접속이 되었습니다! ㅎㅎㅎ
이제 문제는... 외부에서 여기로 보내는 메일이 안오는 군요. 요건 무료 도메인 을 좀 파봐야 할테고..
여기서 외부와 아직 소통이 안되는군요. 으음... 뭐 더 열심히 건드려봐야겠군요 ㅎㅎ
(자꾸 portsentry가 겁을 줍니다 ㅠㅠ 119 port의 정체는 과연 무엇일까요 -_-; )
성공했습니다!
공유기에서 25포트를 안열어줘서, 메일이 들어오지 않고 있었고,
메일이 나간건.. 스팸으로 분류되어 있었군요 -_-;;;;
squirrelmail 말고, 또 다른 웹메일이 debian에 없을까요? (소스 설치는 역시 귀찮아서.. -_-;; apt 만세 ㅠㅠ)
아, 그리고 webmail.kldp.org 안열리던걸요? 으음;
Re: 성공했습니다!
현재 webmail은 프로젝트 메니져의 사정으로 잠시 멈춤 상태입니다.
소스를 가져다가 사용하는 사람의 심각할 정도의 질문(원인은 찾아보지 않는...)에
조금 민감하게 반응을 하신것 같다는 생각을 했는데 결국은 프로젝트를 잠시보류시키는
일까지 벌어졌더군요.
Open 소스의 잘못된 생각때문에 (특히 사용자 입장...) 발생한 안타까운 사건이 아닌가
생각이 듭니다.
실은 저도 개발자님이 빨리 마음추수리고 돌아오셨으면하는 바램을 가지고 있는
사람중에 한명이죠.
------------------------------
좋은 하루 되세요.
으음.. 다른 웹메일을 설치하려는데..
여전히 imap에 연결하려면, 220포트를 써야 하는데..
대부분 143을 기본으로 잡으므로 상당히 불편합니다;
/etc/services
위의 imap을 imap3로 바꾸고 inetd를 restart했지만 안되는군요;;
servicename, port/protocal, aliases.. 라 해서 여기서 설정하는 줄 알았는데 요 ㅠㅠ
사용하는 imap의 설정파일이 있을겁니다.보통은 /etc 아래있으니
사용하는 imap의 설정파일이 있을겁니다.
보통은 /etc 아래있으니 그 디렉토리를 살펴보시기 바랍니다.
현재 제가 사용하는 imap은 courier-imap을 사용하는데 해당 설정파일에
포트를 지정하는 부분이 있더군요.
사용하시는 imap의 설정파일을 한번 찾아보시기 바랍니다.
------------------------------
좋은 하루 되세요.
해결했습니다! ㅠㅠ
이렇게 있었습니다 -_-; portsentry! -_-;
/etc/portsentry/portsentry.conf 에서 143을 제거해주고, inetd를 재구동하니
그리고 접속하니 잘 연결됩니다 ㅎㅎ
wc-impd 사용하는데, 설정화일을 찾을수가 없더군요; *imap* 으로 검색해도 비스무리한게 안나오는군요;
imap
Debian Sarge, Exim4, Cyrus21설치되어있습니다.
포트센트리 때문에 imap이 안되던걸 이쓰레드를 보고서 해결했었습니다.
서비스가 정상적으로 실행되던때와 cyrus의 설정이나
portsentry의 설정이 바뀐것은 없습니다.
그런데 언제부터인지 imap과 pop3가 접속이 안됩니다.
텔넷으로 연결하면 아래처럼 접속하자마자 연결이 혼자서 끊어져 버립니다.
netstat을 해보면 정상적으로 실행되어있습니다.
smtp는 정상적으로 됩니다.
의심가는 게 있으시면 알려주시면 감사하겠습니다.
접근방향을 몰라 구글링도 못하고 있습니다. :cry:
Re: imap
항상 하는 이야기이지만 어느날 갑자기 안되는 일은 없습니다.
무언가 선행작업이 있었기 때문에 일이 발생하는 것이죠.
대부분의 로그는 /var/log 아래 적당한 파일에(messages, syslog등등) 원인이
적혀있기도 합니다.
일단 문제가 발생하면 그런 파일들부터 찾아보는게 좋습니다.
접속이 안되는 문제에 관해서 찾아보니
http://qmail.kldp.org/phpbb/viewtopic.php?t=5994&highlight=telnet
이런 내용이 있더군요. 파일위치는 실행시키는 방법에서는 차이가 있을지 모르지만
제가 볼때는 tcp.cdb파일에 문제가 발생하지 않았나 생각이 드는군요.
해당 프로그램을 처음 설치하고 설정을 어떻게 잡았는지를 되세기면서 찾아보면
바뀐부분이 있을겁니다. 그부분을 수정하면 되지 않을까 생각됩니다.
------------------------------
좋은 하루 되세요.
댓글 달기