|
|
|
|
@ -30,6 +30,7 @@
|
|
|
|
|
#include "AmConfig.h"
|
|
|
|
|
#include "AmUtils.h"
|
|
|
|
|
#include "log.h"
|
|
|
|
|
#include "AnswerMachine.h"
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
@ -101,18 +102,18 @@ void AmMailDeamon::run()
|
|
|
|
|
_run_cond.wait_for();
|
|
|
|
|
sleep(5);
|
|
|
|
|
|
|
|
|
|
string server_address = get_ip_from_name(AmConfig::SmtpServerAddress);
|
|
|
|
|
string server_address = get_ip_from_name(AnswerMachineFactory::SmtpServerAddress);
|
|
|
|
|
if(server_address.empty()){
|
|
|
|
|
WARN("Mail deamon could not resolv SMTP server address <%s>\n",
|
|
|
|
|
AmConfig::SmtpServerAddress.c_str());
|
|
|
|
|
AnswerMachineFactory::SmtpServerAddress.c_str());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AmSmtpClient smtp;
|
|
|
|
|
if (smtp.connect(server_address,AmConfig::SmtpServerPort)) {
|
|
|
|
|
if (smtp.connect(server_address,AnswerMachineFactory::SmtpServerPort)) {
|
|
|
|
|
|
|
|
|
|
WARN("Mail deamon could not connect to SMTP server at <%s:%i>\n",
|
|
|
|
|
server_address.c_str(),AmConfig::SmtpServerPort);
|
|
|
|
|
server_address.c_str(),AnswerMachineFactory::SmtpServerPort);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|