sqwebmailとimapのauthdaemon共用

とある事情でrebootしたところ、 muttからimapに接続できなくなった。 認証に必要なcourier-authdaemonが起動されていない。 courier-imapはパッケージでinstallしているのでsourier-authdaemonパッケージが 必要なのだが、ソースから入れたsqwebmailと一緒に入ったauthdaemonしか起動していなかった。 imapとsqwebmailを同時に使うには、両方のauthdaemonが必要なのだ。 少しでもメモリを節約するべく、併用するようにしたい。 /usr/local/share/sqwebmail/authdaemonrcで

 authdaemonvar=/var/run/courier/authdaemon

としてみたがダメだ。仕方ないので再コンパイル。

hao@obs% cd sqwebmail-3.3.7
hao@obs% ./configure --prefix=/usr/local/sqwebmail \
                    --enable-mimecharset=iso-2022-jp \
                    --enable-unicode=iso-2022-jp \
                    --enable-cgibindir=/usr/lib/cgi-bin \
                    --enable-imagedir=/home/httpd/sqwebmail/image \
                    --enable-imageurl=/sqwebmail/image/ \
                    --enable-draftname=Drafts \
                    --disable-autorenamesent \
                    --with-authdaemonvar=/var/run/courier/authdaemon \
                    --enable-https
hao@obs% make
root@obs% make 
root@obs% make 

install場所を/usr/local/sqwebmailに変更。--with-authdaemonvar=を指定すると、 Makefileの中で

install-data-local: install-userdb-local
. authlib/authdaemonrc ; test "$$authdaemonvar" != "" || exit 0 ; \
$(mkinstalldirs) $(DESTDIR)/var/run/courier/authdaemon || exit 1

こうなってて、authdaemonのインストールをスキップしてくれるようだ。 これで、sqwebmailからパッケージのauthdaemonを使えるようになった。

    • enable-httpsは、httpでアクセスしたらhttpsにredirectしてくれる

機能のはずなのだが動いてない。それ以上追求せず。 sqwebmailのauthdaemonを起動しないようにして、パッケージの方を有効にする。

root@obs# cd /etc/rc2.d
root@obs# mv S20local_courier-authdaemon _S20local_courier-authdaemon
root@obs# mv _S20courier-authdaemon S20courier-authdaemon

これで次回のreboot後も問題ないはず。

その他、sqwebmailをいろいろカスタマイズ。

時刻のAM/PM表示は長くなって嫌なので24時間表示に。 また再コンパイルか? と思いつつソースを眺めると、 sqwebmail/maildir.c:2766あたりで

       date_yfmt = getarg ("DSPFMT_YDATE");
       if (*date_yfmt == 0)
              date_yfmt = "%d %b %Y";
   
       date_wfmt = getarg ("DSPFMT_WDATE");
       if (*date_wfmt == 0)
              date_wfmt = "%a %I:%M %p";

いかにもカスタマイズできそう。ということで、/usr/local/sqwebmail/html/ja/にあるhtmlファイルを変更。ここのファイル群が一種のテンプレートになっている。

root@obs# diff -uw folder.html.org folder.html   [/usr/local/sqwebmail/html/ja]
--- folder.html.org     Tue May 17 17:54:00 2005
+++ folder.html Tue May 17 19:25:35 2005
@@ -13,7 +13,7 @@
 <!--
 
 [#$DSPFMT_YDATE=%d %b %Y#]
-[#$DSPFMT_WDATE=%a %I:%M %p#]
+[#$DSPFMT_WDATE=%a %H:%M#]
   
 [#$NUM=<font color="#FFFF00" class="folder-index-header">番号</font>#]
 [#$DATE=<font color="#FFFF00" class="folder-index-header">日付</font>#]

何に使われるか不明だが同様に%Iが使われてる部分があるのでついでに。

root@obs# diff -uw newmsg.html.org newmsg.html   [/usr/local/sqwebmail/html/ja]
--- newmsg.html.org     Tue May 17 17:54:00 2005
+++ newmsg.html Tue May 17 18:45:16 2005
@@ -12,7 +12,7 @@
<body onload="init();">
<!--
  
-[#$DSPFMT_DATE=%d %b %Y, %I:%M:%S %p#]
+[#$DSPFMT_DATE=%d %b %Y, %H:%M:%S#]
   
 [#$TOLAB=To:#]
 [#$CCLAB=Cc:#]
root@obs# diff -uw readmsg.html.org readmsg.html [/usr/local/sqwebmail/html/ja]
--- readmsg.html.org    Tue May 17 17:54:00 2005
+++ readmsg.html        Tue May 17 18:43:33 2005
@@ -14,7 +14,7 @@
    
 [#$DSPHDR_FROM=From#] (selectively substitute any E-mail header text)
 
-[#$DSPFMT_DATE=%d %b %Y, %I:%M:%S %p#]
+[#$DSPFMT_DATE=%d %b %Y, %H:%M:%S#]
  
 [#$NEXTLAB=@@right2.gif,width=28 height=20 border=0 alt="Next Message" title="次のメッセージ"@Next@#]

あとは見栄えを最低限。

root@obs# diff -uw sqwebmail.css.org sqwebmail.css
--- sqwebmail.css.org   Tue May 17 18:24:01 2005
+++ sqwebmail.css       Tue May 17 18:52:57 2005
@@ -11,8 +11,9 @@

 /* Default: bg.gif background image (white default), black text */
  
-A:link {color: #0000EF}
-A:visited {color: #0000EF}
+A:link {color: #0000EF; text-decoration: none;}
+A:visited {color: #0000EF; text-decoration: none;}
+A:hover { text-decoration: underline; color: #DE2B2B; }
 A:active {color: #FF0000}
    
 BODY { background-color: #FFFFFF;
@@ -23,7 +24,7 @@
      
 /* blue box at the top of every page, with the page title and E-mail addr */
  
-.pageheader { font-size: 200%; font-weight: bold;}
+.pageheader { font-size: 150%; font-weight: bold;}
   
/************************* List of folders *****************************/
     
@@ -90,7 +91,7 @@
       /* Alternating background colors in the folder index */
	      
 .folder-index-bg-1 { background-color: #ffffff }
-.folder-index-bg-2 { background-color: #cccccc }
+.folder-index-bg-2 { background-color: #eeeed0 }
	        
       /* styles applied to read and unread messages */
Last modified: 2011-03-20 by Unknown