Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: e-mail fails with address that is not a fully qualified domain

by Anonymous Monk
on Jun 01, 2015 at 17:10 UTC ( [id://1128605]=note: print w/replies, xml ) Need Help??


in reply to e-mail fails with address that is not a fully qualified domain

You need the FQDN from short host name? Simple, just resolve it:

my $fullname = (gethostbyname $host)[0];

  • Comment on Re: e-mail fails with address that is not a fully qualified domain
  • Download Code

Replies are listed 'Best First'.
Re^2: e-mail fails with address that is not a fully qualified domain
by merrymonk (Hermit) on Jun 01, 2015 at 18:19 UTC
    I used the gethostbyname as suggested as shown in the following Perl extract.
    my $full_host_name = (gethostbyname $Host)[0]; print "full_host_name <$full_host_name>\n"; my @ok = $msg->smtpsend( Host => $full_host_name, To => $To, Debug => 1 );
    I got the following output in which:
    1. gethostname was expanded ad I used this for the Host
    2. I still got the message about need to be fully qualified domain address
    I then tried altering the $From to include various parts of the expanded host name but without any success!
    I suspect I am close so if anyone can suggest the next step it will be much appreciated.

    full_host_name <mail.btinternet.bt.lon5.cpcloud.co.uk>

    Net::SMTP>>> Net::SMTP(2.31)
    Net::SMTP>>> Net::Cmd(2.29)
    Net::SMTP>>> Exporter(5.68)
    Net::SMTP>>> IO::Socket::INET(1.33)
    Net::SMTP>>> IO::Socket(1.37)
    Net::SMTP>>> IO::Handle(1.34)
    Net::SMTP=GLOB(0x2835118)<<< 220 rgout06.bt.lon5.cpcloud.co.uk ESMTP Service ready
    Net::SMTP=GLOB(0x2835118)>>> EHLO localhost.localdomain
    Net::SMTP=GLOB(0x2835118)<<< 250-rgout06.bt.lon5.cpcloud.co.uk
    Net::SMTP=GLOB(0x2835118)<<< 250-DSN
    Net::SMTP=GLOB(0x2835118)<<< 250-8BITMIME
    Net::SMTP=GLOB(0x2835118)<<< 250-PIPELINING
    Net::SMTP=GLOB(0x2835118)<<< 250-AUTH=LOGIN
    Net::SMTP=GLOB(0x2835118)<<< 250-AUTH LOGIN PLAIN
    Net::SMTP=GLOB(0x2835118)<<< 250-DELIVERBY 300
    Net::SMTP=GLOB(0x2835118)<<< 250 SIZE 41943040
    Net::SMTP=GLOB(0x2835118)>>> MAIL FROM:<postmaster@hm-insp15>
    Net::SMTP=GLOB(0x2835118)<<< 553 <postmaster@hm-insp15> Invalid mail address, must be fully qualified domain
    Net::SMTP=GLOB(0x2835118)>>> QUIT
    Net::SMTP=GLOB(0x2835118)<<< 221 rgout06.bt.lon5.cpcloud.co.uk QUIT

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1128605]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 00:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found