Category Archives: System

Linux 用 tar 指令備份會漏掉隱藏檔

一直以來我都是用以下指令來備份目錄

tar cfv vincent.tar vincet/*

最近才發現這個方式不會備份目錄下的隱藏檔,例如 .cshrc .bash 等檔案。其實只要這樣下指令就 ok 了

tar cfv vincent.tar vincent

應該是 regular expression matching 的問題。

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Mantis 設定 SMTP 認證

通常如果安裝 mantis 的伺服器有跑 sendmail、postfix 的話,這部份採用預設值就可以了。如果 SMTP 是其他的主機或需要認證則必需在 config_inc.php 加入以下設定:

$g_phpMailer_method = 2; (指定採用 SMTP 發信)

$g_smtp_host = ‘<您的 SMTP 主機>’;

如果 SMTP 需要認證要再加以下2行設定

$g_smtp_username = ‘<您的 SMTP 認證帳號>’;

$g_smtp_password = ‘<您的 SMTP 認證密碼>’;

在 mantis 套件的 config_defaults_inc.php 檔案裡有更詳細的說明。

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Zimbra 建立黑名單、白名單

很可惜目前似乎還沒有 GUI 設定界面,所需的設定如下:

1. 修改 /opt/zimbra/conf/amavisd.conf,加入以下2行

read_hash(\%whitelist_sender, '/opt/zimbra/conf/whitelist');
read_hash(\%blacklist_sender, '/opt/zimbra/conf/blacklist');

2. 在 /opt/zimbra/conf 目錄建立 blacklist、whitelist 2個檔案,檔案內每一行放一個 email address。
3. 以 zimbra 身份,執行以下指令重新啟動 antispam 模組

/opt/zimbra/bin/zmamavisdctl restart

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.50 out of 5)
Loading...

Zimbra domain 狀態變更為 suspend 後無法刪除

想不到最新版本都還有這麼嚴重的 bug,解決的方法是先手動執行以下指令

zmprov -l md <被 suspend 的 domain> zimbraDomainStatus active

完成後執行以下指令查看狀態是否正確

zmprov -l gd <被 suspend 的 domain>

這時候以 administrator 登入就可以正常刪除 domain 了

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Postfix 對 SMTP 進出郵件留存複本

1. 進出的信件都留存副本的話只要在 /etc/postfix/main.cf 加一行設定:

always_bcc = <留存副本信箱>

2. 只針對發送出去的郵件留副本

建立 /etc/postfix/sender_bcc_list 檔案,每一行格式為

<sender pattern> <空白> <留存副本信箱>

例如:

@amjet.dyndns.biz archive@amjet.dyndns.biz

然後執行 ‘postmap /etc/postfix/sender_bcc_list’

/etc/postfix/main.cf 需要加入以下設定

sender_bcc_maps = hash:/etc/postfix/sender_bcc_list

3. 只針對送進來的郵件留副本

建立 /etc/postfix/rcpt_bcc_list 檔案,每一行格式為

<recipient pattern> <空白> <留存副本信箱>

例如:

@amjet.dyndns.biz archive@amjet.dyndns.biz

然後執行 ‘postmap /etc/postfix/rcpt_bcc_list’

/etc/postfix/main.cf 需要加入以下設定

recipient_bcc_maps = hash:/etc/postfix/rcpt_bcc_list

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...