Net::SMTP problem

Discussion in 'Perl Misc' started by Bob, Jun 17, 2004.

  1. Bob

    Bob Guest

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


    $smtp->mail( "" );
    $smtp->recipient( "" );
    $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.
     
    Bob, Jun 17, 2004
    #1
    1. Advertising

  2. Bob

    Paul Lalli Guest

    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
    > ''.
    >
    >
    > $smtp->mail( "" );
    > $smtp->recipient( "" );
    > $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
     
    Paul Lalli, Jun 17, 2004
    #2
    1. Advertising

  3. Bob

    Bob Guest

    >>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.
     
    Bob, Jun 17, 2004
    #3
  4. >>
    >> $smtp->mail( "" );
    >> $smtp->recipient( "" );
    >> $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
     
    Andre Wisniewski, Jun 17, 2004
    #4
  5. >
    > 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
     
    Andre Wisniewski, Jun 17, 2004
    #5
  6. Bob

    Paul Lalli Guest

    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
     
    Paul Lalli, Jun 17, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,104
    Roedy Green
    Jan 24, 2006
  2. Alex Hunsley
    Replies:
    4
    Views:
    3,586
    Tim Williams (gmail)
    Jun 29, 2004
  3. Raaijmakers, Vincent \(GE Infrastructure\)

    RE: sending of mail (smtp) - connection refused - but smtp serveris running!

    Raaijmakers, Vincent \(GE Infrastructure\), Jun 29, 2004, in forum: Python
    Replies:
    0
    Views:
    896
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jun 29, 2004
  4. Copelandia Cyanescens

    smtplib.SMTP "no attributes SMTP"

    Copelandia Cyanescens, Jul 31, 2004, in forum: Python
    Replies:
    2
    Views:
    1,492
    Copelandia Cyanescens
    Jul 31, 2004
  5. tshad
    Replies:
    1
    Views:
    906
    bruce barker
    May 5, 2008
Loading...

Share This Page