1 |
slords |
1.1 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer mezzanine_patched_e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer |
2 |
|
|
--- e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer 2006-01-11 18:04:56.000000000 +1100 |
3 |
|
|
+++ mezzanine_patched_e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer 2006-05-10 17:46:33.950740208 +1000 |
4 |
|
|
@@ -1,20 +1,17 @@ |
5 |
|
|
{ |
6 |
|
|
$OUT = ""; |
7 |
|
|
|
8 |
|
|
- #-------------------------------------------------- |
9 |
|
|
- # First check for delegate mail server |
10 |
|
|
- #-------------------------------------------------- |
11 |
|
|
+ use esmith::DomainsDB; |
12 |
|
|
+ my $ddb = esmith::DomainsDB->open_ro(); |
13 |
|
|
|
14 |
|
|
- if ($DelegateMailServer && ($DelegateMailServer !~ /^\s*$/)) |
15 |
|
|
+ for my $domain ( $ddb->domains ) |
16 |
|
|
{ |
17 |
|
|
- $OUT .= "$DomainName:[$DelegateMailServer]\n"; |
18 |
|
|
+ my $mail_server = $domain->prop('MailServer') |
19 |
|
|
+ || $DelegateMailServer |
20 |
|
|
+ || 'localhost'; |
21 |
|
|
|
22 |
|
|
- use esmith::DomainsDB; |
23 |
|
|
- my $ddb = esmith::DomainsDB->open_ro(); |
24 |
|
|
+ next if ( $mail_server eq 'localhost' ); |
25 |
|
|
|
26 |
|
|
- foreach $domain ( $ddb->domains ) |
27 |
|
|
- { |
28 |
|
|
- $OUT .= $domain->key . ":[$DelegateMailServer]\n"; |
29 |
|
|
- } |
30 |
|
|
+ $OUT .= $domain->key . ":[$mail_server]\n"; |
31 |
|
|
} |
32 |
|
|
} |
33 |
|
|
diff -Nur -x '*.orig' -x '*.rej' e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/virtualdomains/80localdomains mezzanine_patched_e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/virtualdomains/80localdomains |
34 |
|
|
--- e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/virtualdomains/80localdomains 2006-05-10 17:47:45.834404377 +1000 |
35 |
|
|
+++ mezzanine_patched_e-smith-qmail-1.10.0/root/etc/e-smith/templates/var/qmail/control/virtualdomains/80localdomains 2006-05-10 17:47:29.066282086 +1000 |
36 |
|
|
@@ -1,19 +1,19 @@ |
37 |
|
|
{ |
38 |
|
|
- my $dms = $DelegateMailServer; |
39 |
|
|
- |
40 |
|
|
- return "# DelegateMailServer is set" if ($dms && ($dms !~ /^\s*$/)); |
41 |
|
|
- |
42 |
|
|
- # All virtual domains will be delivered locally according to the |
43 |
|
|
- # instructions in /var/qmail/alias/.qmail-localdelivery-default. |
44 |
|
|
+ $OUT = ''; |
45 |
|
|
|
46 |
|
|
my $local_handler = "alias-localdelivery"; |
47 |
|
|
|
48 |
|
|
use esmith::DomainsDB; |
49 |
|
|
- my $domainsdb = esmith::DomainsDB->open; |
50 |
|
|
+ my $domainsdb = esmith::DomainsDB->open_ro(); |
51 |
|
|
|
52 |
|
|
- # Handle each defined virtual domain |
53 |
|
|
- foreach my $domain ($domainsdb->get_all_by_prop(type => "domain")) |
54 |
|
|
+ for my $domain ($domainsdb->domains) |
55 |
|
|
{ |
56 |
|
|
+ my $mail_server = $domain->prop('MailServer') |
57 |
|
|
+ || $DelegateMailServer |
58 |
|
|
+ || 'localhost'; |
59 |
|
|
+ |
60 |
|
|
+ next if ( $mail_server ne 'localhost' ); |
61 |
|
|
+ |
62 |
|
|
$domain = $domain->key; |
63 |
|
|
$OUT .= "$domain:$local_handler\n"; |
64 |
|
|
} |