我想要使用Postfixbuild立一个辅助MX服务器,但我想知道在投入生产之前(通过添加MX条目)testing这个最好的方法是什么?
一种可能的方法是用一个完全不同的域名进行testing,即购买像“fake-test-domain.com”这样的域名,并仅使用该备份MX服务器来设置其DNS域名。
任何更简单的方法,我可以强制一个邮件服务器发送一条消息之前,它在DNS中列出的服务器?
我不认为我可以使用发送系统上的主机文件,因为这不会模拟MXlogging,对吧?
只需使用Telnet会话来testing电子邮件传送。 举个例子,
# telnet host.domain 25 Trying host.domain... Connected to host.domain. Escape character is '^]'. 220 ESMTP HELO example.com 250 MAIL FROM:<[email protected]> 250 ok RCPT TO:<[email protected]> 250 ok DATA To: [email protected] From: [email protected] Subject: a test message Test message body. . 250 ok
当telnet不够或者太乏味时,我使用SWAKS
例如:
cat email-content.txt | swaks --body - --helo localhost.localhomain --server mail.example.com:25 \ --auth-user fred --auth-password flintst1 -tls \ --h-Subject Pebbles --to [email protected] --from '[email protected]'