Mail Server 移機--後記

Mail Server in the machine after a shift and start to test ok, but over the past few days has occurred several problems. DNS aspects aside for the moment and the local server has some problems.

First : When sign openwebmail and it displayed "can not read lock /var/spool/mail/user! " or " Unknown error at user write lock error ) : " After an investigation and discovered that the original mail owner was lost, mail owner became root. I do not know all of accounts the passwords and were unable to test how many lost, so change one by one. However, my good friend Pcpark provide a batch file to modify quickly and saved a lot of time. Create a text file that contains all the mail users account and create a batch file to execute. For example :

#vi chownuser

may

john

apple

joe

mary

arthur

stacy

lee

jack

Save it.

#vi chownuser.sh

#!/bin/sh

for name in `cat chownuser`
do
chown $name.mail $name
done

Save it.

These two files on the mail directory and then execute.

#sh chownuser.sh

This will help you change all of mail owners! ^ ^

2nd : Some people sign will be displayed at the bottom bunch .

Software error:

Undefined subroutine &ow::htmltext::str2html called at /var/www/cgi-bin/openwebmail/shares/ow-shared.pl line 1283.

For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

The problem is user's home directory mistakes, as long as back into their original position.

Third : This is a big problem, the PC is not to be mail server originally. So the partition for /var in the first place is not allocated greater capacity, so the mail will fill /var partition. Don't re-install........ Finally I think solution in the bath:

#cd /var/spool/

#mkdir /home/mail

#mv /var/spool/mail/* /home/mail

#chown root.mail /home/mail

#mv mail mail_old

#ln -s /home/maol /var/spool/mail

As a result, all letters moved to /home/mail underground. If there is the question of mail owner occurred, you want to change mail owner again.

#cd /home/mail

#sh chownuser.sh

Done!^^


Mail Server在移機之後一開始試OK的,可是過幾天卻遇到許多的問題,DNS方面暫且不談,本機就有一些問題了。

第一:登入openwebmail時顯示"讀取無法鎖定 /var/spool/mail/user!

"或是"Unknown error at user write lock error):"經查證之後才發現,原來有些mail的權限已經跑掉了,擁有者變成root而不昰user本身,因我無所有user的帳號密碼,不能一一 測試到底有哪些權限跑掉了,於是就一個一個改權限。不過,我的好朋友pcpark提供一個batch改權限的方式,讓我省了不少時間:

先做一個文字檔,裡頭包含所有mail使用者的帳號,再寫一個sh檔來batch。範例如下:

#vi chownuser

may

john

apple

joe

mary

arthur

stacy

lee

jack

存檔.

#vi chownuser.sh

#!/bin/sh

for name in `cat chownuser`
do
chown $name.mail $name
done

存檔.

這兩個檔案一同放在mail目錄裡,然後執行。

#sh chownuser.sh

這樣就會幫你全部改好mail的擁有者了!^^

第二:有人登入時會顯示下面這一串

Software error:

Undefined subroutine &ow::htmltext::str2html called at /var/www/cgi-bin/openwebmail/shares/ow-shared.pl line 1283.

For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

這個問題昰user的家目錄位置錯誤了,只要放回原來的位置就可以了,哈!

第三:這是一個大問題,原本此PC不是要用來當作mail server的,所以當初在partition時倂沒有給/var很大的容量,所以移過來的/var/mail一下子就會把該partition塞爆,不想重灌.......。終於在洗澡時想到解決的方式:

把/var/spool/mail裡的信件移到/home底下去

#cd /var/spool/

#mkdir /home/mail

#mv /var/spool/mail/* /home/mail

#chown root.mail /home/mail

#mv mail mail_old

#ln -s /home/maol /var/spool/mail

這樣一來,信件就全部轉移到/home/mail底下了。

如果還有發生權限的問題,就再去修改各個權限。

#cd /home/mail

#sh chownuser.sh

完畢!^^

0 Responses