Error: RCPT TO: error (550 relay not permitted)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Copied the below code straight from a web source  ( ) on sending html emails w/
PERL.  The ONLY change I made was to put GOOD email addresses in the TO /

I am getting the following errror and need help?

---------Error: RCPT TO: error (550 relay not permitted) -------------

use MIME::QuotedPrint;
use HTML::Entities;
use Mail::Sendmail 0.75; # doesn't work with v. 0.74!

$boundary = "====" . time() . "====";

$text = "HTML mail demo\n\n"
      . "This is the message text\n"
      . "Voilà du texte qui sera encodé\n";

%mail = (
         from => ' (webmaster)',
         to => ' (Frank)',
         subject => 'Test HTML mail',
         'content-type' => "multipart/alternative; boundary=\"$boundary\""

$plain = encode_qp $text;

$html = encode_entities($text);
$html =~ s/\n\n/\n\n<p>/g;
$html =~ s/\n/<br>\n/g;
$html = "<p><strong>" . $html . "</strong></p>";

$boundary = '--'.$boundary;

$mail = <<END_OF_BODY;
Content-Type: text/plain; charset="iso-8859-1"


Content-Type: text/html; charset="iso-8859-1"


sendmail(%mail) || print "Error: $Mail::Sendmail::error\n";


Re: Error: RCPT TO: error (550 relay not permitted)

Frank J. Russo wrote:
Quoted text here. Click to load it

Your SMTP server is not configured to relay mail. Contact the
administrator of that server, or use another server.

Tom Wyant

Re: Error: RCPT TO: error (550 relay not permitted)

Frank J. Russo wrote:
Quoted text here. Click to load it

RFC 2505        Anti-Spam Recommendations           February 1999

   In an SMTP session we have 4 elements, each with a varying degree of

   1)  "HELO Hostname"           Easily and often forged.
   2)  "MAIL From:"              Easily and often forged.
   3)  "RCPT To:"                Correct, or at least intended.
   4)  SMTP_Caller (host)        IP.src addr OK, FQDN may be OK.

   Since 1) and 2) are so easily and often forged, we cannot depend on
   them at all to authorize usage of our host as Mail Relay.

   Instead, the MTA MUST be able to authorize Mail Relay usage based on
   a combination of:

   o   "RCPT To:" address (domain).
   o   SMTP_Caller FQDN hostname.
   o   SMTP_Caller IP address.

   The suggested algorithm is:

   a)  If "RCPT To:" is one of "our" domains, local or a domain that
       we accept to forward to (alternate MX), then accept to Relay.

   b)  If SMTP_Caller is authorized, either its IP.src or its FQDN
       (depending on if you trust the DNS), then accept to Relay.

   c)  Else refuse to Relay.


Site Timeline