X-Hermes-Status also reports whether you are authenticated

This commit is contained in:
ps 2011-07-06 12:15:27 +00:00
parent cc73e91bf8
commit b765b6f2fd
2 changed files with 5 additions and 4 deletions

View file

@ -111,7 +111,7 @@ int,dns_whitelist_percentage,100
* that way, your bayesian filter can learn from this automatically * that way, your bayesian filter can learn from this automatically
* NOTE: if this is enabled, it will accept blacklisted emails and it will be up to you to filter * NOTE: if this is enabled, it will accept blacklisted emails and it will be up to you to filter
* them out, for example through procmail * them out, for example through procmail
bool,add_status_header_if_dns_listed,false bool,add_status_header,false
* time to delay the initial SMTP banner * time to delay the initial SMTP banner
int,banner_delay_time,5 int,banner_delay_time,5

View file

@ -162,7 +162,7 @@ void Proxy::run(string &peer_address)
else if(!cfg.getDnsBlacklistDomains().empty()&&!authenticated&&Utils::listed_on_dns_lists(cfg.getDnsBlacklistDomains(),cfg.getDnsBlacklistPercentage(),peer_address)) else if(!cfg.getDnsBlacklistDomains().empty()&&!authenticated&&Utils::listed_on_dns_lists(cfg.getDnsBlacklistDomains(),cfg.getDnsBlacklistPercentage(),peer_address))
{ {
hermes_status="blacklisted"; hermes_status="blacklisted";
if(cfg.getAddStatusHeaderIfDnsListed()) if(cfg.getAddStatusHeader())
code="250"; code="250";
else else
code=cfg.getReturnTempErrorOnReject()?"421":"550"; code=cfg.getReturnTempErrorOnReject()?"421":"550";
@ -251,9 +251,9 @@ void Proxy::run(string &peer_address)
inside.writeLine("Received: from "+ehlostr+" ("+peer_address+")"); inside.writeLine("Received: from "+ehlostr+" ("+peer_address+")");
inside.writeLine(" by "+Utils::gethostname()+" with "+(esmtp?"ESTMP":"SMTP")+" via TCP; "+Utils::rfc2821_date()); inside.writeLine(" by "+Utils::gethostname()+" with "+(esmtp?"ESTMP":"SMTP")+" via TCP; "+Utils::rfc2821_date());
inside.writeLine("X-Anti-Spam-Proxy: Proxied by Hermes [www.hermes-project.com]"); inside.writeLine("X-Anti-Spam-Proxy: Proxied by Hermes [www.hermes-project.com]");
} if(cfg.getAddStatusHeader())
if(cfg.getAddStatusHeaderIfDnsListed())
inside.writeLine("X-Hermes-Status: "+hermes_status); inside.writeLine("X-Hermes-Status: "+hermes_status);
}
do do
{ {
bytes_read=outside.readBytes(buffer,sizeof(buffer)-1); bytes_read=outside.readBytes(buffer,sizeof(buffer)-1);
@ -275,6 +275,7 @@ void Proxy::run(string &peer_address)
{ {
throttled=false; throttled=false;
authenticated=true; authenticated=true;
hermes_status="authenticated";
} }
if("250-pipelining"==Utils::strtolower(strtemp)||"250-chunking"==Utils::strtolower(strtemp)) //this solves our problems with pipelining-enabled servers if("250-pipelining"==Utils::strtolower(strtemp)||"250-chunking"==Utils::strtolower(strtemp)) //this solves our problems with pipelining-enabled servers
strtemp=""; strtemp="";