[Email protected]/]# mail-s "Message" [email protected] </tmp/info.message
The system by default to "[email protected] hostname" To send mail, receive mail directly to be considered as spam, it can be customized mailbox to send mail?
The answer is sure to do.
Download MAILX Package
MAILX Official Site http://heirloom.sourceforge.net/
Download latest Version mailx-12.4.tar.bz2 (271.5 KB)
Http://sourceforge.net/projects/heirloom/files/latest/download?source=files
[Email protected] software]# TAR-JXVF mailx-12.4.tar.bz2
[Email protected] software]# CD mailx-12.4
[[email protected] mailx-12.4]# make
OPENSSL.C:108: Error: expected declaration specifiers or ' ... ' before ' STACK '
OPENSSL.C: In the function ' Ssl_select_method ':
openssl.c:215: Warning: Assignment discards the qualification of the pointer target type
openssl.c:217: Warning: Assignment discards the qualification of the pointer target type
openssl.c:219: Warning: Assignment discards the qualification of the pointer target type
openssl.c:223: Warning: Assignment discards the qualification of the pointer target type
openssl.c:226: Warning: Assignment discards the qualification of the pointer target type
OPENSSL.C: In the function ' Ssl_check_host ':
openssl.c:311: Error: ' STACK ' is not declared (first use within this function)
openssl.c:311: Error: (even if multiple occurrences occur within a function, each undeclared identifier is in its
openssl.c:311: Error: The function inside is also reported only once. )
openssl.c:311: Error: ' Gens ' not declared (first use within this function)
OPENSSL.C: At the file level:
openssl.c:499: Error: expected declaration specifiers or ' ... ' before ' STACK '
OPENSSL.C: In the function ' smime_verify ':
openssl.c:508: Error: ' STACK ' is not declared (first use within this function)
openssl.c:508: Error: ' certs ' not declared (first use within this function)
openssl.c:508: Error: ' Gens ' not declared (first use within this function)
OPENSSL.C:555: Error: ' Chain ' not declared (first use within this function)
OPENSSL.C: In the function ' cverify ':
openssl.c:617: Error: ' STACK ' is not declared (first use within this function)
openssl.c:617: Error: ' Chain ' not declared (first use within this function)
openssl.c:649: Error: Too many arguments supplied to function ' smime_verify '
OPENSSL.C: In the function ' Smime_encrypt ':
openssl.c:690: Error: ' STACK ' is not declared (first use within this function)
openssl.c:690: Error: ' certs ' not declared (first use within this function)
OPENSSL.C: In the function ' Smime_certsave ':
openssl.c:953: Error: ' STACK ' is not declared (first use within this function)
openssl.c:953: Error: ' certs ' not declared (first use within this function)
openssl.c:955: Error: ' Chain ' not declared (first use within this function)
Makefile:80:recipe for Target ' OPENSSL.O ' failed
Make: * * * [OPENSSL.O] Error 1
An error appears, see the documentation help below
Http://www.linuxfromscratch.org/blfs/view/stable/basicnet/mailx.html
Original poor patch, fix him
[Email protected] mailx-12.4]# wget http://www.linuxfromscratch.org/patches/blfs/7.6/mailx-12.4-openssl_1.0.0_ Build_fix-1.patch
[Email protected] mailx-12.4]# patch-np1-i Mailx-12.4-openssl_1.0.0_build_fix-1.patch
Patching file Makeconfig
Patching file openssl.c
#修复补丁成功
[email protected] mailx-12.4]# make clean #清除历史编译后文件
[email protected] mailx-12.4]# make #再次编绎
[[email protected] mailx-12.4]# make install Ucbinstall=/usr/bin/install
/usr/bin/install-c MAILX/USR/LOCAL/BIN/MAILX
Strip/usr/local/bin/mailx
test-d/usr/local/share/man/man1 | | Mkdir-p/usr/local/share/man/man1
/usr/bin/install-c-M 644 mailx.1/usr/local/share/man/man1/mailx.1
test-d/etc | | Mkdir-p/etc
Test-f/etc/nail.rc | | \
/usr/bin/install-c-M 644 nail.rc/etc/nail.rc
[[email protected] bin]# vim/etc/nail.rc #编辑nail. RC Configure external SMTP information
Set [email protected] smtp=smtp.qiye.163.com
Set [email protected] smtp-auth-password=xxxxx Smtp-auth=login
[[Email protected] mailx-12.4]# service postfix Reload #重新加载postfix, can not be restarted.
Test it.
[Email protected] mailx-12.4]# mail-s "Message" [email protected] </tmp/info.message
The message was sent successfully, but why did you receive the e-mail sent by [email protected]?
[Email protected] mailx-12.4]# Whereis MAILX
MAILX:/bin/mailx/usr/bin/mailx/usr/local/bin/mailx/usr/share/man/man1/mailx.1/usr/share/man/man1/mailx.1.gz/ Usr/share/man/man1p/mailx.1p.gz
Oh, the reason is that the newly installed package does not take effect, either executing or the original path, replacing him.
[Email protected] mailx-12.4]# Cd/bin
[Email protected] bin]# RM-RF MAILX
[Email protected] bin]# ln-s/USR/LOCAL/BIN/MAILX MAILX
[Email protected] bin]# mailx-v
[Email protected] bin]# mail-s "Message" [email protected] </tmp/info.message
This succeeds.
This article is from the "Home_tang" blog, make sure to keep this source http://yagetang.blog.51cto.com/1780698/1591989
Linux under Configuration using external SMTP outgoing mail