In this example we use Ubuntu linux.
Software: mailutils
Restart postfix after changing postfix config file: main.cf: sudo service postfix restart
First test if you can access gmail through port 25: telnet gmail-smtp-in.l.google.com 25
Test mail with: echo "Hello world" | mail -s "Test Email" -a "From: [email protected]" toMail.com
Or: echo "Test from $HOSTNAME" | mail -s "Everything A okay" -a "From: noreply@$HOSTNAME" [destinationmail.com]
Mail configuration
/etc/mailname > grn.dk
/etc/hostname > grn.dk
hostname grn.dk
/etc/hosts > [IP] grn.dk
/etc/postfix/main.cf >
myhostname = grn.dk
mydestination = $myhostname, localhost
relayhost = [EMPTY]
inet_interfaces = loopback-only