don't dream your life, live your dreams !
I assume that you have a Centos installation.
You can copy/paste this script and use it to configure automatically your server.
#!/bin/bash echo "install postfix" dnf -y install postfix dnf -y remove sendmail # make postfix the default MTA echo "start service" systemctl start postfix.service echo "configure postfix" # comments all: sed -i "s/^\(inet_interfaces = \)/#\1/" /etc/postfix/main.cf sed -i "s/^\(mydestination = \)/#\1/" /etc/postfix/main.cf # remove comments: sed -i "s/^#\(inet_interfaces = all\)/\1/" /etc/postfix/main.cf sed -i "s/^#\(home_mailbox = Maildir\/\)/\1/" /etc/postfix/main.cf sed -i "s/^#\(mydestination = \$myhostname, localhost.\$mydomain, localhost, \$mydomain\)$/\1/" /etc/postfix/main.cf echo "reload postfix" systemctl reload postfix.service echo "add service smtp (port 25) to firewall" firewall-cmd --permanent --add-service smtp firewall-cmd --reload
First, we create our email file ’email.txt’:
Subject: my subject my message
Then, send it:
sendmail -v example@gmail.com < email.txt |
$> telnet srv-mail 25 $> helo srv-mail mail from:<noreply@gmail.com> rcpt to:<my-email@gmail.com> data From: noreply@gmail.com Subject: test mail from command line this is my tiny message sent from linux . |
You can copy/paste this script and use it to configure automatically your server.
#!/bin/bash echo "install dovecot" dnf -y install dovecot echo "configure dovecot" sed -i "s/^#\(protocols\s*=\)/\1/" /etc/dovecot/dovecot.conf echo "start service dovecot on boot" systemctl enable dovecot.service echo "start service" systemctl start dovecot.service echo "open pop3 port (i.e 110) and imap (i.e. 143)" firewall-cmd --permanent --add-service dovecot
Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.
admin