-
Notifications
You must be signed in to change notification settings - Fork 2
/
mail_client.sh
20 lines (16 loc) · 901 Bytes
/
mail_client.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
sudo apt install msmtp-mta -y
printf "\nEnter the email credentials of your smtp client email (Don't add your personal email)\n\n"
read -r -p "Email Address : " smtpMail
read -r -p "Password (Use a gmail app password) : " smtpPass
read -r -p "Email address that you want to receive mails :" smtpDest
sudo cp configs/.msmtprc ~/.msmtprc
sudo chown $USER:$USER ~/.msmtprc
sudo chmod 600 ~/.msmtprc
sed -i "s/from yourmail@gmail.com/from $smtpMail/" ~/.msmtprc
sed -i "s/password password/password $smtpPass/" ~/.msmtprc
sed -i "s/user username/user $smtpMail/" ~/.msmtprc
sudo cp ~/.msmtprc /root/
sudo cp configs/fail2ban_local.conf /etc/fail2ban/jail.d/local.conf
sudo sed -i "s/destemail = dest@mail.com/destemail = $smtpDest/" /etc/fail2ban/jail.d/local.conf
sudo sed -i "s/sender = me@gmail.com/sender = $smtpMail/" /etc/fail2ban/jail.d/local.conf