initial commit of file from CVS for e-smith-qmail on Wed 12 Jul 09:06:46 BST 2023
This commit is contained in:
		| @@ -0,0 +1,25 @@ | ||||
| { | ||||
|     # | ||||
|     # qmail's smtproutes mechanism works such that the LAST BEST match | ||||
|     # found in /var/qmail/control/smtproutes will be used in preference | ||||
|     # to any other entry. | ||||
|     # | ||||
|     # Consider the following /var/qmail/control/smtproutes example: | ||||
|     # | ||||
|     #   :smarthost.somewhere | ||||
|     #   domain.place:some.host | ||||
|     #   domain.place:other.host | ||||
|     #   :some.other.smarthost.elsewhere | ||||
|     # | ||||
|     # Mail for user@domain.place will ALWAYS be delivered to | ||||
|     # other.host. The entry for some.host will NEVER be used. | ||||
|     # | ||||
|     # Mail for any other domain will ALWAYS be delivered to | ||||
|     # some.other.smarthost.elsewhere. The entry for smarthost.somewhere | ||||
|     # will NEVER be used. | ||||
|     # | ||||
|     # Therefore, if you wish to make any customisations to the | ||||
|     # /var/qmail/control/smtproutes templates, you must ensure that they | ||||
|     # appear AFTER the standard e-smith template entries. | ||||
|     # | ||||
| } | ||||
| @@ -0,0 +1,17 @@ | ||||
| { | ||||
|     $OUT = ""; | ||||
|  | ||||
|     use esmith::DomainsDB; | ||||
|     my $ddb = esmith::DomainsDB->open_ro(); | ||||
|  | ||||
|     for my $domain ( $ddb->domains ) | ||||
|     { | ||||
|         my $mail_server = $domain->prop('MailServer') | ||||
|                           || $DelegateMailServer | ||||
|                           || 'localhost'; | ||||
|  | ||||
|         next if ( $mail_server eq 'localhost' ); | ||||
|  | ||||
|         $OUT .= $domain->key . ":$mail_server\n"; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,28 @@ | ||||
| { | ||||
|     $OUT = ""; | ||||
|  | ||||
|     #-------------------------------------------------- | ||||
|     # Now check for SMTP smart host | ||||
|     #-------------------------------------------------- | ||||
|  | ||||
|     if ( | ||||
|         $SMTPSmartHost | ||||
|         && | ||||
|         ($SMTPSmartHost ne 'off') | ||||
|         && | ||||
|         ($SMTPSmartHost !~ /^\s*$/) | ||||
|     ) | ||||
|     { | ||||
|         # Is the smtp-auth-proxy enabled? | ||||
|         if (${'smtp-auth-proxy'}{'status'} eq 'enabled') | ||||
|         { | ||||
|             $OUT .= ":localhost:26"; | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             $OUT .= ":$SMTPSmartHost"; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     chomp ($OUT); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Brian Read
					Brian Read