Per the above instructions I have the script named domain_create_post.sh, and one called domain_destroy_post.sh and located in /usr/local/directadmin/scripts/custom/ (the 2nd script is just a link of the first, they are both the same thing)
Below is the contents of my actual script
#!/usr/bin/perl
sub AutoLocalDomains{
opendir(DIR, "/var/spool/virtual") || print 'Could Not Open Directory';
$i = 0;
while ($name = readdir(DIR)) {
if($name ne '.' && $name ne '..'){
$domains[$i] = $name;
$i++;
}
}
return join("\n", @domains);
closedir(DIR);
}
open(OUTPUT,">/usr/local/assp/localdomains.txt") || print "Could Not Open";
print OUTPUT &AutoLocalDomains();
close(OUTPUT);
In assp.cfg I then have localDomains:=file:/usr/local/assp/localdomains.txt which has ASSP reference that file that is created.
Basically all the script does is get a directory listing of /var/spool/virtual/, which by default has a folder for every domain created on the server. Since the script is run after a domain is created, or after a domain is destroyed, the folders in /var/spool/virtual have already been created/removed. As a result the listing creates the appropriate file.
On my server I have modified exim to listen to port 125. I then have ASSP configured to listen on port 25, and relay it to the mail server on port 125. I did not have to do anything to have SMTP authentication work properly. I simply told my e-mail client to connect to port 25 and use SMTP authentication. It works great.
FYI, for some reason the GUI client for ASSP does not work right on my server. In posting on their forums a few others expressed difficulties with RHEL/CentOS with the same thing (basically the config file never updates). As a result I edited the config file manually with nano to change the settings. I kept a copy of the web client open so I knew what each line did, and I could search for the appropriate field to edit.
I hope this helps!
Thanks.
Doug Logan