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

Feng He fenghe at nsbeta.info
Sat Dec 22 10:45:41 UTC 2012


I am sorry that Net::DNS::Mailbox does nothing what I thought.
For translating an email address into SOA I have to write a subroutine like:

sub format_email_for_soa {

    my $self = shift;
    my $email = shift;
    my ($user,$tld) = split/\@/,$email;
    $user =~ s/\./\\./g;
    $user. '.' .$tld . '.';
}

Do these have any problem?
Thanks.

22.12.2012, 18:27, "Feng He" <fenghe at nsbeta.info>:
> Hi,
>
> 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.
>
> Thanks.



More information about the net-dns-users mailing list