echo "Mail Content" | mail -s "Mail Subject" xxxx@xxx.com
若出现【-bash: mail: command not found】执行如下命令:
yum -y install mailx
Note:if you see below warings after you run above command.
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
that means you don't have IPv6 configured in your OS's network stack, but your mailer (presumably postfix) is configured to use IPv6. Since there is no IPv6 for your mailer to use, it's warning you that it's only going to use IPv4.
To disable the waring messsage, Go to /etc/postfix/main.cf and change from:
inet_protocols = all
to:
inet_protocols = ipv4
This will only use ipv4 and the warning message will go away.
You will have to issue a stop and start for postfix to register the change.
service postfix restart
查看log,确认邮件发送状态
Postfix邮件的log位置是:/var/log/maillog
发送成功的话,会返回250和OK,也可以去自己的邮件客户端查收。
一切OK的话,那Postfix mail service应该就搭建成功了。
查看邮件队列
postqueue -p
2. Add the GitLab package server and install the package