Mediawiki没有发送邮件,但是cron和sendmail工作得很好

时间:2017-02-08 12:31:58

标签: email cron mediawiki

我一直在努力使用邮件系统而且我确实实现了它的工作,但只是部分,cron作业正在发送邮件,而下一个命令有效: echo“Subject:try1”| sendmail -v email@domain.com 但是,尽管使用相同的配置,但mediawiki doest不会发送任何电子邮件。

我查了很多链接,但我找不到解决方案

这里有成功邮件的日志:

Feb  8 12:53:45 localhost postfix/pickup[29000]: CC28C9C1415: uid=1005 from=<User> 
Feb  8 12:53:45 localhost postfix/cleanup[1379]: CC28C9C1415: message-id=<20170208115345.CC28C9C1415@Computer> 
Feb  8 12:53:45 localhost postfix/qmgr[29001]: CC28C9C1415: from=<User@domain.intern>, size=265, nrcpt=1 (queue active) 
Feb  8 12:54:07 localhost postfix/smtp[1380]: CC28C9C1415: to=<user.email@Domain.com>, relay=mailer[SomeIP]:25, delay=21, delays=0.01/0/21/0.22, dsn=2.0.0, status=sent (250 ok:  Message 167524196 accepted)
Feb  8 12:54:07 localhost postfix/cleanup[1379]: 41E819C1416: message-id=<20170208115407.41E819C1416@Computer>
Feb  8 12:54:07 localhost postfix/bounce[1387]: CC28C9C1415: sender delivery status notification: 41E819C1416
Feb  8 12:54:07 localhost postfix/qmgr[29001]: 41E819C1416: from=<>, size=1880, nrcpt=1 (queue active)
Feb  8 12:54:07 localhost postfix/qmgr[29001]: CC28C9C1415: removed
Feb  8 12:54:07 localhost postfix/error[788]: 41E819C1416: to=<User@Domain.intern>, relay=none, delay=0.01, delays=0/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to Domain.intern[SomeIP]:25: Connection refused)

在这里你有一个与它无法正常工作相关的日志。

Feb  8 12:59:06 localhost postfix/smtpd[3744]: connect from localhost[127.0.0.1]
Feb  8 12:59:06 localhost postfix/smtpd[3744]: 92DD19C13FD: client=localhost[127.0.0.1]
Feb  8 12:59:06 localhost postfix/cleanup[3746]: 92DD19C13FD: message-id=<wikidb_innodb.doesnotmatter@Computer>
Feb  8 12:59:06 localhost postfix/qmgr[29001]: 92DD19C13FD: from=<root@Computer>, size=1079, nrcpt=1 (queue active)
Feb  8 12:59:06 localhost postfix/smtpd[3744]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Feb  8 12:59:17 localhost postfix/smtp[3689]: connect to Domain.intern[SomeIP]:25: Connection timed out
Feb  8 12:59:22 localhost postfix/smtp[3690]: connect to Domain.intern[SomeIP]:25: Connection timed out
Feb  8 12:59:22 localhost postfix/smtp[3749]: 92DD19C13FD: to=<user.email@Domain.com>, relay=mailer[SomeIP]:25, delay=16, delays=0.06/0.01/14/1.8, dsn=2.0.0, status=sent (250 ok:  Message 167524402 accepted)
Feb  8 12:59:22 localhost postfix/qmgr[29001]: 92DD19C13FD: removed

这里有与邮件系统相关的mediawiki配置(LocalSettings.php):

$wgSMTP = array(
"host" => '127.0.0.1',
 "IDHost" => 'Computer',
 "localhost" => 'Computer',
 "port" => "25",
'auth'     => false,               // Should we use SMTP authentication (true or false)
);

这是postfix的配置:

myhostname = Computer

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = Computer, localhost
relayhost =

mynetworks = 127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16
mailbox_size_limit = 0
recipient_delimiter = +
notify_classes = resource, software
inet_interfaces = all
inet_protocols = all

我将提供您可以提供的任何帮助

------------------------------更新---------------- ----------------

我尝试使用telnet发送电子邮件,但它无效

telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 Computer ESMTP Postfix (Ubuntu)
MAIL FROM: ghost@nodomain.com
250 2.1.0 Ok
RCPT TO:User.email@domain.com
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
There is no data to send
    .
250 2.0.0 Ok: queued as 047F59C1417

这里是日志

 connect from localhost[127.0.0.1]
Feb  8 16:20:20 localhost postfix/smtp[29704]: 40AF99C140A: to=<User@domain>, relay=none, delay=14535, delays=14396/0.01/139/0, dsn=4.4.1, status=deferred (connect to Domain[SomeIP]:25: Connection timed out)
Feb  8 16:20:50 localhost postfix/smtpd[31010]: CAD459C1417: client=localhost[127.0.0.1]
Feb  8 16:21:17 localhost postfix/cleanup[31047]: CAD459C1417: message-id=<20170208152050.CAD459C1417@Computer>
Feb  8 16:21:17 localhost postfix/qmgr[29001]: CAD459C1417: from=<doesnotmatter@domain.com>, size=324, nrcpt=1 (queue active)
Feb  8 16:21:27 localhost postfix/smtp[29704]: CAD459C1417: to=<User.email@Domain.com>, relay=Domain[SOMEIP]:25, delay=51, delays=41/0/9.2/0.2, dsn=2.0.0, status=sent (250 ok:  Message 167539525 accepted)
Feb  8 16:21:27 localhost postfix/qmgr[29001]: CAD459C1417: removed

1 个答案:

答案 0 :(得分:0)

解决。 它部门正在过滤电子邮件