質問: smtpがコマンドラインから機能しているかどうかを確認する方法(linux) 私はsmtpサーバーを持っています、この質問の目的のためにそれを呼ぶことができます:smtp.mydomain.com。smtpサーバーが機能しているかどうかをどのように確認しますか? linuxのコマンドラインからeメールを送信できますか?
回答: telnetを使ってpostfixや他のsmtpをテストすることについての唯一のことはあなたがコマンドと構文を知らなければならないということです。代わりに、単に swaks :)を使用してください。thufir@dur:~$ thufir@dur:~$ mail -f maildir "/home/thufir/maildir": 4 messages > 1 thufir@dur.bouncem 15/553 test mon, 30 dec 2013 10:15:12 -0800 2 thufir@dur.bouncem 15/581 test mon, 30 dec 2013 10:15:55 -0800 3 thufir@dur.bouncem 15/581 test mon, 30 dec 2013 10:29:57 -0800 4 thufir@dur.bouncem 15/581 test mon, 30 dec 2013 11:54:16 -0800 ? q held 4 messages in /home/thufir/maildir thufir@dur:~$ thufir@dur:~$ swaks --to thufir@dur.bounceme.net === trying dur.bounceme.net:25... === connected to dur.bounceme.net. <- 220 dur.bounceme.net esmtp postfix (ubuntu) -> ehlo dur.bounceme.net <- 250-dur.bounceme.net <- 250-pipelining <- 250-size 10240000 <- 250-vrfy <- 250-etrn <- 250-starttls <- 250-enhancedstatuscodes <- 250-8bitmime <- 250 dsn -> mail from:<thufir@dur.bounceme.net> <- 250 2.1.0 ok -> rcpt to:<thufir@dur.bounceme.net> <- 250 2.1.5 ok -> data <- 354 end data with <cr><lf>.<cr><lf> -> date: mon, 30 dec 2013 14:33:17 -0800 -> to: thufir@dur.bounceme.net -> from: thufir@dur.bounceme.net -> subject: test mon, 30 dec 2013 14:33:17 -0800 -> x-mailer: swaks v20130209.0 jetmore.org/john/code/swaks/ -> -> this is a test mailing -> -> . <- 250 2.0.0 ok: queued as 52d162c3eff -> quit <- 221 2.0.0 bye === connection closed with remote host. thufir@dur:~$ thufir@dur:~$ mail -f maildir "/home/thufir/maildir": 5 messages 1 new 1 thufir@dur.bouncem 15/553 test mon, 30 dec 2013 10:15:12 -0800 2 thufir@dur.bouncem 15/581 test mon, 30 dec 2013 10:15:55 -0800 3 thufir@dur.bouncem 15/581 test mon, 30 dec 2013 10:29:57 -0800 4 thufir@dur.bouncem 15/581 test mon, 30 dec 2013 11:54:16 -0800 >n 5 thufir@dur.bouncem 15/581 test mon, 30 dec 2013 14:33:17 -0800 ? 5 return-path: <thufir@dur.bounceme.net> x-original-to: thufir@dur.bounceme.net delivered-to: thufir@dur.bounceme.net received: from dur.bounceme.net (localhost [127.0.0.1]) by dur.bounceme.net (postfix) with esmtp id 52d162c3eff for <thufir@dur.bounceme.net>; mon, 30 dec 2013 14:33:17 -0800 (pst) date: mon, 30 dec 2013 14:33:17 -0800 to: thufir@dur.bounceme.net from: thufir@dur.bounceme.net subject: test mon, 30 dec 2013 14:33:17 -0800 x-mailer: swaks v20130209.0 jetmore.org/john/code/swaks/ message-id: <20131230223317.52d162c3eff@dur.bounceme.net> this is a test mailing new mail has arrived. ? q held 5 messages in /home/thufir/maildir thufir@dur:~$ それはただ一つの簡単な命令です。