Net::SMTP problem

B

Bob

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 address removed)'.


$smtp->mail( "(e-mail address removed)" );
$smtp->recipient( "(e-mail address 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?
 
P

Paul Lalli

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 address removed)'.


$smtp->mail( "(e-mail address removed)" );
$smtp->recipient( "(e-mail address 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
 
B

Bob

Does anybody know why it is failing and is there any way to see exactly
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]
 
A

Andre Wisniewski

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.
 
P

Paul Lalli

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top