以往透過mail relay server 去發信 無須指定sender ,
但如果遇到需指定sender 的relay smtp server , 則需透過nail 指令.
今天把/etc/nail.rc 加入正確的ip 對應 , 就成功了
但如果遇到需指定sender 的relay smtp server , 則需透過nail 指令.
今天把/etc/nail.rc 加入正確的ip 對應 , 就成功了
失敗是因為以前都從dns 去對應 , 現在必須告訴nail daemon smtp relay server 的ip...
http://linux-com.blogspot.tw/2011/05/sending-email-with-sendmail-and-mailx.html
Mailx / nail instead of sendmail
Mailx / nail instead of sendmail
Instead you could use the "nail rpm" package which installs nail which will probably meet your needs in sending emails from scripts and such. Another example of not using sendmail would be setting up "thunderbird" with "us.ibm.com" as the outgoing mail smtp server.
Steps:
- Switch to root (by typing su - or use the sudo command to open the nail.rc file:
vi /etc/nail.rc
- Add (somewhere in the middle of the file):
set smtp=us.ibm.com set from=intranetID@us.ibm.com
- Create a test email (use mailx not mail, it may be called nail too):
[quickm@host etc]$ mailx mquick@us.ibm.com Subject: test This is a test email using "nail", I hope this works because the reader of this document will be really annoyed with me :-) . Cc:
NOTE: type . and press enter key to end the body section of the text
Note: with nail => nail -s "Requested Report" -a report.txt user@host.com < /dev/null
Note: with nail => nail -s "Requested Report" -a report.txt user@host.com < /dev/null
RPM Package required (or build binary) : nail rpm package
/etc/nail.rc /usr/bin/mailx /usr/share/doc/nail-12.1 /usr/share/doc/nail-12.1/AUTHORS /usr/share/doc/nail-12.1/COPYING /usr/share/doc/nail-12.1/ChangeLog /usr/share/doc/nail-12.1/INSTALL /usr/share/doc/nail-12.1/README /usr/share/doc/nail-12.1/TODO /usr/share/man/man1/mailx.1.gz
沒有留言:
張貼留言