本站即日起正式部署SSL证书启用https安全连接, 联系站长:416326801#qq.com(#改成@)

Latest from the blog

postfix配置文件main.cf

标签: Postfix

cat /etc/postfix/main.cf
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop

#yuli's config
smtpd_reject_unlisted_recipient = no
enable_original_recipient = no
always_bcc = [email]mail@whgwbn.net[/email]

# hostname
mynetworks = 127.0.0.1
myhostname = mail.whgwbn.net
mydomain = whgwbn.net
mydestination = $mynetworks, $myhostname

# banner
mail_name = EMOS V1.6 (Postfix)
smtpd_banner = $myhostname ESMTP $mail_name

# response immediately
smtpd_error_sleep_time = 0s
unknown_local_recipient_reject_code = 550

# extmail config here
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = maildrop:

# maildrop setting
maildrop_destination_recipient_limit = 1

# smtpd related config
smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_hostname,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unauth_destination,
        reject_unauth_pipelining,
        reject_invalid_hostname,
        check_policy_service inet:127.0.0.1:10030

header_checks = regexp:/etc/postfix/dspam_header_checks

# SMTP sender login matching config
smtpd_sender_restrictions =
        permit_mynetworks,
        reject_sender_login_mismatch,
        reject_authenticated_sender_login_mismatch,
        reject_unauthenticated_sender_login_mismatch

smtpd_sender_login_maps =
        mysql:/etc/postfix/mysql_virtual_sender_maps.cf,
        mysql:/etc/postfix/mysql_virtual_alias_maps.cf

# SMTP AUTH config here
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous

# Content-Filter
#content_filter = smtp-amavis:[127.0.0.1]:10024
#receive_override_options = no_address_mappings

# Message and return code control
#message_size_limit = 52428800
#mailbox_size_limit = 52428800
message_size_limit = 104857600
mailbox_size_limit = 104857600


show_user_unknown_table_name = no

# Queue lifetime control
bounce_queue_lifetime = 1d
maximal_queue_lifetime = 1d

# Other settings
# TLS configuration
smtpd_use_tls = yes
smtpd_tls_auth_only = no
smtp_tls_CAfile = /etc/postfix/tls/smtpd.pem
smtp_tls_cert_file = /etc/postfix/tls/smtpd.pem
smtp_tls_key_file = /etc/postfix/tls/smtpd.pem
smtpd_tls_CAfile = /etc/postfix/tls/smtpd.pem
smtpd_tls_cert_file = /etc/postfix/tls/smtpd.pem
smtpd_tls_key_file = /etc/postfix/tls/smtpd.pem
smtpd_tls_received_header = yes
smtpd_tls_loglevel = 0
smtpd_starttls_timeout = 60s

Linux服务器备份文件和数据库并上传到ftp

标签: 备份 MySQL Shell Linux

#!/bin/sh

backupdir="/home/data/backup/"
if [ ! -d $backupdir ];then
        mkdir $backupdir
fi

# mkdir today backup
today=`date +%Y-%m-%d_%H_%M_%S`
fpath=$backupdir$today 
echo $fpath
if [ ! -d $fpath ];then
        mkdir $fpath
fi

# delete old file 
find $backupdir -type f -mtime +7 -print -exec /bin/rm -f {} \;

FL=`cat /usr/local/backup/file_list`
for i in $FL ;do
        cp -Rp $i $fpath
done

#backup mail dir
find /home/data/domains -type d >$fpath/maildirlist

# backup mysql all
/usr/local/bin/mysqldump --all-databases -uroot -pyourpasswd >$fpath/mysql_all.sql

# backup my self 
cp -Rp $0 $fpath
cp -Rp /usr/local/backup/file_list $fpath

cd $backupdir
tar czf $today.tar.gz $today
rm -rf $today
cd -

# ftp ...
ftp -n<<!
open 192.168.1.3 21
user backup backup
binary
lcd $backupdir
prompt off
mdelete *
mput *
bye
!

Linux配置NTP服务器ntp.conf

标签: Linux

cat /etc/ntp.conf 
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 
restrict -6 ::1

restrict default nomodify


# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool ([url]http://www.pool.ntp.org/join.html[/url]).
#server 10.206.3.5
server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography. 
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats
«« First 19 20 21 22 23 24 25 26 27 28 ... Next »