X-Git-Url: http://git.megabrutal.com/?p=mgsmtp.git;a=blobdiff_plain;f=Mailbox.pas;fp=Mailbox.pas;h=3fc2020f81ce50932c089ef74fbc518b8bcc7564;hp=b600a2aa74e07c63ebc89f11c5b297b701d26f80;hb=d7be810271cecd3383edf9fb832be3749ab5be80;hpb=8bbdde2a7e0570cd88325548dbfed038e327f08b diff --git a/Mailbox.pas b/Mailbox.pas index b600a2a..3fc2020 100644 --- a/Mailbox.pas +++ b/Mailbox.pas @@ -1,6 +1,6 @@ { MegaBrutal's SMTP Server (MgSMTP) - Copyright (C) 2010-2014 MegaBrutal + Copyright (C) 2010-2015 MegaBrutal This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by @@ -90,6 +90,7 @@ type ForwardToList: TStringList; SpoolObject: TSpoolObjectCreator; OrigSpoolID: string; + FReplyTo: string; FForwardHeaders, FRemail: boolean; public function CheckQuota(MailSize: longint): boolean; override; @@ -98,6 +99,7 @@ type function FinishDeliverMessage(LockID: longint): boolean; override; function Lock: longint; override; function Release(LockID: longint): boolean; override; + property ReplyTo: string read FReplyTo; property ForwardHeaders: boolean read FForwardHeaders; property Remail: boolean read FRemail; end; @@ -198,6 +200,7 @@ begin inherited Create(Name, Domain, Config, Slave, DefaultQuota); Self.PhysicalMailbox:= PhysicalMailbox; + FReplyTo:= GetMailboxConfig(Config, Name, Domain, 'ReplyTo', ''); FForwardHeaders:= GetMailboxConfig(Config, Name, Domain, 'ForwardHeaders', true); FRemail:= GetMailboxConfig(Config, Name, Domain, 'Remail', false); @@ -516,6 +519,13 @@ begin Headers.Insert(0, 'X-Forwarded-To: ' + ForwardToList.DelimitedText); end; + if ReplyTo <> '' then begin + if ReplyTo = '!' then + Headers.Insert(0, 'Reply-To: <' + Recipient + '>') + else + Headers.Insert(0, 'Reply-To: ' + ReplyTo); + end; + SpoolObject.Open; for i:= 0 to Headers.Count - 1 do SpoolObject.DeliverMessagePart(Headers.Strings[i]);