【问题标题】:Postfix is installed but how do I test it? [closed]Postfix 已安装,但我该如何测试呢? [关闭]
【发布时间】:2011-06-15 11:42:25
【问题描述】:

我什么都试过了,我上网看书测试,发邮件发不出去:

telnet <IP> 25
EHLO
MAIL FROM: <from-email>
RCPT TO: <recipient-email>
DATA
Type message here.
. <Enter>
=>

我什至试过这个,当我输入句号时,我什么也没得到 - 但安装了 postfix。

【问题讨论】:

    标签: ubuntu postfix-mta


    【解决方案1】:

    检查后缀是否正在运行

    sudo postfix status
    

    如果它没有运行,请启动它。

    sudo postfix start
    

    然后telnet到localhost的25端口测试email id

    ehlo localhost
    mail from: root@localhost
    rcpt to: your_email_id
    data
    Subject: My first mail on Postfix
    
    Hi,
    Are you there?
    regards,
    Admin
    .
    

    不要忘记 .在末尾,表示行尾

    【讨论】:

    • @PJBrunet 是的,您仍然可以使用答案中给出的 status 命令检查后缀的状态
    【解决方案2】:

    (我刚刚得到这个工作,我的主要问题是我没有真正的互联网主机名,所以回答这个问题以防它帮助某人)

    您需要使用 HELO 指定主机名。即便如此,你应该得到一个错误,所以 Postfix 可能没有运行。

    另外,=> 不是命令。这 '。'在没有任何文本的单行上告诉 Postfix 条目已完成。以下是我使用的条目:

    telnet localhost 25
    (says connected)
    EHLO howdy.com
    (returns a bunch of 250 codes)
    MAIL FROM: somebody@blah.com
    RCPT TO: (use a real email address you want to send to)
    DATA (type whatever you want on muliple lines)
    . (this on a single line tells Postfix that the DATA is complete)
    

    您应该得到如下响应:

    250 2.0.0 正常:排队为 6E414C4643A

    这封电子邮件可能最终会被放入垃圾文件夹。如果它没有出现,那么您可能需要设置“Postfix on hosts without a real Internet hostname”。以下是我如何在我的 Ubuntu 机器上完成该步骤的细分:

    sudo vim /etc/postfix/main.cf
    smtp_generic_maps = hash:/etc/postfix/generic (add this line somewhere)
    (edit or create the file 'generic' if it doesn't exist)
    sudo vim /etc/postfix/generic
    (add these lines, I don't think it matters what names you use, at least to test)
    his@localdomain.local             hisaccount@hisisp.example
    her@localdomain.local             heraccount@herisp.example
    @localdomain.local                hisaccount+local@hisisp.example
    then run:
    postmap /etc/postfix/generic (this needs to be run whenever you change the 
    generic file)
    

    快乐之路

    【讨论】:

    • 您必须在尖括号中指定电子邮件,否则它将不起作用MAIL FROM: &lt;somebody@blah.com&gt;
    猜你喜欢
    • 2012-05-07
    • 1970-01-01
    • 2015-02-21
    • 1970-01-01
    • 2015-06-17
    • 1970-01-01
    • 2019-06-25
    • 1970-01-01
    • 2017-05-05
    相关资源
    最近更新 更多