Thanks for your quick answer!
1) What about using phpmailer? It supports auth. I solved it (temporarily) in a pretty dirty way: by using runkit.so (php-extension) it's possible to redeclare functions. So I sorta overwrote mail(). It's transparent, so a user is still able to use PHP's mail() but in the background auth is done. Sure: in the end this doesn't solve my problem so I just used it for clients as a temporary solution where a change from mail() to mail-auth is pretty much work.
Regarding your question:
- use Net::SMTP;
- use Net::SMTP_auth;
- my $username = 'imscp-arpl@<hostname>';
- my $password = '<pwd>';
- my $smtp;
- if (not $smtp = Net::SMTP->new('localhost', Port => 25, Timeout => 30)) {
- die "Could not connect to server\n";
- }
- $smtp->auth($username, $password) || die "Authentication failed! \n";
- $smtp->mail($from);
- $smtp->to($to);
- $smtp->data($out->as_string);
- $smtp->quit;
You just have to create that user as regular mail account. Works fine.
2) Let me outline this a little bit:
For example I'm using Hetzner for domain-registration. That said, my server acts as primary NS with two backup-NS provided by Hetzner. By adding myself as a reseller, I'd like to set these particular NS as default. Not globally, but for all domains that were added by my reseller-account to IMSCP. Now, another reseller comes into play. He/hse uses Schlund for that purposes. Primary NS is the same, but the backup-NS differ. So at this point it would be helpful to define reseller's own NS.
That's why I'd like to assign default-nameservers to resellers and I'd absolutely be fine to do this with a listener. Shouldn't be a big thing I guess. Sure, I could patch NS for every client instead but in that case I'd have to enrich the listener for every new user.