Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash -x
echo "this command must be executed in root user."
if [ ${EUID:-${UID}} != 0 ]; then
echo 'do this with being root . for example : sudo su - '
exit 1;
## install maildev
yum -y install nodejs npm postfix
npm install -g maildev
npm install -g iconv
## daemonize maildev
wget ""
chmod +x maildev
mv maildev /etc/init.d/
systemctl enable maildev
systemctl restart maildev
systemctl status maildev
## add php setting
echo -e "[mail function]\nSMTP = localhost\nsmtp_port = 1025" > /etc/php.d/maildev.ini
## add postfix setting
cp /etc/postfix/{,}
echo "relayhost =" >> /etc/postfix/
systemctl enable postfix
systemctl restart postfix
systemctl status postfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment