{
- Copyright (C) 2010-2014 MegaBrutal
+ Copyright (C) 2010-2015 MegaBrutal
This unit is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
const
{ MgSMTP version: }
- VERSION_STR = '0.9s';
+ VERSION_STR = '0.9t';
{ Architecture: }
{$IFDEF CPU64}
{
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
ForwardToList: TStringList;
SpoolObject: TSpoolObjectCreator;
OrigSpoolID: string;
+ FReplyTo: string;
FForwardHeaders, FRemail: boolean;
public
function CheckQuota(MailSize: longint): boolean; override;
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;
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);
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]);
{
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
document what bugfix/feature are you testing with the actual build.
This will be logged to help you differentiate outputs of subsequent
builds in your logs. If left empty, it won't be added to the logs. }
- DEVCOMMENT = '';
+ DEVCOMMENT = 'New feature to add "Reply-To" to forwarded messages';
var
Out.writeln('Trying to contact Service Control Manager...');
Out.writeln('(If you see this message on console, you tried to');
Out.writeln('start up the program incorrectly. Your current');
- Out.writeln('attempt will fail, or it may hang under Wine.');
+ Out.writeln('attempt will fail, or it may hang under Wine.)');
Out.writeln;
ServiceMode:= true;
if not StartServiceCtrlDispatcher(ServiceTable) then begin
; MegaBrutal's SMTP Server (MgSMTP)
-; Copyright (C) 2010-2014 MegaBrutal
+; Copyright (C) 2010-2015 MegaBrutal
; This is an example configuration file for MgSMTP.
; You may inspect it to learn about the configuration options of MgSMTP, and (if
; (You can still have "StoreLocalCopy" off, if you don't want your message to be
; actually delivered to the mailbox.)
+; Reply addresses and simple distribution lists:
+; As the following example shows, with the combination of "ForwardTo" and "ReplyTo",
+; it is possible to create simple, static distribution lists, where replies are
+; addressed back to the distribution list by default.
+; The value of "ReplyTo" will be inserted as a "Reply-To" header to the e-mails being
+; forwarded. Note, it will only affect forwarded e-mails: the local copy won't have
+; the "Reply-To" header.
+; There is a special value for "ReplyTo": "!". When used, it will be substituted with
+; the appropriate mailbox address (in this example, it is "party@example.com").
+
+;[Mailbox\party]
+;ForwardTo = benga@example.com,hugo@example.com,kitty@example.com
+;ReplyTo = Party Unit <party@example.com>
+; Or:
+;ReplyTo = !
+
; Domain-specific mailboxes:
;[Mailbox\@mydomain.tld]
- Process CTRL-C properly to quit from user mode gracefully
- IPv6
- Bind to user-specified IPs
++ Option to add Reply-To header to forwarded e-mails
v0.9s:
+ Change "Client disconnected, and thread exited successfully." to "Client disconnected."