MAIL sErver log [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



MAIL sErver log
會員二級
註冊日期:
2015/11/16 9:07
所屬群組:
已註冊使用者
等級: 6
HP : 0 / 137
MP : 19 / 3020
EXP: 48
離線
您好:
若之前有前輩架一個 MAIL ERVER
請問 這些檔案,一般會保留多久,要如何查?

ROOT 會有權限 看到 某個人在 MAIL LOG 中的資料嗎?
其指令 該如何下?
有辦法在mail server log 中刪掉 某人的MAIL log 嗎?
謝謝!

2018/11/11 9:44
應用擴展 工具箱
回覆: MAIL sErver log
會員三級
註冊日期:
2016/4/18 12:29
所屬群組:
已註冊使用者
等級: 9
HP : 0 / 221
MP : 39 / 4600
EXP: 84
離線
Shot Answer

Q:請問 這些檔案,一般會保留多久,要如何查?
A:看Mail Server Package的設定(先不考慮使用外部程式清除)。

Q:ROOT 會有權限 看到 某個人在 MAIL LOG 中的資料嗎?
其指令 該如何下?
Q:有辦法在mail server log 中刪掉 某人的MAIL log 嗎?

A:要先知道Server Package將Log存在哪,才可以進一步處理。

2018/11/12 13:50
應用擴展 工具箱
回覆: MAIL sErver log
會員四級
註冊日期:
2010/8/12 15:54
所屬群組:
已註冊使用者
等級: 18
HP : 0 / 443
MP : 135 / 16578
EXP: 72
離線
wayout 寫到:
您好:
若之前有前輩架一個 MAIL ERVER
請問 這些檔案,一般會保留多久,要如何查?

所謂的這些檔案是哪些?

mail server 的log 要看有沒有送給syslog處理
一般會放在/var/log/ 底下!去看看是log是怎麼放的
另外,是哪一套mail server?

如果是使用者的信件檔,這個當然是不會砍
除非使用者自己刪信或是有做其它的設定


ROOT 會有權限 看到 某個人在 MAIL LOG 中的資料嗎?
其指令 該如何下?
有辦法在mail server log 中刪掉 某人的MAIL log 嗎?
謝謝!

mailserver 的log會有完整的信件傳遞資訊
簡單講就是信從哪來,誰寄的跟寄給誰,信件的編號及存到哪邊去
root 一般來講會有權限,但不一定
如果是另掛nfs 的話就可能沒有
不過root 要看是一定有辦法看的

至於刪掉"某人"的mail log? Why?
以一個系統管理者的身份,刪掉某人的mail log 等於是刪掉某人的通聯記錄
這個有一定的敏感度在
就算老闆交待我也不會去做

2018/11/12 18:02
應用擴展 工具箱
回覆: MAIL sErver log
會員二級
註冊日期:
2015/11/16 9:07
所屬群組:
已註冊使用者
等級: 6
HP : 0 / 137
MP : 19 / 3020
EXP: 48
離線
您好:謝謝您
不過想再請教
1.我只知道是linux 內建的 mail server,還是有指令可以查呢?
2.單存只想刪掉 自己的LOG,我也不想亂搞有的沒的
3.請問查詢 LOG的指令?
4.送出的信 內容也會有紀錄嗎?

謝謝!

2018/11/14 19:52
應用擴展 工具箱
回覆: MAIL sErver log
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29267
EXP: 6
離線
wayout 寫到:
您好:謝謝您
不過想再請教
1.我只知道是linux 內建的 mail server,還是有指令可以查呢?
2.單存只想刪掉 自己的LOG,我也不想亂搞有的沒的
3.請問查詢 LOG的指令?
4.送出的信 內容也會有紀錄嗎?

謝謝!


我對這個沒有深究!

以下只是提供我所知道的相關參考連結,給您參考

* https://help.ubuntu.com/lts/serverguide/email-services.html.en
* https://help.ubuntu.com/18.04/serverguide/email-services.html.en
* http://linux.vbird.org/linux_server/0380mail.php
* http://linux.vbird.org/linux_server/0380mail.php#postfix

2018/11/14 20:00
應用擴展 工具箱
回覆: MAIL sErver log
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29267
EXP: 6
離線
wayout 寫到:
您好:謝謝您
不過想再請教
1.我只知道是linux 內建的 mail server,還是有指令可以查呢?
...略...
謝謝!


剛測試了一下,以下測試環境「Ubuntu 18.04」。

================================================================================

若是系統已經安裝「postfix

執行


$ dpkg -S /usr/sbin/sendmail



會顯示


postfix: /usr/sbin/sendmail



表示「/usr/sbin/sendmail」來自於「postfix」這個「Package」

================================================================================

若是系統已經安裝「exim4

執行


$ dpkg -S /usr/sbin/sendmail



會顯示


exim4-daemon-light: /usr/sbin/sendmail



表示「/usr/sbin/sendmail」來自於「exim4-daemon-light」這個「Package」

================================================================================

以上測試範例,提供參考

================================================================================

## 如何查詢有包含「/usr/sbin/sendmail」的「Package」


$ apt-file search /usr/sbin/sendmail



顯示


citadel-server: /usr/sbin/sendmail
courier-mta: /usr/sbin/sendmail
dma: /usr/sbin/sendmail
esmtp-run: /usr/sbin/sendmail
exim4-daemon-heavy: /usr/sbin/sendmail
exim4-daemon-light: /usr/sbin/sendmail
lsb-invalid-mta: /usr/sbin/sendmail
masqmail: /usr/sbin/sendmail
msmtp-mta: /usr/sbin/sendmail
nullmailer: /usr/sbin/sendmail
opensmtpd: /usr/sbin/sendmail
postfix: /usr/sbin/sendmail
qmail-run: /usr/sbin/sendmail
sendmail-base: /usr/sbin/sendmailconfig
ssmtp: /usr/sbin/sendmail



關於「apt-file」的用法可以參考

* https://wiki.ubuntu.com/AptFile
* https://wiki.debian.org/apt-file

================================================================================

執行


$ apt-file search /usr/sbin/sendmail | awk -F ': ' '{print $1}' | sort -u | awk '{printf "* %s\n", $1, $1}'



可以獲得下面列表的「BBCode」。

* citadel-server
* courier-mta
* dma
* esmtp-run
* exim4-daemon-heavy
* exim4-daemon-light
* lsb-invalid-mta
* masqmail
* msmtp-mta
* nullmailer
* opensmtpd
* postfix
* qmail-run
* sendmail-base
* ssmtp

================================================================================

執行


$ apt-cache search mail-transport-agent | sort



顯示


citadel-server - complete and feature-rich groupware server
clamsmtp - virus-scanning SMTP proxy
courier-mta - Courier mail server - ESMTP daemon
dma - lightweight mail transport agent
esmtp-run - user configurable relay-only MTA - the regular MTA
exim4-daemon-heavy - Exim MTA (v4) daemon with extended features, including exiscan-acl
exim4-daemon-light - lightweight Exim MTA (v4) daemon
lsb-invalid-mta - Linux Standard Base sendmail dummy
masqmail - mail transport agent for intermittently connected hosts
msmtp-mta - light SMTP client with support for server profiles - the regular MTA
nullmailer - simple relay-only mail transport agent
opensmtpd - secure, reliable, lean, and easy-to configure SMTP server
postfix - High-performance mail transport agent
proxsmtp - multi purpose SMTP Proxy
qmail-run - sets up qmail as mail-transfer-agent
sendmail-bin - powerful, efficient, and scalable Mail Transport Agent
ssmtp - extremely simple MTA to get mail off the system to a mail hub



================================================================================

關於如何找到「mail-transport-agent

執行


$ apt-cache show postfix | grep '^Replaces:'



顯示


Replaces: mail-transport-agent



執行


$ apt-cache show mail-transport-agent



顯示


N: Can't select versions from package 'mail-transport-agent' as it is purely virtual
N: No packages found



執行


$ apt-cache show postfix | grep 'mail-transport-agent'



顯示


Provides: default-mta, mail-transport-agent
Conflicts: mail-transport-agent, smail
Replaces: mail-transport-agent



執行


$ man deb-control



使用「Provides」當關鍵字查詢,可以查到下面這段說明


Provides: package-list
	   This  is  a  list of virtual packages that this one provides.  Usually this is used in the case of several packages all providing the
	   same service.  For example, sendmail and exim can serve as a mail server, so they provide a common  package  (“mail-transport-agent”)
	   on  which  other  packages  can depend.  This will allow sendmail or exim to serve as a valid option to satisfy the dependency.  This
	   prevents the packages that depend on a mail server from having to know the package names for all of them, and using ‘|’  to  separate
	   the list.

The  syntax  of  Provides is a list of package names, separated by commas (and optional whitespace).  An optional architecture qualifier can
also be appended to the package name with the same syntax as above.  If omitted, the default is the current binary package architecture.  An
optional exact (equal to) version can also be given with the same syntax as above (honored since dpkg 1.17.11).




執行


$ man apt-cache



使用「virtual」當關鍵字查詢,可以查到下面相關的說明


stats
	stats displays some statistics about the cache. No further arguments are expected. Statistics reported are:

	·   Total package names is the number of package names found in the cache.

	·   Normal packages is the number of regular, ordinary package names; these are packages that bear a one-to-one correspondence between
		their names and the names used by other packages for them in dependencies. The majority of packages fall into this category.

	·   Pure virtual packages is the number of packages that exist only as a virtual package name; that is, packages only "provide" the
		virtual package name, and no package actually uses the name. For instance, "mail-transport-agent" in the Debian system is a pure
		virtual package; several packages provide "mail-transport-agent", but there is no package named "mail-transport-agent".






search regex...
	search performs a full text search on all available package lists for the POSIX regex pattern given, see regex(7). It searches the
	package names and the descriptions for an occurrence of the regular expression and prints out the package name and the short
	description, including virtual package names. If --full is given then output identical to show is produced for each matched package, and
	if --names-only is given then the long description is not searched, only the package name and provided packages are.

	Separate arguments can be used to specify multiple search patterns that are and'ed together.




所以就可以執行下面指令


$ apt-cache search mail-transport-agent



或是也可以執行下面指令


$ apt-cache search mail-transport-agent --full | less



================================================================================

執行


$ aptitude show mail-transport-agent



顯示


No candidate version found for mail-transport-agent
Package: mail-transport-agent
State: not a real package
Provided by: citadel-server (917-2), courier-mta (0.78.0-2ubuntu2), dma (0.11-1build1), dma:i386 (0.11-1build1), esmtp-run (1.2-15),
exim4-daemon-heavy (4.90.1-1ubuntu1), exim4-daemon-light (4.90.1-1ubuntu1), lsb-invalid-mta (9.20170808ubuntu1), masqmail
(0.3.4-1build1), msmtp-mta (1.6.6-1), nullmailer (1:2.1-5), opensmtpd (6.0.3p1-1build1), postfix (3.3.0-1), postfix (3.3.0-1ubuntu0.1),
qmail-run (2.0.2+nmu1), sendmail-bin (8.15.2-10), ssmtp (2.64-8ubuntu2)



執行


$ aptitude search mail-transport-agent



顯示


v mail-transport-agent -
v mail-transport-agent:i386 -



================================================================================

執行


$ grep-aptavail -F Provides mail-transport-agent | less



顯示內容不少,所以就不貼上來了,請自行執行上面指令觀看。

執行


$ grep-aptavail -F Provides -s Package mail-transport-agent | sort -u



顯示


Package: citadel-server
Package: courier-mta
Package: dma
Package: esmtp-run
Package: exim4-daemon-heavy
Package: exim4-daemon-light
Package: lsb-invalid-mta
Package: masqmail
Package: msmtp-mta
Package: nullmailer
Package: opensmtpd
Package: postfix
Package: qmail-run
Package: sendmail-bin
Package: ssmtp



================================================================================

## 更多參考

* https://wiki.debian.org/Packaging/BinaryPackage?highlight=%28virtual%29%7C%28package%29#Virtual_Package
* https://www.debian.org/doc/debian-policy/ch-binary.html#s-virtual_pkg
* https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
* https://www.debian.org/doc/packaging-manuals/virtual-package-names-list.txt
* https://www.debian.org/doc/debian-policy/ch-customized-programs.html#s-mail-transport-agents
* https://www.debian.org/doc/packaging-manuals/build-essential
* https://www.debian.org/doc/packaging-manuals/

================================================================================

若是系統已經安裝「postfix」,可以執行下面三個當中其中一個指令,觀看目前「service postfix」的狀態。

執行


$ /etc/init.d/postfix status



或是執行


$ service postfix status



或是執行


$ systemctl status postfix



================================================================================

若是系統已經安裝「exim4」,可以執行下面三個當中其中一個指令,觀看目前「service exim4」的狀態。

執行


$ /etc/init.d/exim4 status



或是執行


$ service exim4 status



或是執行


$ systemctl status exim4



================================================================================


以上


2018/11/14 20:49
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.