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

完畢!^^

Mail Server 移機完畢

Because of the recent mail server was hacked and I also FreeBSD wake unable to make the best management, therefore take this opportunity to move Mail Server to Fedora Core 6. Previously prepared to put the work in advance is create all of the user accounts of FreeBSD in FC6. But no one should create account one by one! After all, the units have nearly 200 people Account. Therefore, due to this Webmin installed a suite, so we can export substantial account:

Login the FreeBSD system which own webmin service --->System---> Users and Groups --->Export users to select batch file--->Select the users and their options --->Export NOW

Login Fedora Core 6's webmin--->System --->Users and Groups--->Create, modify and delete users from batch file --->Browse you file---> select the set options --->Execute batch

Waitting implementation of the batch file .... . Done! ^ ^

This preparatory work is finish! Finish a "major event"!

Next, should the FreeBSD mail and mail folders of user home directory (because it was installed the openwebmail) transfer to FC6 (I use is that I want, is probably the most stupid way. .)

In FreeBSD :

#cd var * FreeBSD because my mail is under the /var

#tar zcvf mail.tar.gz mail/

*Entire mail folder compressed into one of tarball

# mv mail.tar.gz /var/www/html/ *moved to the web underground

# cd / * under /

#tar zcvf home.tar.gz home/ *all user home folders under /home

#mv home.tar.gz /var/www/html/ *moved to the web underground

Fedora Core 6 :

#cd /

#wget http : //freebsd.domain/home.tar.gz

*Catch FreeBSD's home directory file backup

#tar zxvf home.tar.gz

*decompress home.ta r.gz. This will directly cover the original home
directory file name all the same file or folder

#rm -rf home.tar. gz * Remove have already decompress off tarball

#cd /var/spool *to mail stored in the folder on the floor

#wget http://freebsd.domain/mail.tar.gz *FreeBSD's mail backup file.

#tar zxvf mail.tar.gz *decompress mail backup file

#rm -rf mail.tar.gz *delete the mail.tar.gz has been used.

Don't forget to back to FreeBSD to delete the files that are homr.tar.gz and mail.tar.gz under the website root directory! Otherwise, people can download arbitrary your backup file is, of course, your web servers are the starting. Now almost completed. YA!



最近因為Mail Server常被入侵,而且FreeBSD我也不熟,無法作最好的管理,於是趁此機會要將Mail Server移到Fedora Core 6上。

先前要準備的工作事先把FreeBSD上的使用者帳號在FC6上在重建一次,但應該沒有人會一個一個來重建吧!畢竟我們的單位也有將近兩百人的帳號。於是,因本身有安裝Webmin此一套件,所以我們可以把帳號大量匯出:

登入 FreeBSD的webmin--->系統--->使用者與群組--->Export users to batch file--->選好要匯出的使用者及其選項--->Export NOW

登入 Fedora Core 6的webmin--->系統--->使用者與群組--->使用批次檔一次過建立/修改/刪除使用者--->Browse你會出的檔案--->--->選好要設定的選項--->執行批次檔

Waitting.....Done! ^^

這樣先前的準備工作就做完了!做完一件”大事”了!

接下來要把FreeBSD上的mail及家目錄裡的mail資料夾(因為有裝openwenmail)轉移到FC6上(我用的是我想得到的方法,可能是最笨的方法。@.@)

在FreeBSD端

#cd /var *因我的bsd的mail是放在/var/mail底下

#tar zcvf mail.tar.gz mail/ *把整個mail資料夾壓縮成一個tar.gz的壓縮檔

# mv mail.tar.gz /var/www/html/ *移到網頁目錄底下

# cd / *到 / 底下

#tar zcvf home.tar.gz home/ *所有人的家目錄在home底下

#mv home.tar.gz /var/www/html/ *一樣移到網頁目錄底下

Fedora Core 6上

#cd /

#wget http://freebsd.domain/home.tar.gz

*把FreeBSD上所有人的家目錄備份檔抓過來

#tar zxvf home.tar.gz

*解開home.tar.gz,此會直接覆蓋原來家目錄裡所有檔名相同的檔案或資料夾

#rm -rf home.tar.gz *刪除已經解開過的壓縮檔(不解開就是暫空間而已)

#cd /var/spool *到FC6上存放mail的資料夾的上一層

#wget http://freebsd.domain/mail.tar.gz

*把FreeBSD上的mail備份檔抓過來
#tar zxvf mail.tar.gz *解開mail備份檔

#rm -rf mail.tar.gz *刪除已經用過的mail備份檔

記得回到FreeBSD上把網頁根目錄下的home.tar.g及mail.tar.gz都刪掉喔!不然別人是可以任意下載您的備份檔的,當然是您的網頁伺服器有開的情況下。

至此差不多就完成了!。

Beach, Hot, Fry Shrimp | 海灘、熱、蝦子

Under sunshine, someone beach। Rare people here, who were scattered around the beach। Between the beach and surrounding roads are several the street vendors। Although the weather is so hot that can only let people hear their heavy breathing , but there was a lively atmosphere, as if there are many unvisible people on your side, and not feel bored। It just hot~hot ~hot! Along the beach road and walk the line, want to find the street vendors to drink। Suddenly, a school female colleagues sale fry shrimp, she is also one of the vendors। The strange thing is that her business has been remarkably good under this hot beach। I take her final shrimp, Shelling, eating incomplete shrimp meat, courtesy to say : "It's delicious! "

" Sorry, this is the last one, no! , "She said with a smile.
I also smile : "Never mind, there are opportunities for the future "
" If you are willing to help me with the tools stalls, and perhaps I can give you some? "She asked
"No problem, even if there is no fry shrimp I will be happy to help."
Her work kitchen in another side of the beach. Here only has a small wooden house overlooking the sea and on th beach with a few strokes that be hanged breaking flues. But doesn't exist a small broken boat, lost some miserable feeling.
Tools moved to put next to the washbasin.
"If there are cool watermelon to eat, it the more wonderful! "She washing bowl side edge and humorous said.
"This simple! "I smiled
With these words, I face the sea, invoke by a gesture like a ninjas and shout "Shadow duplicable skill, watermelon come~~".
Without the expected emergence of numerous me, but there have a gas from my legs into the sea. Mess into a white skin and green lines watermelon. Waiting for approaching me, proudly pick it up and give her. Here ! For you! "Surprise! How do you have? Look good to eat. " She did not see that I just do.
"You need not care so much, just eat enough. " I talk to her with a smile :" Can I help you to carve? Forget it, your own good. " I gave her and go in a room next to the kitchen to help her string of fry shrimp."
Of course, when saw plump fry shrimp always sent to my mouth. Afraid she found, but ate very happy that I was laughing in my mind. "A cool watermelon for a few fry shrimp , OK! "
About ate less than three fry shrimp, look the scenery outside, the sun still makes people unable to open their eyes. Afar appeared a small figure on the white beach unexpected point, regardless, continues the "Watermelon for fry shrimp" and with her, I did not communicate.
My brother appeared by riding a bicycle, just the original black spots was my brother.
He Rode around me : "Brother! Do you know where Daddy? "
" He seems to uncle's home. "
He said" Oh ! It's OK! I go to find him now. Do you have something for him? "
I gave him several fry shrimp, like these fry shrimp were mine, said : "Take to eat with daddy. "
Happiest he said :" OK! Bye! "Brother left.
I Ports string well fry shrimp to the colleagues and then said :" Well, this is your fry shrimps."
Gave all the shrimps to her and calmly said :" I have gone, goodbye! "Turnabout and leave.
"Wait! "She suddenly exclaimed.
I scare in my mind, Was it possible that eating fry shrimps behavior was found?
"Do you like me, or how to give me so much favor? "She calm and without feeling.
I vent their anger :" Do you think too much of it! I just have nothing to do in the seaside. "
"What help you don't want to return, and to no purpose. " End the word and turned left.
"Hey ~" she shouted behind me.
.....................

(Alarm clock rang really time! )
------------------------------------
艷陽下,某個沙灘上。這裡沒有什麼人,稀稀落落人散落在沙灘各地,圍繞在沙灘與馬路之間的是零落的攤販,雖然天氣熱得讓人只聽到自己沉濁的呼吸聲,但卻有一股熱鬧的氣氛,彷彿有許許多多的人氣就在你身邊,不會覺得無聊,只是熱~熱~熱~~。
沿著沙灘與道路間的界線走,想找個可以暢飲的攤販。卻發現,一個同校的女同事在賣炒蝦子,她也是攤販之一。奇怪的是在如此逼人低頭的日照下,她的生意卻出奇的好。我接過她鍋底下最後一隻不完整的蝦子串,撥了殼,吃掉勉強湊合的完整蝦肉,禮貌性的對她說:「好吃!」
「抱歉,這是最後一隻,沒有了!」她笑著說。
我還以笑容
「沒關係,以後還有機會。」
「如果你願意幫我一起把攤位的工具搬回去,也許我可以再拿幾隻給你吃?」她問道。
「沒問題,就算沒有蝦子我也樂意幫忙。」正好打發百無聊賴的時間
她的工作廚房在海攤的另一側,這裡只有面海的一間小木屋與白沙上幾根似乎隨意立起掛著破網的木頭,卻沒有該存在而不用的小破船,少了一點蒼涼的味道。
把工具搬到洗手檯旁。
「如果現在有清涼的西瓜可以吃那該有多好啊!」她邊洗鍋子邊打趣的說。
「這個簡單!」我笑著對她說。
說罷,我面對海洋,擺出忍者唸咒的姿勢,右手結印,左手握拳砥柱右手掌,雙腿蹲馬步,喊著:
「影分身之術,西瓜~~」沒有預期中出現很多個我,卻有一股氣衝向海面,匯成一團,變成白色外皮綠色線條的西瓜。等待它飄向我,得意的拿起西瓜遞給她,喏!給你吃吧!
「哇塞!你怎麼會有?看起來很好吃的樣子。」
可見,她剛剛並沒有看到我做的事情。
「你不用管這麼多,有得吃就好了。」我面帶微笑的對她說「要我幫你切嗎?算了,你自己來好了。」
我遞給她之後就逕自走到廚房旁的房間幫她串蝦子,當然,看到肥美的蝦子總是往自己嘴裡送。怕被她發現,又偷吃的很開心,我心裡竊笑
「一顆清涼西瓜換幾隻蝦子,OK吧!」
約莫吃了三隻蝦子,望著屋外的景色,陽光還是讓人無法完全睜開眼睛。遠方出現一個細小的身影,在白色沙灘上突兀的一點,不管,埋頭繼續著理所當然的
「西瓜換蝦子」行為,而且我與她也沒在交談。
我弟弟騎著腳踏車出現了,原來剛剛的黑點是我第弟。
他騎到我身邊:
「哥!你知道爸爸在哪裡嗎?」
「他好像去舅舅家了。」我說
他疑惑「是喔!好吧!我現在去找他,你要拿東西給他嗎?」
我抓起一把身旁被我串直的蝦子塞到袋子,就像這些蝦子是我的一樣,然後遞給我第弟說
:「這些給爸吃,你也一起吃。」
弟弟開心的說:
「好!那我走囉!」
弟弟剛走,我就端起串好的蝦子走向那位女同事,然後說:
「好了,這是你的蝦子。」把所有的蝦子遞給她,若無其事的說:「我得走了,再見!」轉身,起步。
「等等!」她突然喊道,我心中一顫,偷吃蝦子的行為被發現了嗎?
「你是不是喜歡我,不然怎麼願意幫我這麼多忙?」她平靜而不帶感情
我心裡吁了一口氣
:「你想太多了吧!我是正好沒事,在海邊閒晃罷了。」我毫無表情,語帶一絲的氣惱:「幫忙不是要什麼回報的,也沒有什麼目的!」語畢,轉身就走。
「喂~」在我身後她叫道。
.....................
(鬧鐘響了,真是時候!)