2013-02-05 40 views
0

一个名字相关联一个人怎么会从使用虚拟用户批处理脚本发送邮件(UID号码不存在,在/ etc/passwd文件)?不能与UID 1234

目前,它不断与失败:

$ mail -s "my subject" [email protected] 
Cannot associate a name with uid 1234 
+0

尝试:邮件-v -s“我主题” [email protected] – Satish

+0

将是不错的采取对代码http://sourcecodebrowser.com/nail/12.1/v7_8local_8c_source.html – user1929959

回答

0

可以直接调用sendmail。只需构建包含标题的完整电子邮件消息,然后通过sendmail -t发送。 -t告诉sendmail从消息本身读取标题以获取所需的信息。

---start of mail.txt--- 
date: now 
to: [email protected] 
subject: My Subject 
from: [email protected] 

body of message..... 
---end of mail.txt---- 

然后

/usr/sbin/sendmail -t < mail.txt 

,或者你可以只打开一个管道,并呼应了消息的内容进入管道

| /usr/sbin/sendmail -t

+0

看看我永远无法得到这个为w ork使用postfix&bsd-mailx。我根本无法将整个系统切换到sendmail。 – malat

+0

postfix应该提供sendmail兼容性命令吗? http://www.postfix.org/sendmail.1.html – Doon

相关问题