Portál AbcLinuxu, 20. července 2025 12:10
Řešení dotazu:
set realname="Joe User" set from="user@host" set use_from=yesNN
$ echo "konecne to funguje" | ./mailx -s predmet adresat@domena.tld
$ cat mailx
#!/bin/bash
DATA=`echo 0`
SUBJECT=$2
MAILTO=$3
if [[ $1 != "-s" || $2 == "" || $3 == "" || $DATA == "" ]]; then
echo "Usage: mailx -s subject to-addr"
exit 1
fi
#### SEND MAIL via RAW TCP #######
exec 3<>/dev/tcp/localhost/25
if [ $? -ne 0 ] ; then
echo "ERROR: Cannot connect to the Mail Server";
echo "Please check the servername and/or the port number"
exit 2
fi
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.