tags:

views:

58

answers:

1

I'm using Mail::Sender to send mail from Perl. I have a valid SMTP server (it works if I do a telnet). However, I get an error -6 on a MailMsg. The doc shows -6 as

local user $to unknown on host $smtp

What does this mean? Is it unable to locate the receiver?

my $rec=(new Mail::Sender)->MailMsg(
    {smtp=>'smtp.example.net',
     from =>'[email protected]', 
     to => '[email protected]', 
     msg => 'Hello'});
+6  A: 

If you see the AUTHENTICATION part of the documentation of Mail::Sender, it states that:

If you get a "Local user "[email protected]" unknown on host "zzz"" message it usualy means that your mail server is set up to forbid mail relay. That is it only accepts messages to or from a local user. If you need to be able to send a message with both the sender's and recipient's address remote, you need to somehow authenticate to the server. You may need the help of the mail server's administrator to find out what username and password and/or what authentication protocol are you supposed to use.

Nikhil Jain
but I am a local user and I send to another local user. Why should that be a problem?
Rajesh
have you read the documentation(Authentication Part) of `Mail::Sender`?
Nikhil Jain
I did. It says you need authentication for remote users. My to and from are not remote
Rajesh
I think you need to check the config file, because as you are saying `to` and `from` are local user, that means server are not recognizing them as local. so check it.
Nikhil Jain
Just because you are a local user sending to a user on the same machine doesn't mean your mailer is going to skip that check. It's going through the same process to send *any* mail. Talk to your network admins to find out what you need to do to send mail.
brian d foy