(原創)某domain(域名) 只收來自某IP的email

freebsd+postfix+postfixadmin:
vi /usr/local/etc/postfix/main.cf
mynetworks = 10.2.91.88/32

smtpd_restriction_classes = your-domain.com
your-domain.com = permit_mynetworks,reject

smtpd_sender_restrictions = check_recipient_access mysql:/usr/local/etc/postfix/mysql_virtual_alias_recipient_maps.cf

vi /usr/local/etc/postfix/mysql_virtual_alias_recipient_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = domain
where_field = address
additional_conditions = and domain = 'your-domain.com'

/usr/local/etc/rc.d/postfix reload


linux+qmail+vpopmail:
vi rcpthosts
delete your-domain.com

vi /etc/tcp.smtp
10.2.91.88:allow,RELAYCLIENT=""

qmailctl cdb

(From INSTALL.TXT)Vacation Postfix+MySQL+Postfixadmin(FreeBSD)

cd /usr/ports/databases/p5-DBI
make install clean
cd /usr/ports/mail/p5-MIME-EncWords
make install clean
cd /usr/ports/mail/p5-Email-Valid
make install clean
cd /usr/ports/mail/p5-Mail-Sendmail
make install clean
cd /usr/ports/databases/p5-DBD-mysql50
make install clean

1. Create a local account
pw groupadd vacation -g 501
pw useradd vacation -u 501 -g 501 -s /sbin/nologin -d /nonexistent -c "Virtual Vacation"

2. Create a directory
mkdir /var/spool/vacation

3. Copy the files
cp -rp /usr/local/www/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation
vi /var/spool/vacation/vacation.pl
my $db_type = 'mysql';

my $db_username = 'postfix';
my $db_password = 'postfix';
my $db_name     = 'postfix';

chown -R vacation:vacation /var/spool/vacation
chmod -R 700 /var/spool/vacation

4. Setup the transport type
vi /usr/local/etc/postfix/master.cf
vacation  unix  -       n       n       -       -       pipe
  flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}

vi /usr/local/etc/postfix/main.cf
transport_maps = hash:/usr/local/etc/postfix/transport

vi /usr/local/etc/postfix/transport
autoreply.jason-tang.com       vacation

postmap /usr/local/etc/postfix/transport
/usr/local/etc/rc.d/postfix restart

5. Postfixadmin Setting
vi /usr/local/www/postfixadmin/config.inc.php
$CONF['vacation'] = 'YES';
$CONF['vacation_domain'] = 'autoreply.jason-tang.com';
$CONF['vacation_control'] ='YES';
$CONF['vacation_control_admin'] = 'YES';

(From Internet)backup incoming and outgoing email(Postfix)

vi /usr/local/etc/postfix/main.cf
sender_bcc_maps = hash:/usr/local/etc/postfix/sender_bcc_maps
recipient_bcc_maps = hash:/usr/local/etc/postfix/recipient_bcc_maps

vi /usr/local/etc/postfix/sender_bcc_maps
Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它

vi /usr/local/etc/postfix/recipient_bcc_maps
Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它

postmap /usr/local/etc/postfix/sender_bcc_maps
postmap /usr/local/etc/postfix/recipient_bcc_maps

/usr/local/etc/rc.d/postfix reload

(源自extmail.org)Postfix 限制部分用戶發送和接收外部郵件(未測試)

http://www.extmail.org/forum/thread-4102-1-1.html
1) 編輯main.cf,在最後添加
smtpd_restriction_classes = local_only,local_only1
local_only = check_recipient_access hash:/etc/postfix/local_domains,reject
local_only1 = check_sender_access hash:/etc/postfix/local_domains,reject
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/local_senders,
 check_recipient_access hash:/etc/postfix/local_recipients,
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_non_fqdn_hostname,
 reject_non_fqdn_sender,
 reject_non_fqdn_recipient,
 reject_unauth_destination,
 reject_unauth_pipelining,
 reject_rhsbl_sender,
 reject_unknown_sender_domain,
 reject_invalid_hostname
注:從第5行開始前面空一格.

2) 新增local-domains,local_senders,local_recipients
local_domains:
  domain.com OK
  192.168.0.1 OK
local_senders:
  Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 local_only
local_recipients:
  Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 local_only1

3)生成db
postmap hash:/etc/postfix/local_domains
postmap hash:/etc/postfix/local_senders
postmap hash:/etc/postfix/local_recipients

4)重啟postfix
postfix reload

(原創)qmail 中clamd 使到server的load average過高的處理方法

load average 高時:(請先停smtp,再停clamd)
1.stop smtp
svc-stop /service/qmail-smtpd
 
2.stop clamd
/etc/init.d/clamd stop
 
load average 降低后:(請先開clamd,再開smtp)
1.start clamd
/etc/init.d/clamd start
********************************************************************************************************
若出現:
[root@S060601 clamav]# /etc/init.d/clamd start
Starting Clam AV daemon: ERROR: Problem with internal logger. Please check the permissions on the /var/log/clamav/clamd.log file.
ERROR: Can't open /var/log/clamav/clamd.log in append mode (check permissions!).
                                                           [FAILED]
(1)chown qscand:qscand /var/log/clamav/clamd.log
(2)/etc/init.d/clamd start
********************************************************************************************************
 
2.start smtp
svc-start /service/qmail-smtpd