[net-dns-users] How to translate the email in SOA

Feng He fenghe at nsbeta.info
Sat Dec 22 10:27:05 UTC 2012


To translate an email address into SOA format I can use Net::DNS::Mailbox.
But translating from the SOA to a regular email address, what module will we use?

I currently use my own subroutine:

sub restore_email_from_soa {

    my $email = shift;
    $email =~ s/\.$//;

    if ($email =~ /^(.*?)(?<!\\)\.(.*)$/) {
        my $user = $1;
        my $tld = $2;
        $user =~ s/\\//g;
        return $user . '@'. $tld;

Im not sure if it suits all the conditions.


More information about the net-dns-users mailing list