Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Net::SMTP problem

Reply
Thread Tools

Net::SMTP problem

 
 
Bob
Guest
Posts: n/a
 
      06-17-2004
I'm getting a "450 <b2.ca>: User unknown" in the postfix log file.
I don't know where the 'b2.ca' came from it should be 'b2' or
'(E-Mail Removed)'.


$smtp->mail( "(E-Mail Removed)" );
$smtp->recipient( "(E-Mail Removed)" );
$msg_contents = "t";

if (! $smtp->data( $msg_contents )) {
print "Unable to send message " . $current . "\n";
}

Does anybody know why it is failing and is there any way to see exactly
what is being sent to the mail server?



--
-------------------------------------------------------
Remove .NOSPAM from my email address to reply directly.
 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      06-17-2004
On Thu, 17 Jun 2004, Bob wrote:

> I'm getting a "450 <b2.ca>: User unknown" in the postfix log file.
> I don't know where the 'b2.ca' came from it should be 'b2' or
> '(E-Mail Removed)'.
>
>
> $smtp->mail( "(E-Mail Removed)" );
> $smtp->recipient( "(E-Mail Removed)" );
> $msg_contents = "t";
>
> if (! $smtp->data( $msg_contents )) {
> print "Unable to send message " . $current . "\n";
> }
>
> Does anybody know why it is failing and is there any way to see exactly
> what is being sent to the mail server?



Run your script with warnings enabled, and Perl will tell you exactly
what's wrong with the first two lines of this code.

(obligatory mini-rant follows)

It's not nice to ask thousands of people to do the work of a machine.
Your code should always have warnings enabled before being posted for all
the world to see and critique. Please read the posting guidelines that
are posted to this group regularly.


Paul Lalli
 
Reply With Quote
 
 
 
 
Bob
Guest
Posts: n/a
 
      06-17-2004
>>Does anybody know why it is failing and is there any way to see exactly
>>what is being sent to the mail server?

>
>
>
> Run your script with warnings enabled, and Perl will tell you exactly
> what's wrong with the first two lines of this code.


Ok, I turned on warnings:
$smtp->mail( "b\@my.domain" );
$smtp->recipient( "b2\@my.domain" );
$msg_contents = "t";

Now it is a postfix question:
reject: RCPT from unknown[192.168.1.100]

--
-------------------------------------------------------
Remove .NOSPAM from my email address to reply directly.
 
Reply With Quote
 
Andre Wisniewski
Guest
Posts: n/a
 
      06-17-2004
>>
>> $smtp->mail( "(E-Mail Removed)" );
>> $smtp->recipient( "(E-Mail Removed)" );
>> $msg_contents = "t";
>>
>> if (! $smtp->data( $msg_contents )) {
>> print "Unable to send message " . $current . "\n";
>> }
>>


> Run your script with warnings enabled, and Perl will tell you exactly
> what's wrong with the first two lines of this code.
>
>
> It's not nice to ask thousands of people to do the work of a machine.
> Your code should always have warnings enabled before being posted for all
> the world to see and critique. Please read the posting guidelines that
> are posted to this group regularly.
>


Of course, Paul is right but try it with ... b\@my. ...

Read, learn and use.

--
Andre

---

Fighting for peace is like f..ing for virginity
 
Reply With Quote
 
Andre Wisniewski
Guest
Posts: n/a
 
      06-17-2004
>
> Now it is a postfix question:
> reject: RCPT from unknown[192.168.1.100]
>


Do not post such questions here!

--
Andre

---

Fighting for peace is like f..ing for virginity
 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      06-17-2004
On Thu, 17 Jun 2004, Bob wrote:

> >>Does anybody know why it is failing and is there any way to see exactly
> >>what is being sent to the mail server?

> >
> >
> >
> > Run your script with warnings enabled, and Perl will tell you exactly
> > what's wrong with the first two lines of this code.

>
> Ok, I turned on warnings:
> $smtp->mail( "b\@my.domain" );
> $smtp->recipient( "b2\@my.domain" );
> $msg_contents = "t";
>
> Now it is a postfix question:
> reject: RCPT from unknown[192.168.1.100]



I'll give you the benefit of the doubt for now and assume that you're not
trying to attack other mail servers or do otherwise illegal and/or immoral
things...

I *believe* this message is generated when the mail server disallows a
machine from emailing via that server. In other words, you can generally
only contact your own SMTP server to send mail. (If your ISP is
nycap.rr.com, for example, you should only be trying to use
smtp.nycap.rr.com). Most mail servers will prevent users not on their own
network from using their mail servers.

I could be completely wrong in my diagnosis, however. Perhaps you should
try posting an actual complete program, with real values, as suggested by
those same posting guidelines I previously suggested you read.

If I'm not wrong, then this is really not a Perl topic any longer, and
should be moved to a more appropriate newsgroup (ie, one that deals with
SMTP instead of a particular programming language).

Paul Lalli
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments