avo has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, I am creating an auto-responder script based on POE. I am using PoCoCl::SMTP for the sending of the email but however I have a problem ... the variable "MyHostname" points to localhost by default and I don't know what it must be. Currently the SMTP server replies:
'554 <127.0.0.1>: Helo command rejected: You are not me'. Can you please advice on what I should do to get it running.

Replies are listed 'Best First'.
Re: POCO::Client::SMTP problem
by matze77 (Friar) on Feb 08, 2009 at 15:35 UTC
    Update: POE::Component::Client::SMTP

    That is good, at least the admin seems to do his job ;-)..
    The smtp Server protects against relaying unauthorized Mails (Preventing to be an open relay for Spammers).
    As pointed out by others you should provide more infos, is the Mailserver under your control, is it in your (local network), contact the admin? e.g. otherwise you should authenticate or you wont get your mail relayed ...
    You should get your hostname by running the command "hostname". I wonder if you know a little about E-Mail Servers? Perhaps you could provide a little more info, where are you (your domainname e.g.) and where do you want to send mail (in your Mail-Domain or to a (foreign) domain?)?
    With such little info provided no one is able to give you exact advice ...

    btw: you could simply test a mailserver by typing:

    telnet nameofmailser.domain.tld 25 helo yourhostname.yourdomain.tld mail from:<yourmailadress.yourdomain.tld> rcpt to:<destinationmailadress.destinationdomain.tld> DATA bla bla .
    The trailing "." in the code section ends the Mail Data and the mail is sent (if not rejected by the server ofc, most mailserver reject "late" after the "DATA" keyword but that depends on how the mailadmin configured it ...).

    hth MH
Re: POCO::Client::SMTP problem
by dsheroh (Monsignor) on Feb 08, 2009 at 15:02 UTC
    I'm not familiar with that module, but you should HELO with your own hostname or IP address. I'd recommend using your registered domain name if you have one of your own (i.e., not 123-123-123-123-city-state.yourisp.com) or your internet-visible IP address if not.
Re: POCO::Client::SMTP problem
by bingos (Vicar) on Feb 08, 2009 at 22:43 UTC

    The default setting for what this component sends with the EHLO/HELO is localhost

    It looks like this may be your problem. You can specify something else using the MyHostname parameter.

Re: POCO::Client::SMTP problem
by slacker (Friar) on Feb 08, 2009 at 13:34 UTC
    Is this your SMTP server?
    If so, check the log files.
    I tried googling this error and did not come up with much.
Re: POCO::Client::SMTP problem
by Ultra (Hermit) on Feb 12, 2009 at 14:49 UTC

    the variable "MyHostname" points to localhost by default and I don't know what it must be. Currently the SMTP server replies: '554 <127.0.0.1>: Helo command rejected: You are not me'.

    The SMTP server needs you (the client) to identify yourself. That's done by telling your domain name. PoCoClSMTP is dumb enough not to know how to do that so it let's you do that :)

    That means you need to provide it with your domain name (using MyHostname).

    Of course, if you are not able to determine your domain name, or the domain name doesn't mean nothing, you can provide your IP address to the SMTP server in the form: [XXX.XXX.XXX.XXX] provided via MyHostname

    Dodge This!