# mail U754 MAILER-DAEMON@kd-adm Mon Oct 15 01:00 251/8692 "Undelivered Mail Returned to Sender" >U755 MAILER-DAEMON@kd-adm Mon Oct 15 02:23 251/8692 "Undelivered Mail Returned to Sender" U756 MAILER-DAEMON@kd-adm Mon Oct 15 02:23 246/8417 "Undelivered Mail Returned to Sender"
# 756
# h U754 MAILER-DAEMON@kd-adm Mon Oct 15 01:00 251/8692 "Undelivered Mail Returned to Sender" U755 MAILER-DAEMON@kd-adm Mon Oct 15 02:23 251/8692 "Undelivered Mail Returned to Sender" > 756 MAILER-DAEMON@kd-adm Mon Oct 15 02:23 246/8417 "Undelivered Mail Returned to Sender"
# d 750-753
# ll /var/spool/mail/ 合計 0 -rw-rw---- 1 istadmin mail 0 8月 2 19:53 2013 root -rw-rw---- 1 istpika mail 0 8月 2 19:53 2013 taro # rm -rf /var/spool/mail/root
メール本文入力後、ピリオドで送信
# mail -s "SUBJECT" clown@example.com -- -f FROM@mail.com mail body . EOT
メール本文入力後、ピリオドで送信
# mail -s "SUBJECT" -r FROM@mail.com clown@example.com mail body . EOT
# crontab -e
MAILTO="" */1 * * * * /usr/local/bin/exec
# vi /etc/crontab
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin #MAILTO=root MAILTO="" HOME=/ # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed
# vi /etc/anacrontab
# /etc/anacrontab: configuration file for anacron # See anacron(8) and anacrontab(5) for details. SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin #MAILTO=root MAILTO="" # the maximal random delay added to the base delay of the jobs RANDOM_DELAY=45 # the jobs will be started during the following hours only START_HOURS_RANGE=3-22 #period in days delay in minutes job-identifier command 1 5 cron.daily nice run-parts /etc/cron.daily 7 25 cron.weekly nice run-parts /etc/cron.weekly @monthly 45 cron.monthly nice run-parts /etc/cron.monthly
# vi /etc/cron.d/0hourly
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin #MAILTO=root MAILTO="" HOME=/ 01 * * * * root run-parts /etc/cron.hourly
mailコマンドで送信時に次のような警告が出る。
send-mail: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol send-mail: warning: inet_protocols: configuring for IPv4 support only postdrop: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol postdrop: warning: inet_protocols: configuring for IPv4 support only
プロトコルはIPv4とIPv6が両方とも対応になっているようなので、設定ファイル(/etc/postfix/main.cf)を開き、ipv4 だけにする。
# vi /etc/postfix/main.cf
#inet_protocols = all inet_protocols = ipv4
デーモン再起動。
# /etc/init.d/postfix restart