zoukankan      html  css  js  c++  java
  • postfix所谓的监控功能只是利用sender_bcc而已

    postfix所谓监控的监控功能是利用sender_bcc,我测试了一下很容易做到。

    修改main.cf
    [root@localhost etc]# vi ./postfix/main.cf
    sender_bcc_maps = mysql:/etc/postfix/mail_watch.cf
    recipient_bcc_maps = mysql:/etc/postfix/mail_watch.cf

    再建个 mail_watch.cf
    [root@localhost postfix]# vi mail_watch.cf
    user=lcx //数据库的用户名
    password=123456 //数据库的密码
    dbname=postfix //库名
    table=mail_watch //表名
    select_field=bcc //监控信箱
    where_field=sender //被监控的信箱
    hosts=localhost //服务器名

    建表,再建一个lcx数据库用户,测试了下postfix的cf空密码无效

    mysql> CREATE TABLE `mail_watch` (   
      `sender` varchar(100)  NOT NULL,   
      `bcc` varchar(100)  NOT NULL,   
      PRIMARY KEY  (`sender`)   
    );

    mysql> grant  all  on  postfix.*   to   lcx@localhost  identified  by  '123456';

    mysql> desc mail_watch;
    +--------+--------------+------+-----+---------+-------+
    | Field      | Type            | Null    | Key  | Default  | Extra  |
    +--------+--------------+------+-----+---------+-------+
    | sender  | varchar(100)  | NO    | PRI   |         |       |
    | bcc       | varchar(100)  | NO    |         |         |       |
    +--------+--------------+------+-----+---------+-------+
    2 rows in set (0.00 sec)

    lcx@vb.net.cn 为监控邮箱,123@vb.net.cn是被监控的信箱

    mysql> INSERT INTO mail_watch(sender,bcc) VALUES ('123@vb.net.cn','lcx@vb.net.cn');
    mysql> select * from mail_watch;
    +---------------+---------------+
    | sender            | bcc                |
    +---------------+---------------+
    | 123@vb.net.cn | lcx@vb.net.cn |
    +---------------+---------------+
    1 row in set (0.00 sec)

    以上方法已经测试通过

  • 相关阅读:
    bzoj3530 [SDOI2014]数数
    bzoj3940 Censoring
    线性代数基础
    hdu1085 Holding Bin-Laden Captive!
    hdu1028 Ignatius and the Princess III
    luogu2000 拯救世界
    博弈论入门
    树hash
    luogu2173 [ZJOI2012]网络
    luogu1501 [国家集训队]Tree II
  • 原文地址:https://www.cnblogs.com/LCX/p/1385449.html
Copyright © 2011-2022 走看看