Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed issue with SPF and DKIM

  • Loading branch information...
commit 041ca0f2b4e708e6e540bb4136c53ac23bfaf4b1 1 parent 8a0601a
@nberardi authored
View
4 trunk/installation/hMailServer.iss
@@ -1,11 +1,11 @@
[Setup]
AppName=hMailServer
-AppVerName=hMailServer 5.4-B20111220
+AppVerName=hMailServer 5.4-B20120124
AppCopyright=Copyright (C) 2008
DefaultDirName={pf}\hMailServer
DefaultGroupName=hMailServer
PrivilegesRequired=admin
-OutputBaseFilename=hMailServer-5.4-B20111220
+OutputBaseFilename=hMailServer-5.4-B20120124
SolidCompression=yes
WizardImageFile=setup.bmp
LicenseFile=license.rtf
View
4 trunk/source/Server/Common/AntiSpam/DKIM/DKIM.cpp
@@ -141,7 +141,7 @@ namespace HM
String headerValue = _BuildSignatureHeader(tagA, tagDomain, tagSelector, tagC, tagQ, fieldList, bodyHash, "");
- canonicalizedHeader += headerCanonicalization->CanonicalizeHeaderLine("dkim-signature", headerValue);
+ canonicalizedHeader += headerCanonicalization->CanonicalizeHeaderLine("DKIM-Signature", headerValue);
AnsiString privateKeyContent = FileUtilities::ReadCompleteTextFile(String(privateKey));
@@ -156,7 +156,7 @@ namespace HM
// output to file.
std::vector<pair<AnsiString, AnsiString> > fieldsToWrite;
- fieldsToWrite.push_back(std::make_pair("dkim-signature", headerValue));
+ fieldsToWrite.push_back(std::make_pair("DKIM-Signature", headerValue));
TraceHeaderWriter writer;
bool result = writer.Write(fileName, message, fieldsToWrite);
View
7 trunk/source/Server/Common/AntiSpam/DKIM/DKIMSigner.cpp
@@ -10,6 +10,7 @@
#include "../../BO/Message.h"
#include "../../BO/Domain.h"
+#include "../../BO/Account.h"
#include "../../Cache/CacheContainer.h"
#include "../../Util/Hashing/HashCreator.h"
@@ -28,12 +29,8 @@ namespace HM
void
DKIMSigner::Sign(boost::shared_ptr<Message> message)
{
-
- AnsiString senderAddress = message->GetFromAddress();
- AnsiString senderDomain = StringParser::ExtractDomain(senderAddress);
-
// Check if signing is enabled for this domain.
- boost::shared_ptr<const Domain> pDomain = CacheContainer::Instance()->GetDomain(senderDomain);
+ boost::shared_ptr<const Domain> pDomain = CacheContainer::Instance()->GetDomain("hoppio.net");
if (!pDomain || !pDomain->GetDKIMEnabled())
return;
View
2  trunk/source/Server/Common/Application/Version.h
@@ -1,5 +1,5 @@
#pragma once
#define HMAILSERVER_VERSION "5.4"
-#define HMAILSERVER_BUILD 20111220
+#define HMAILSERVER_BUILD 20120124
View
4 trunk/source/Server/Common/BO/Message.h
@@ -30,7 +30,7 @@ namespace HM
FlagVirusScan = 64
};
- Message(bool generateFileName);
+ Message(bool generateFileName);
Message(const Message& other);
Message();
virtual ~Message();
@@ -47,6 +47,8 @@ namespace HM
String GetFromAddress() const { return m_sFromAddress; }
void SetFromAddress(const String &FromAddress) { m_sFromAddress = FromAddress; }
+ String GetReturnPathAddress() const { return Formatter::Format("returnpath+{0}@hoppio.net", GetAccountID()); }
+
unsigned int GetUID() const { return _uid; }
void SetUID(unsigned int uid) { _uid = uid; }
View
12 trunk/source/Server/Common/BO/MessageRecipient.cpp
@@ -17,9 +17,7 @@ namespace HM
m_iMessageID(0),
m_bRequiresAuthentication(false),
_isLocalName(false)
- {
-
- }
+ { }
void
MessageRecipient::CopyFrom(boost::shared_ptr<MessageRecipient> pRecip)
@@ -36,9 +34,5 @@ namespace HM
}
MessageRecipient::~MessageRecipient(void)
- {
- }
-
-
-
-}
+ { }
+}
View
4 trunk/source/Server/Common/BO/Route.h
@@ -7,8 +7,8 @@ namespace HM
class Route : public BusinessObject<Route>
{
public:
- Route();
- virtual ~Route();
+ Route();
+ virtual ~Route();
String GetName() const {return m_sDomainName; }
View
7 trunk/source/Server/SMTP/ExternalDelivery.cpp
@@ -29,6 +29,7 @@
#include "SMTPConfiguration.h"
#include "SMTPClientConnection.h"
+#include "../common/Util/TraceHeaderWriter.h"
#ifdef _DEBUG
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
@@ -98,7 +99,6 @@ namespace HM
iterRecipient++;
}
-
}
if (mapFailedDueToNonFatalError.size() > 0)
@@ -176,8 +176,6 @@ namespace HM
}
LOG_DEBUG("SD::~_DeliverToExternalAccounts-2");
-
-
}
/// Resolves IP addresses for the recipient servers. This will either be a MX
@@ -358,8 +356,7 @@ namespace HM
if (!serverInfo->GetUsername().IsEmpty())
pSMTPProtocolParser->SetAuthInfo(serverInfo->GetUsername(), serverInfo->GetPassword());
-
- // Determine what local IP dadress to use.
+ // Determine what local IP address to use.
IPAddress localAddress = _GetLocalAddress();
Event disconnectEvent(pClientConnection->GetConnectionTerminationEvent());
View
10 trunk/source/Server/SMTP/SMTPClientConnection.cpp
@@ -156,7 +156,7 @@ namespace HM
{
if (iCode == 220)
{
- String sComputerName = Utilities::ComputerName();
+ String sComputerName = Utilities::ComputerName();
if (m_bUseSMTPAuth)
{
@@ -197,7 +197,7 @@ namespace HM
// --- Server accepted HELO. Go to HEADER/MAILFROM state.
_SetState(MAILFROM);
}
- else
+ else
{
_UpdateAllRecipientsWithError(iCode, Request, false);
}
@@ -206,7 +206,7 @@ namespace HM
if (m_CurrentState == MAILFROM)
{
- String sFrom = m_pDeliveryMessage->GetFromAddress();
+ String sFrom = m_pDeliveryMessage->GetReturnPathAddress();
String sData = "MAIL FROM:<" + sFrom + ">";
_SendData(sData);
m_CurrentState = MAILFROMSENT;
@@ -482,7 +482,7 @@ namespace HM
}
// Update the delivery status
- pRecipient->SetDeliveryResult(bIsFatalError ? MessageRecipient::ResultFatalError : MessageRecipient::ResultNonFatalError);
+ pRecipient->SetDeliveryResult(bIsFatalError ? MessageRecipient::ResultFatalError : MessageRecipient::ResultNonFatalError);
m_sLastSentData.TrimLeft("\r\n");
m_sLastSentData.TrimRight("\r\n");
@@ -618,7 +618,7 @@ namespace HM
// Append the transmission buffer
_transmissionBuffer.Append(pSendBuffer, iSendBufferSize);
- _ReadAndSend();
+ _ReadAndSend();
}
void
View
4 trunk/source/Server/SMTP/SMTPConnection.cpp
@@ -1062,7 +1062,7 @@ namespace HM
if (!sArchiveDir.empty())
{
- LOG_SMTP(GetSessionID(), GetIPAddressString(), "Archiving..");
+ LOG_SMTP(GetSessionID(), GetIPAddressString(), "Archiving..");
bool bArchiveHardlinks = IniFileSettings::Instance()->GetArchiveHardlinks();
String _messageFileName;
@@ -1089,7 +1089,7 @@ namespace HM
sMessageArchivePath = sArchiveDir + "\\" + sSenderDomain + "\\" + sSenderName + "\\" + byte1 + "\\" + byte2 + "\\" + sFileNameExclPath;
- LOG_SMTP(GetSessionID(), GetIPAddressString(), "Local sender: " + m_pAccount->GetAddress() + ". Putting in account folder: " + sMessageArchivePath);
+ LOG_SMTP(GetSessionID(), GetIPAddressString(), "Archiving: " + m_pAccount->GetAddress() + ". Putting in account folder: " + sMessageArchivePath);
FileUtilities::Copy(_messageFileName, sMessageArchivePath, true);
View
2  trunk/source/Server/SMTP/SMTPDeliverer.cpp
@@ -112,7 +112,7 @@ namespace HM
// Unless the message has been re-used, or has been rescheduled for
// later delivery, we should delete it now.
- bool deleteMessageNow = !messageReused && !messageRescheduled;
+ bool deleteMessageNow = /*!messageReused &&*/ !messageRescheduled;
if (deleteMessageNow)
{
// Check that we haven't reused this message before we delete it.
View
2  trunk/source/Server/hMailServer/hMailServer.h
@@ -4,7 +4,7 @@
/* File created by MIDL compiler version 7.00.0555 */
-/* at Tue Dec 20 22:44:35 2011
+/* at Tue Jan 24 15:50:34 2012
*/
/* Compiler settings for hMailServer.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
View
8 trunk/source/Server/hMailServer/hMailServer.vcxproj
@@ -142,9 +142,8 @@ EXIT 0
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
- <Command>NET STOP hMailServer
-EXIT 0
-</Command>
+ <Command>
+ </Command>
</PreBuildEvent>
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -191,7 +190,8 @@ EXIT 0
<PostBuildEvent>
<Message>
</Message>
- <Command>"$(TargetPath)" /Register</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug (x64)|Win32'">
View
14 trunk/source/Tools/Administrator/Administrator.csproj
@@ -55,6 +55,10 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Interop.hMailServer, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ <HintPath>..\lib\Interop.hMailServer.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
<Reference Include="System.configuration" />
@@ -937,16 +941,6 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
- <COMReference Include="hMailServer">
- <Guid>{DB241B59-A1B1-4C59-98FC-8D101A2995F2}</Guid>
- <VersionMajor>1</VersionMajor>
- <VersionMinor>0</VersionMinor>
- <Lcid>0</Lcid>
- <WrapperTool>tlbimp</WrapperTool>
- <Isolated>False</Isolated>
- </COMReference>
- </ItemGroup>
- <ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj">
<Project>{F71569C1-E511-46E5-975C-A94C51AECC09}</Project>
<Name>Shared</Name>
View
BIN  trunk/source/Tools/lib/Interop.hMailServer.dll
Binary file not shown
View
2  trunk/source/WebAdmin/include_versioncheck.php
@@ -1,3 +1,3 @@
<?php
-define('REQUIRED_VERSION', '5.4-B20111220');
+define('REQUIRED_VERSION', '5.4-B20120124');
?>
Please sign in to comment.
Something went wrong with that request. Please try again.