天嵌 ARM开发社区

 找回密码
 注册
查看: 1616|回复: 3

ARM板上怎么发送邮件。。。

[复制链接]
a678140 发表于 2013-6-21 17:17:12 | 显示全部楼层 |阅读模式
自带的sendmail竟然找不到配置文件sendmail.cf,改不了地址,所以老是被127.0.0.1拒绝

postfix移植失败,整死我了。。。

各位大神怎么发的邮件,望不吝赐教。。。。
wbz073 发表于 2013-6-21 17:21:20 | 显示全部楼层
sendmail配置过程:

1、在服务器上安装sendmail相关的软件包。

yum install sendmail sendmail

安装后以后,sendmail的配置文件位于/etc/mail目录下。

2、修改sendmail.mc文件,将

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

改为

DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl

这样可以使sendmail实现对外发信。

并且在该文件的最后加上

MAILER(local)dnl

此语句告诉sendmail本地用户的邮件不用使用SMTP,而直接在主机内传送。

3、使用命令:

m4 sendmail.mc > sendmail.cf

重新生成配置文件。

4、在local-host-names文件中,写入接收邮件的域名,如linux.com或主机名。

如果想用IP地址接收邮件,则需要在该文件中写入“[IP]”如[192.168.0.1],每个语句占一行。

4、在access文件中填写IP地址、网段或域名和相应的行为,即允许或禁止转发邮件等。如202.204.118  RELAY。然后用makemap hash access.db<access命令生成sendmail所识别的文件。

5、此时基本完成了sendmail的配置,启动sendmail服务。

   service sendmail start

  /etc/init.d/sendmail restart

6、现在就可以使用mail命令发信了。
 楼主| a678140 发表于 2013-6-22 15:17:21 | 显示全部楼层
wbz073 发表于 2013-6-21 17:21
sendmail配置过程:

1、在服务器上安装sendmail相关的软件包。

第一步就做不了,板子上没有yum命令。。。
 楼主| a678140 发表于 2013-6-22 15:44:11 | 显示全部楼层
[root@EmbedSky /]# sendmail
BusyBox v1.16.0 (2010-04-17 19:14:08 CST) multi-call binary.

Usage: sendmail [OPTIONS] [RECIPIENT_EMAIL]...

Read email from stdin and send it

Standard options:
        -t              Read additional recipients from message body
        -f sender       Sender (required)
        -o options      Various options. -oi implied, others are ignored
        -i              -oi synonym. implied and ignored

Busybox specific options:
        -w seconds      Network timeout
        -H 'PROG ARGS'  Run connection helper
                        Examples:
                        -H 'exec openssl s_client -quiet -tls1 -starttls smtp
                                -connect smtp.gmail.com:25' <email.txt
                                [4<username_and_passwd.txt | -au<username> -ap<password>]
                        -H 'exec openssl s_client -quiet -tls1
                                -connect smtp.gmail.com:465' <email.txt
                                [4<username_and_passwd.txt | -au<username> -ap<password>]
        -S server[:port] Server
        -au<username>   Username for AUTH LOGIN
        -ap<password>   Password for AUTH LOGIN
        -am<method>     Authentication method. Ignored. LOGIN is implied

Other options are silently ignored; -oi -t is implied
Use makemime applet to create message with attachments

这是板子上自带的sendmail

[root@EmbedSky /]# sendmail -f 6781400@163.com -t 678140@163.com               
sendmail: can't connect to remote host (127.0.0.1): Connection refused

被127.0.0.1拒绝,网上查要修改sendmail.cf文件,但是我在文件系统里找不到

现在就想知道这个通过busybox的sendmail如何使用,或者如何修改sendmail.cf文件-------文件系统里/etc/mail文件夹是不存在的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-7-3 05:26 , Processed in 1.015625 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表