mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
courier: Tidy up the Procmail courier
This patch tidies up the Procmail courier: - Move the configuration options to the courier instance, instead of using global variables. - Implement more useful string replacement options. - Use exec.CommandContext for running the command with a timeout. As a consequence of the first item, the queue now takes the couriers via its constructor.
This commit is contained in:
@@ -98,13 +98,15 @@ type Queue struct {
|
||||
}
|
||||
|
||||
// Load the queue and launch the sending loops on startup.
|
||||
func New(path string, localDomains *set.String, aliases *aliases.Resolver) *Queue {
|
||||
func New(path string, localDomains *set.String, aliases *aliases.Resolver,
|
||||
localC, remoteC courier.Courier) *Queue {
|
||||
|
||||
os.MkdirAll(path, 0700)
|
||||
|
||||
return &Queue{
|
||||
q: map[string]*Item{},
|
||||
localC: &courier.Procmail{},
|
||||
remoteC: &courier.SMTP{},
|
||||
localC: localC,
|
||||
remoteC: remoteC,
|
||||
localDomains: localDomains,
|
||||
path: path,
|
||||
aliases: aliases,
|
||||
|
||||
Reference in New Issue
Block a user