===== Overview =====
[[http://tmade.de|Home tmade.de]]
[[http://wiki.tmade.de|Home Wiki]]
==== telnet ====
Please follow the instruction to send a mail via telnet:
------
Mailserver testing
------
telnet localhost 25
.
.
.
helo testmail.org (Identify and demanding SMTP-Modus)
mail from:test@testmail.org (addressor/ sender)
rcpt to:test_receiver@linux.de (Receiver)
data (enables to write mailcontent)
. (quit insert mode)
QUIT (close session)
Tip:
reset enable to send addtional emails
**Note:** ThereĀ“s "helo" and "ehlo". Difference:
"helo" = Welcome to the server
"ehlo" = Enhanced HELO
==== mail ====
An email can be send from comandline with the progamm "mail".
Example:
MAILADDR=myemail@test.de
echo "Test" | mail -s "Another Test" ${MAILADDR}
echo "Test" | mail -s "Another Test for ${HOST} - `date`" ${MAILADDR} -a "FROM: mail@domain.org" #Include sender-adress - old syntax until ~ 2010
echo "Test" | mail -s "Another Test for ${HOST} - `date`" ${MAILADDR} -r "mail@test.de" #Include sender-adress "mail@test.de" for newer "mail" version
echo "test" | mail -s "Test mail" -S "smtp=10.1.2.3" "to-adress@test.de" -r "from-adress@test.de" #Include mailrelay "10.1.2.3"
==== sendmail ====
Another way to send mails via commandline/ scripts:
First you have to create a file called "text" with example content:
To: username@domain.com
Subject: any-text
From: username@domain.com
Any mail content!
**Note:** There **must** be an empty line between "From:" and "Content"!!
Create a executable script (e.g. permission 755) to send the mail (also to run it with cronjobs for automatism):
#!/bin/bash
/bin/cat /scripts/text | /usr/sbin/sendmail -t
Another way:
#!/bin/bash
/bin/cat <
==== wall ====
To send a notification to local connected users:
echo "SYSTEM BEING SHUT DOWN IN 5 MINUTES" | wall #Message to local connected users