SMTP authorization

Can someone tell me if there is any foolproof way for suthorising SMTP using Java Mail. I tried using the authenticator methods outlined in the Java Mail APIs, but it ois not working with few mwil servers.. The typical error message is:
Error: 530, Delivery not permitted for non-local users, try Authorising.
Any clues? Please help.
Thanks
Sridhar

The solution is showed in the followind servlet code.
I hope this helps.
import java.io.*;
import java.util.Properties;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.mail.*;
import javax.mail.internet.*;
import com.sun.mail.smtp.*;
public class NuevoMail extends HttpServlet {
//please feel these fields with your data
static final String ToAddress = "[email protected]";
static final String host = "smtp.mail.yahoo.com"; //SMTP host
static final String from = "[email protected]";
static final String user = "xxxxxx";
static final String pass = "*******";
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException ,IOException{
res.setContentType("text/html");
try {
//initialize the StringBuffer object within the try/catch loop
StringBuffer sb = new StringBuffer( );
//Get system properties
Properties props = System.getProperties( );
//Setup mail server
props.put("mail.smtp.host", host);
props.put("mail.debug", "true");
props.put("mail.smtp.auth","true");
//Get session
Session session = Session.getDefaultInstance(props, null);
                    session.setDebug(true);
                    session.setPasswordAuthentication(new URLName("smtp",host,25,"INBOX",user,pass), new PasswordAuthentication(user,pass));
//Define message
MimeMessage msg = new MimeMessage(session);
//Set the from address
msg.setFrom(new InternetAddress(from));
//Set the to address
msg.addRecipient(Message.RecipientType.TO, new InternetAddress(ToAddress));
//Set the subject
msg.setSubject("Test mail using JavaMail APIs");
//Set the text content for body
sb.append("This is the 1st String line.\n\n");
sb.append("This is the 2nd String line.\n\n");
sb.append("This is the 3rd String line.\n\n");
msg.setText(sb.toString( ));
//Send message
                              Transport tr = session.getTransport("smtp");
     tr.connect(host, user, pass);
                              msg.saveChanges();     // don't forget this
                    tr.sendMessage(msg, msg.getAllRecipients());
     tr.close();
catch (MessagingException e) {
          System.out.println(e);

Similar Messages

  • SMTP Authorization code for PHP Mail Form

    Can anyone help me in figuring out the correct way to incorporate the SMTP authentication into a form? I am having a lot of trouble in getting my forms to send with this format. My code for my php action page is below. I have my correct information where i included *******. Please let me know what i have wrong.
    CODE STARTS HERE
    <?php
    //new function
    $to = "*******";
    $nameto = "LTL Freight Shop";
    $from = "*******";
    $namefrom = "LTL Freight Shop";
    $subject = "Account Request";
    authSendEmail($from, $namefrom, $to, $nameto, $subject, $message);
    ?>
    <?php
    $recipient  = "*******";
    //$subject = "Account Request";
    $companyname = check_input($_POST['CompanyName'], "Enter your company name");
    $firstname  = check_input($_POST['FirstName'], "Enter your first name");
    $lastname  = check_input($_POST['LastName'], "Enter your last name");
    $phone  = check_input($_POST['PhoneNumber'], "Enter your phone number");
    $fax  = check_input($_POST['FaxNumber']);
    $email  = check_input($_POST['Email'], "Enter your email");
    $address  = check_input($_POST['StreetAddress'], "Enter your address");
    $city  = check_input($_POST['City'], "Enter your city");
    $state  = check_input($_POST['State'], "Enter your state");
    $zipcode  = check_input($_POST['ZipCode'], "Enter your zip code");
    $country  = check_input($_POST['Country'], "Enter your country");
    $yearsinbusiness  = check_input($_POST['YearsinBusiness'], "Enter your years in business");
    $typeofindustry  = check_input($_POST['TypeofIndustry'], "Enter your type of industry");
    $multiplelocations    = check_input($_POST['MultipleLocations']);
    $numberoflocations  = check_input($_POST['LocationsCount']);
    $ltl  = check_input($_POST['ServicesLTL']);
    $ftl  = check_input($_POST['ServicesFTL']);
    $domesticparcel  = check_input($_POST['ServicesDomesticParcel']);
    $intlparcel  = check_input($_POST['ServicesInternationalParcel']);
    $airfreight  = check_input($_POST['ServicesAirFreight']);
    $oceanfreight  = check_input($_POST['ServicesOceanFreight']);
    $other  = check_input($_POST['ServicesOther']);
    $none  = check_input($_POST['ServicesNone']);
    $volume  = check_input($_POST['TypicalVolume'], "Enter your typical volume");
    $carrier  = check_input($_POST['CurrentCarrier'], "Enter your current carrier");
    $class  = check_input($_POST['AverageClass'], "Enter your average class");
    $weight  = check_input($_POST['AverageWeight'], "Enter your average weight");
    $process   = check_input($_POST['Process']);
    $hearabout = check_input($_POST['HearAbout']);
    $comments = check_input($_POST['Comments']);
    if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
        show_error("E-mail address not valid");
    $message = "You have received an account request from:
    Company Name: $companyname
    First Name: $firstname
    Last Name: $lastname
    Phone Number: $phone
    Fax Number: $fax
    E-mail: $email
    Street Address: $address
    City: $city
    State: $state
    Zip Code: $zipcode
    Country: $country
    Years in Business: $yearsinbusiness
    Type of Industry: $typeofindustry
    Multiple Locations: $multiplelocations
    Number of Locations: $numberoflocations
    Services they use: $ltl, $ftl, $domesticparcel, $intlparcel, $airfreight, $oceanfreight, $other, $none
    Typical Volume: $volume
    Current Carrier: $carrier
    Average Class: $class
    Average Weight: $weight
    How they currently process: $process
    How they heard about us: $hearabout
    Comments: $comments
    End of message
    //ini_set("SMTP","smtp.emailsrvr.com");
    //ini_set("SMTP_PORT", 25);
    //ini_set("sendmail_from","*******");
    //mail($recipient, $subject, $message);
    function check_input($data, $problem='')
        $data = trim($data);
        $data = stripslashes($data);
        $data = htmlspecialchars($data);
        if ($problem && strlen($data) == 0)
            show_error($problem);
        return $data;
    function authSendEmail($from, $namefrom, $to, $nameto, $subject, $message)
    $smtpServer = "smtp.emailsrvr.com";
    $port = "25";
    $timeout = "30";
    $username = "********";
    $password = "********";
    $localhost = "smtp.emailsrvr.com";
    $newLine = "\r\n";
    $smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
    $smtpResponse = fgets($smtpConnect, 515);
    if(empty($smtpConnect))
    $output = "Failed to connect: $smtpResponse";
    return $output;
    else
    $logArray['connection'] = "Connected: $smtpResponse";
    fputs($smtpConnect,"AUTH LOGIN" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authrequest'] = "$smtpResponse";
    fputs($smtpConnect, base64_encode($username) . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authusername'] = "$smtpResponse";
    fputs($smtpConnect, base64_encode($password) . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authpassword'] = "$smtpResponse";
    fputs($smtpConnect, "HELO $localhost" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['heloresponse'] = "$smtpResponse";
    fputs($smtpConnect, "MAIL FROM: $from" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['mailfromresponse'] = "$smtpResponse";
    fputs($smtpConnect, "RCPT TO: $to" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['mailtoresponse'] = "$smtpResponse";
    fputs($smtpConnect, "DATA" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['data1response'] = "$smtpResponse";
    $headers = "MIME-Version: 1.0" . $newLine;
    $headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
    $headers .= "To: $nameto <$to>" . $newLine;
    $headers .= "From: $namefrom <$from>" . $newLine;
    fputs($smtpConnect, "To: $to\nFrom: $from\nSubject: $subject\n$headers\n\n$message\n.\n");
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['data2response'] = "$smtpResponse";
    fputs($smtpConnect,"QUIT" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['quitresponse'] = "$smtpResponse";
    function show_error($myError)
    ?>
        <html>
        <body>
        <b>Please correct the following error:</b><br />
        <?php echo $myError; ?>
        </body>
        </html>
    <?php
    exit();
    ?>

    I have tried the standard PHP mail function and it doesnt seem to work. Here is my most recent warning or error message.
    Warning: mail() [function.mail]: SMTP server response: 554 5.7.1 <*****>: Sender address rejected: Access denied in D:\inetpub\vhosts\ltlfreightshop.com\httpdocs\requestaccount.php on line 78
    I had the standard mailing set up but it wouldnt ever send and when i set up just the form, it requires the default email client. Am i wrong to assume that i need the SMTP authentication?
    I am not sure about the sockets being enabled. We currently outsource our web hosting and email hosting. I cannot find the phpinfo(), where would this be?
    Thanks,
    Ben

  • Error 501 authentication failed

    All of a sudden, all users (except me, I'm admin) cannot send mail
    using smtp authorization. The error on the gwia log is :
    "DMN: MSG 74 Inbound AUTH failure (D019)
    DMN: MSG 74 SMTP session ended: [192.168.100.11] () "
    These users can still login to webmail and POP3 successfully, so I
    know it's not a password issue.
    I created a new test user and that account has the same issue, but can
    login to POP3 and web access ok.
    What should I check to resolve this issue?
    GW 7.04 on NW 6.5 sp5
    Thanks

    So this is a password failure (D019 is wrong or failed password) which
    brings the question, what changed/happened? :)
    As the POP is on the GWIA, the certificate that is on the GWIA is used
    by both the SMTP and the POP3. You are using the secure setting for
    both of these aren't you? Sending User IDs and passwords in clear
    over the internet is asking for trouble...
    Webmail is different (Tomcat/Aganet/Cert) so that is a dead end.
    So, as I said before, what changed?
    T
    On Sun, 03 Apr 2011 22:11:49 GMT, Russ Ringer <[email protected]>
    wrote:
    >All of a sudden, all users (except me, I'm admin) cannot send mail
    >using smtp authorization. The error on the gwia log is :
    >
    >"DMN: MSG 74 Inbound AUTH failure (D019)
    >DMN: MSG 74 SMTP session ended: [192.168.100.11] () "
    >
    >These users can still login to webmail and POP3 successfully, so I
    >know it's not a password issue.
    >I created a new test user and that account has the same issue, but can
    >login to POP3 and web access ok.
    >
    >What should I check to resolve this issue?
    >
    >GW 7.04 on NW 6.5 sp5
    >
    >Thanks

  • Multiple accounts and Mail 3.5 (Leopard)

    I've been trying to get Mail to get and send e-mail from multiple accounts using a single ISP (in this case, my Verizon DSL account). My older app, Eudora Pro, can easily do this (for both POP and IMAP), as it has a system called "Personalities," where you can setup a main personality (i.e., your primary ISP account), yet allow other personalities/accounts to use that ISP for the outgoing mail server. It seems that in Mail though, while getting incoming mail from multiple servers isn't the problem, sending mail from multiple accounts through one outgoing server (which requires what Eudora calls "relay SMTP authorization") is problematic. I've set up multiple accounts in Mail and can get incoming mail from them, but can't seem to send outgoing mail except from my main ISP account.
    Any suggestions?

    I have the same problem - My kids each have their own email account within their own user profile, and while they can receive mail, they cannot send it. Sending from my (admin) account is fine, and their outbound accounts are set up identical to mine. I love having separate accounts because I can control how much time each of my kids get (6 of them!)and I get to supervise content on the web but this issue and itunes does not allow them to play back any DRM purchased itunes - acts like they are on a separate computer, not a separate user on the same machine - all itunes are in the shared folder...

  • Company email

    how do i set up my company email if i dont know the incoming server, outgoing server, etc? where would i get that stuff?

    Welcome to Apple Discussions!
    The best source of information for setting up your company mail is your company IT person, or the person responsible for managing your company server. They can provide the server aliases for mail, and also user or account specific authorization information, security, etc.
    That said, you may be able to determine the incoming and outgoing server settings by opening mail from/to your company in your mail application and viewing FULL HEADERS to see the named servers handling mail for your company. There will usually be two by convention:
    mail.yourcompany.com for incoming IMAP/POP
    smtp.yourcompany.com for outgoing SMTP
    Authorization schemes and security will be hit-or-miss without specific IT input, but you might give it a try since you know you user name, and hopefully your password.
    Please let us know if this helps -- and importantly, if it doesn't. We'll do our best to help.
    Regards from Austin, Michael

  • BB browser error msg authentication failed

    After doing a search and attempt to go to a site I just get the message "authentication failed". BTW I have a BB Storm and have upgraded to ver. 5.0.

    So this is a password failure (D019 is wrong or failed password) which
    brings the question, what changed/happened? :)
    As the POP is on the GWIA, the certificate that is on the GWIA is used
    by both the SMTP and the POP3. You are using the secure setting for
    both of these aren't you? Sending User IDs and passwords in clear
    over the internet is asking for trouble...
    Webmail is different (Tomcat/Aganet/Cert) so that is a dead end.
    So, as I said before, what changed?
    T
    On Sun, 03 Apr 2011 22:11:49 GMT, Russ Ringer <[email protected]>
    wrote:
    >All of a sudden, all users (except me, I'm admin) cannot send mail
    >using smtp authorization. The error on the gwia log is :
    >
    >"DMN: MSG 74 Inbound AUTH failure (D019)
    >DMN: MSG 74 SMTP session ended: [192.168.100.11] () "
    >
    >These users can still login to webmail and POP3 successfully, so I
    >know it's not a password issue.
    >I created a new test user and that account has the same issue, but can
    >login to POP3 and web access ok.
    >
    >What should I check to resolve this issue?
    >
    >GW 7.04 on NW 6.5 sp5
    >
    >Thanks

  • DEBUG SMTP RCVD : 535 authorization failed (#5.7.0)

    i used qmail mail server i ve hosted sevean domains. in that first domain can send the mail messgae , i try the another domains log file display the folowing error ..
    DEBUG SMTP SENT: bXJpYmVpcm9AY2VwYXNhZmVkcml2ZS5jb20 =
    DEBUG SMTP RCVD: 334 UGFzc3dvcmQ6
    DEBUG SMTP SENT: ODM0ODM0
    DEBUG SMTP RCVD: 535 authorization failed (# 5,7,0)
    Any body have that idea to solve method....................
    regards
    joswaa

    i used qmail mail server i ve hosted sevean domains. in that first domain can send the mail messgae , i try the another domains log file display the folowing error ..
    DEBUG SMTP SENT: bXJpYmVpcm9AY2VwYXNhZmVkcml2ZS5jb20 =
    DEBUG SMTP RCVD: 334 UGFzc3dvcmQ6
    DEBUG SMTP SENT: ODM0ODM0
    DEBUG SMTP RCVD: 535 authorization failed (# 5,7,0)
    Any body have that idea to solve method....................
    regards
    joswaa

  • In a Mailer object, how do I include a username and password for authentica​tion or credential​s on my smtp server?

    My trace file is pasted below. 
    [[NEW SEND]]
    SMTP>220-elasmtp-junco.atl.sa.earthlink.net ESMTP Exim 4.34 #1 Wed, 27 Feb 2008 16:51:07 -0500
    220-NO UCE.  EarthLink does not authorize the use of its computers or network
    220 equipment to accept, transmit, or distribute unsolicited e-mail.
    LK>HELO basinenglt
    SMTP>250 elasmtp-junco.atl.sa.earthlink.net Hello basinenglt [65.60.113.243]
    LK>MAIL FROM:<[email protected]>
    SMTP>250 OK
    LK>RCPT TO:<[email protected]>
    SMTP>550 Please configure your mail client to use authentication.
    In visual basic, I'm able to send an email with this code:
            Dim Email As New System.Net.Mail.MailMessage()
            Email.From = New System.Net.Mail.MailAddress("[email protected]​m")
            Email.To.Add("[email protected]")
            Email.Subject = "This is a test"
            Email.Body = "Body of email goes here"
            Email.IsBodyHtml = True
            Dim x As New System.Net.Mail.SmtpClient("smtpauth.earthlink.net​")
            Dim net As New System.Net.NetworkCredential("[email protected]​et", "supersecretpassword")
            x.Credentials = net
            x.Port = 587
            x.Send(Email)
    Is there some way to use this code in Lookout or is there some Mailer datamember I don't know about that I can setup to provide the right credentials?  I'm at a loss for what to do and how to do it.  If I can't figure it out, I'll have to use the Run object in Lookout to call a program that I'll have to make in VB that'll send out an email.  In that case, I've got to install .Net on 60 computers in the field and then I'll have to make a series of exe files for each alarm condition and associate individual Run objects with each.  Sheesh.  Well, anything you all can do to help would really be appreciated.  Thanks for taking the time to answer me.
    Steve

    Lookout mailer object doesn't support authentication. We are considering adding this feature, but not yet.
    Another option for you is to use other Mail Server. There are some free Mail Server softwares which don't do authentication.
    Ryan Shi
    National Instruments

  • OS X's Mail app and SMTP auth

    We're having a problem with OS X's Mail app connecting to Tiger Server's mail server. We have the server set up to not always require SMTP auth (all SMTP auth settings unchecked in Settings > Advanced > Security), and to allow relay from only a given set of networks (Settings > Relay). In theory, this means that if you're on one of the specified networks, you're not required to authenticate, otherwise you are. This according to Apple's documentation.
    From a bit of packet sniffing, it looks like:
    1. If a user on an allowed network tries to send mail through the server, the server does not return authorization as an option.
    2. If the user has password authentication specified in Mail's SMTP Server settings, it refuses to send. If they set SMTP auth to None, the Mail app will send.
    IOW, Mail doesn't send if Authorization is enabled in the Mail app, but not given as an option by the mail server. Has anyone else seen this? Is this a bug in Mail or Postfix?

    If you have networks entered in
    'Accept SMTP relay only from these hosts and
    networks'
    Clients on these networks don't need to authenticate
    for local delivery or relay.
    So it does what you are looking for.
    Jeff
    Well, goddarn it - so it does!
    I was testing various permutation (10.3.4) just recently and it just wouldn't relay without auth if any of them was selected (honest!). That was with the trusted relay....
    ...but I just tried it again and it's fine!
    I had put it down to just another 'glitch' in the documentation.
    Oh well - glad you were there to point it out Jeff!
    Whilst we are on the subject - do you know of any way to tie authentication (outwith trusted network) to specified users? I was thinking there might be a Postfix parameter for this (sorry, I should just look them all up but maybe someone knows it already)?
    Thank, and sorry for any earlier confusion!
    -david.

  • Exchange 2010 SP3 - "500 5.3.3 Unrecognized command" in SMTP Receive Log. Senders get message with the same problem

    Hi
    My exchange environment consist with "Server Exchange 2010 SP3" and "Edge Server with Exchange 2010 SP3".
    On Edge server in SMTP receive log i get every now and then an entry: xxxxxx 500 5.3.3 Unrecognized command.
    It is serius problem because I got few e-mails from senders that they had problem with sending e-mail messages to our e-mail domain. They receive e-mail report, for example
    Technical details of permanent failure:
    Google tried to deliver your message, but it was rejected by the server for the recipient domain domena.plby
    mail.domena.pl.
    [95.xxx.xxx.xx].
    The error that the other server returned was:
    500 5.3.3 Unrecognized command
    Could you help me to solve this problem? What could cause this problem?
    Thank you in advance
    Tomasz
    Kind Regards Tomasz

    I have the same issue, but there is plenty of hard disk storage on the Exchange Server. This seems to only be happening from Google Business account/ Postini. If I send message from my personal Gmail account it works fine, but an agency who is on Google
    business seems to have issues sending to us and they are delayed, sometimes they get through and other times they just don't. 
    Results from Mail Acceptance Test:
    I enter my internal address and the remote users postini account as the test setup I received two emails from the tool but the end results of the test are:
     Error submitting mail
            Mail submission failed: Error message: Syntax error, command unrecognized. The server response was: 5.3.3 Unrecognized command.
    Google support stated this:
    Here are the logs from Postini trying to connect to mydomain.com (IP x.x.x.x) :
    1. 2014/08/09 03:26:28 IP:209.85.218.50 SMTP-STLS:OK <null> TLSv1:RC4-SHA Validate:None 2. 2014/08/09 03:26:28 IP:209.85.218.50 SMTP LOG: Sender => FFD:MAIL FROM:<[email protected]>
    3. 2014/08/09 03:26:28 IP:209.85.218.50 Fdal:Customer has null root_iid outbound default at org 100000001 4, 2014/08/09 03:26:28 IP:209.85.218.50 SMTP LOG: Sender <= FFD:250 Ok 5. 2014/08/09 03:26:28 IP:209.85.218.50 SMTP LOG: Sender => FFD:RCPT TO:[email protected]>
    6. 2014/08/09 03:26:34 IP:209.85.218.50 To:[email protected] SMTP LOG: FFD => mydomain.com (x.x.x.x):Connection established 7. 2014/08/09 03:26:34 IP:209.85.218.50 To:[email protected] SMTP LOG: FFD <= mydomain.com (x.x.x.x):220 server.mydomain.com
    ESMTP Service ready 8. 2014/08/09 03:26:34 IP:209.85.218.50 To:[email protected] SMTP LOG: Sender <= FFD:250 Ok 9. 2014/08/09 03:26:35 IP:209.85.218.50 To:[email protected] SMTP LOG: Sender => FFD:968 last bytes of data with dot 10. 2014/08/09 03:28:05
    IP:209.85.218.50 To:[email protected] From:[email protected]:1119780 FP:2603ec6d38c69886eb1000e516fb745a0384e50b SMTP:Delivery still in progress after 90 seconds, recording FP 11. 2014/08/09 03:31:17 IP:209.85.218.50 To:[email protected] SMTP
    LOG: FFD => mydomain.com (x.x.x.x):failed to send the last period(.) 12. 2014/08/09 03:31:17 IP:209.85.218.50 To:[email protected] oremote:Skipping Archive for Sender because did not deliver message 13. 2014/08/09 03:31:17 IP:209.85.218.50 To:[email protected]
    SMTP:451 Remote connection lost - psmtp 14. 2014/08/09 03:31:17 IP:209.85.218.50 To:[email protected] SMTP LOG: Sender <= FFD:451 Remote connection lost - psmtp
    As you can see, on line 9, at 03:26:35, we declared to the receiving server what we were about to send. At the line number 10, almost two minutes passed without an authorization (250 OK) from the receiving server. You can see our status being pushed back
    at that moment to the receiving mail server: SMTP:Delivery still in progress after 90 seconds. Two more minutes later the connection was simply dropped and so we generated a 400 error message to encourage the sending server to try again later (since no bounce
    was given per say from the receiving server, we won't hard-bounce it but defer it).
    I hope this will help. you can try to look in the mydomain.com  inbound logs and see at that exact time what happened? Unfortunately, our visibility pretty much ends there as we don't have full visibility of your mail environment. You'll need to investigate
    within your own environment unfortunately. If you have any more information to share with me, in case it might help me help you, feel free to do so. I'll leave this case opened for now.
    Sincerely,
    Patricia
    Google Enterprise Support

  • Smtp relay on osx 10.9.5 and server 3.2.2

    What we have
    We have a mac mini setup using 10.9.5 and server 3.2.2.    The mail server is OFF but we have a Relay Outgoing Mail through ISP checked (and the proper credentials for the outgoing relay (FQDN) and the authorization credentials.
    What we are trying to do
    Our mac mini runs a php script to generate an email that needs to be sent to users.   The mail has to use a smtp relay and we are trying to use the smtp relay provided by our email vendor.
    Settings required by our email vendor
    Instructions for configuring an email client can be found here
    https://www.namecheap.com/support/knowledgebase/article.aspx/1179/2175/general-c onfiguration-for-mail-clients-and-mobile-devices
    We set up the relay in Mail on the Server 3.2.2 to use SSL and port 465.  In our particular case the relay is configured as shown below.  Obviously the [email protected] is the proper username for our authorization.
    When we try to send mail (we test this function by sending mail from terminal by using the following command (sending mail to myself from myself)
    printf "Subject: TestnHello" | sendmail -f [email protected] [email protected]
    and then watch the mail logs the smtp server rejects our mail due to authorization issues.  The mail log text is shown below (email addresses replaced with [email protected] and IP addresses modified)
    Dec 22 11:57:03 109-218-164-81.lightspeed.austtx.sbcglobal.net postfix/pickup[16825]: 5545383231: uid=501 from=<[email protected]>
    Dec 22 11:57:03 109-218-164-81.lightspeed.austtx.sbcglobal.net postfix/cleanup[16827]: 5545383231: message-id=<[email protected]bal.net>
    Dec 22 11:57:03 109-218-164-81.lightspeed.austtx.sbcglobal.net postfix/qmgr[16826]: 5545383231: from=<[email protected]>, size=340, nrcpt=1 (queue active)
    Dec 22 11:57:03 109-218-164-81.lightspeed.austtx.sbcglobal.net postfix/error[16838]: 5545383231: to=<[email protected]>, relay=none, delay=0.04, delays=0.02/0/0/0.02, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to eforwardct3.name-services.com[216.163.176.39]:465: Connection refused)
    Dec 22 11:57:05 109-218-164-81.lightspeed.austtx.sbcglobal.net postfix/master[16824]: master exit time has arrived
    We find many self help pages on the internet that talk about modifying the main.cf file located at /Library/Server/Mail/Config/postfix.   Some even talk about modifying settings in the master.cf file in /ect/postfix.  I have tried several and none seem to work.
    Can anyone provide some guidance?
    Regards!

    The Server GUI doesn't provide for this use case.
    Take the following steps to configure Postfix to relay mail to a remote SMTP server with password authentication over SSL. Substitute as required for strings in italics below. Address is the fully-qualified domain name of the relay host. The value of port is usually either 25, 465, or 587. Username and password refer to your credentials on the relay host.
    In the current version of OS X Server (but not necessarily in older versions), Steps 1 and 3 should be done for you when you enable relaying and relay authentication in the Server application.
    1. If necessary, create or update the relayhost directive in
         /Library/Server/Mail/Config/postfix/main.cf
    It should look like this:
         relayhost = [address]:port
    2. Add these lines, above the section at the end that begins with the comment "# Mac OS X Server":
         smtp_sasl_security_options =
         smtp_tls_CAfile = /etc/certificates/relayhost.pem
         smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
         smtp_use_tls = yes
    3. If it doesn't already exist, create the password file
         /Library/Server/Mail/Config/postfix/sasl/passwd
    with this content:
         [address]:port
         username:password
    Here address must match $relayhost.
    Then create the password database:
    sudo postmap /Library/Server/Mail/Config/postfix/sasl/passwd
    This action creates the file
         /Library/Server/Mail/Config/postfix/sasl/passwd.db
    The two password files should be readable by root only.
    4. Create the file
         /etc/certificates/relayhost.pem
    with the CA certificate(s) to be trusted for authentication of the remote host. You get those certificates from the service provider. If you can't find a link to download them, try this:
    openssl s_client -connect address:port -showcerts < /dev/null | sed -n '/-BEGIN /,/-END /p' | sudo sh -c 'cat > /etc/certificates/relayhost.pem'
    The command may produce an error message that isn't necessarily significant. For servers that use the older STARTTLS protocol, rather than straight TLS or SSL, this command may need to be modified.
    5. Restart the Mail service.

  • Does SAP can send a mail thru smtp server ?

    Hello everybody ,
            Does sap 4.7 can write a abap program to send a mail thru another smtp server (ex:lotus notes) ?
            because of i hav' t any basis authorzation .
    Thanks in advanced,
    Best Regards,

    Hi,
    As far as i know , it is not possible to send a mail through external server (lotus notes).
    If u dont have the authorizations then just check it with ur BASIS guy.. he can provide u with the same..
    Cheers,
    Simha.

  • Authorization error for referenced class javax/mail/Session.

    All,
    I am trying to compile a java source which is using session object in javax/mail/session.
    I am getting the error java/lang/System: Authorization error for referenced class javax/mail/Session.
    I used "import javax.mail.*;" in my java source..
    I loaded both mail.jar and activation.jar using the below command in different schema other than the schema which above java source exists.
    loadjava -thin -verbose -user <user>/<pwd>@<dburl> -resolve -synonym activation.jar
    loadjava -thin -verbose -user <user>/<pwd>@<dburl> -resolve -synonym mail.jar
    After loading, All java classes in mail.jar and activation.jar were in compiled state in that schema
    Its working well in different database having the same configuration.
    My oracle version is Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production

    I have to accomplish tried in CONSOLE TestMail.class:
    C>java TestMail
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Partmy make.bat:
    javac -g -classpath
    ...\Java\jre1.5.0_06\lib\activation.jar;...\jre1.5.0_06\lib\imap.jar;...\jre1.5.0_06\lib\mail.jar;...\jre1.5.0_06\lib\mailapi.jar;...\jre1.5.0_0\lib\plugin.jar;...\jre1.5.0_06\lib\pop3.jar;...\jre1.5.0_06\lib\smtp.jar;...\jre1.5.0_06\lib\javamail-1_3_2-src-jrl.zip;...\jre1.5.0_06\lib\j2ee.jar  TestMail.javaWhat isn't correct?
    Tanks,
    Mohammad

  • How to comunicate with external services which needs to  authorizated

    Hi,
    I hope i describe the problem cleary.
    Let say we have any oracle job (any plsql procedure) which needs to connect to ftp or smtp where is needed login/password authorization.
    How can i do it? Or where I can save crendentials when I dont want to write it direct to job?
    And how to do it in opposite manner? When i need to connet from os script to database?
    Thank you.
    Regards,
    Tom

    For file transfer the best option is to use scp, then you use keys instead of username/password.
    SMTP can be configured with no password. If it requires username/password then you can keep them in an encrypted plsql package, or an encrypted table.

  • ASA: SMTP Outbound Blocked

    Hello everyone,
    i am having trouble with my outbound SMTP traffic. i have 5510 ASA with IPS module. i also have three interfaces configured the inside, DMZ, and outside. my incoming email pass with no problemes but my outgoing onse do not they get stuck in my DMZ with the follwing message No route to host . from my email relay i can ping even telnet any other port of any server on the internet but when it comes to SNMP it gives me this error. also the same thing happens with the inside. the configuration hasen't changed i also did a packet trace witch gave the result allowed across the board. now i am really stuck and can't figure out what is going on here is my asa config:
    ASA Version 8.2(1)
    hostname dspasa2
    names
    interface Ethernet0/0
    nameif outside
    security-level 0
    ip address X.X.X.165 255.255.255.248
    interface Ethernet0/1
    nameif inside
    security-level 100
    ip address 192.168.0.3 255.255.255.0
    interface Ethernet0/2
    nameif dmz
    security-level 50
    ip address 10.0.0.101 255.255.255.240
    interface Ethernet0/3
    shutdown    
    no nameif
    no security-level
    no ip address
    interface Management0/0
    nameif management
    security-level 100
    ip address 192.168.1.1 255.255.255.0
    management-only
    ftp mode passive
    clock timezone CEST 1
    clock summer-time CEDT recurring last Sun Mar 2:00 last Sun Oct 3:00
    object-group protocol TCPUDP
    protocol-object udp
    protocol-object tcp
    access-list inside_access_in extended permit tcp host 192.168.0.1 any log disable inactive
    access-list inside_access_in extended permit udp host 192.168.0.1 any log disable inactive
    access-list inside_access_in extended permit ip host 192.168.0.4 any log disable
    access-list inside_access_in extended permit tcp host 192.168.0.5 any log disable
    access-list inside_access_in extended permit udp host 192.168.0.5 any log disable
    access-list inside_access_in extended permit tcp 192.168.0.0 255.255.255.0 any eq ftp-data log disable
    access-list inside_access_in extended permit tcp 192.168.0.0 255.255.255.0 any eq ftp log disable
    access-list inside_access_in extended permit icmp 192.168.0.0 255.255.255.0 any log disable
    access-list inside_access_in extended permit tcp 192.168.0.0 255.255.255.0 host 10.0.0.100 eq 8445
    access-list inside_access_in extended permit ip 192.168.0.0 255.255.255.0 192.168.64.0 255.255.192.0
    access-list inside_access_in extended permit ip 192.168.0.0 255.255.255.0 192.168.128.0 255.255.192.0
    access-list inside_access_in extended permit ip 192.168.0.0 255.255.255.0 172.18.1.0 255.255.255.0
    access-list inside_access_in extended permit ip 192.168.0.0 255.255.255.0 172.18.2.0 255.255.255.192
    access-list inside_access_in extended permit object-group TCPUDP host 192.168.0.201 host 81.80.56.164 log disable
    access-list inside_access_in extended permit ip 192.168.0.0 255.255.255.0 192.168.198.0 255.255.255.0
    access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 10.10.10.0 255.255.255.0
    access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 192.168.128.0 255.255.192.0
    access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 172.18.1.0 255.255.255.0
    access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 192.168.200.0 255.255.255.0
    access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 192.168.64.0 255.255.192.0
    access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 172.18.2.0 255.255.255.192
    access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 192.168.198.0 255.255.255.0
    access-list outside_access_in extended permit icmp any any log disable
    access-list outside_access_in extended permit esp any any log disable
    access-list outside_access_in extended permit ah any any log disable
    access-list outside_access_in extended permit udp any any eq isakmp
    access-list outside_access_in extended permit tcp any host X.X.X.161 eq smtp
    access-list outside_access_in extended permit tcp any host  X.X.X.161 eq 8445
    access-list outside_access_in extended permit tcp any host X.X.X.161 eq https
    access-list outside_access_in extended permit object-group TCPUDP any host  X.X.X.164
    access-list dspgroup_splitTunnelAcl standard permit any
    access-list dspgroup_splitTunnelAcl_1 standard permit any
    access-list dspgroup_splitTunnelAcl_2 standard permit any
    access-list snimndb extended permit ip 192.168.0.0 255.255.255.0 192.168.128.0 255.255.192.0
    access-list snimndb extended permit ip 192.168.0.0 255.255.255.0 172.18.1.0 255.255.255.0
    access-list snimndb extended permit ip 192.168.0.0 255.255.255.0 192.168.200.0 255.255.255.0
    access-list snimndb extended permit ip 192.168.0.0 255.255.255.0 192.168.64.0 255.255.192.0
    access-list snimndb extended permit ip 192.168.0.0 255.255.255.0 172.18.2.0 255.255.255.192
    access-list snimndb extended permit ip 192.168.0.0 255.255.255.0 192.168.198.0 255.255.255.0
    access-list SPIL standard permit 192.168.0.0 255.255.255.0
    access-list QOS extended permit ip 192.168.0.0 255.255.255.0 192.168.64.0 255.255.192.0
    access-list dmz-in extended permit icmp any any
    access-list dmz-in extended permit tcp host 10.0.0.100 any eq https
    access-list dmz-in extended permit tcp host 10.0.0.100 any eq www
    access-list dmz-in extended permit udp host 10.0.0.100 any eq domain
    access-list dmz-in extended permit tcp host 10.0.0.100 any eq smtp
    pager lines 24
    logging enable
    logging asdm informational
    mtu outside 1500
    mtu inside 1500
    mtu dmz 1500
    mtu management 1500
    ip local pool VPNPOOL 10.10.10.1-10.10.10.20 mask 255.255.255.0
    ip verify reverse-path interface outside
    ip verify reverse-path interface inside
    no failover
    icmp unreachable rate-limit 1 burst-size 1
    no asdm history enable
    arp timeout 14400
    global (outside) 1 interface
    nat (inside) 0 access-list inside_nat0_outbound
    nat (inside) 1 192.168.0.0 255.255.255.0
    static (inside,dmz) 192.168.0.0 192.168.0.0 netmask 255.255.255.0
    static (dmz,outside)  X.X.X.161 10.0.0.100 netmask 255.255.255.255
    static (outside,inside) 192.168.0.201  X.X.X.164 netmask 255.255.255.255
    access-group outside_access_in in interface outside
    access-group inside_access_in in interface inside
    access-group dmz-in in interface dmz
    route outside 0.0.0.0 0.0.0.0  X.X.X..166 1
    timeout xlate 3:00:00
    timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
    timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
    timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
    timeout tcp-proxy-reassembly 0:01:00
    dynamic-access-policy-record DfltAccessPolicy
    aaa authentication enable console LOCAL
    aaa authentication http console LOCAL
    aaa authentication serial console LOCAL
    aaa authentication ssh console LOCAL
    aaa authorization command LOCAL
    http server enable
    http 192.168.0.0 255.255.0.0 management
    http 192.168.0.0 255.255.0.0 inside
    snmp-server location DSP
    no snmp-server contact
    crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
    crypto ipsec transform-set myset esp-aes esp-md5-hmac
    crypto ipsec security-association lifetime seconds 28800
    crypto ipsec security-association lifetime kilobytes 4608000
    crypto dynamic-map outside_dyn_map 20 set pfs group1
    crypto dynamic-map outside_dyn_map 20 set transform-set ESP-3DES-MD5
    crypto map outside_map 1 match address snimndb
    crypto map outside_map 1 set peer X.X.X.X
    crypto map outside_map 1 set transform-set myset
    crypto map outside_map 1 set security-association lifetime seconds 1800
    crypto map outside_map 65535 ipsec-isakmp dynamic outside_dyn_map
    crypto map outside_map interface outside
    crypto isakmp enable outside
    crypto isakmp policy 1
    authentication pre-share
    encryption 3des
    hash md5    
    group 2
    lifetime 1800
    crypto isakmp ipsec-over-tcp port 10000
    telnet timeout 5
    ssh 192.168.0.0 255.255.255.0 inside
    ssh 192.168.64.0 255.255.255.0 inside
    ssh 192.168.0.0 255.255.0.0 management
    ssh timeout 60
    console timeout 0
    management-access inside
    priority-queue outside
    threat-detection basic-threat
    threat-detection statistics port
    threat-detection statistics protocol
    threat-detection statistics access-list
    threat-detection statistics tcp-intercept rate-interval 30 burst-rate 400 average-rate 200
    ntp server 192.168.0.4 source management
    webvpn
    group-policy dspgroup internal
    group-policy dspgroup attributes
    dns-server value 192.168.0.4 192.168.64.47
    split-tunnel-policy tunnelspecified
    split-tunnel-network-list value SPIL
    default-domain value dsp.snim.com
    tunnel-group DefaultRAGroup ipsec-attributes
    pre-shared-key *
    isakmp keepalive threshold 10 retry 2
    tunnel-group DefaultRAGroup ppp-attributes
    authentication pap
    authentication ms-chap-v2
    authentication eap-proxy
    tunnel-group X.X.X.X type ipsec-l2l
    tunnel-group X.X.X.X ipsec-attributes
    pre-shared-key *
    tunnel-group RAPARIS type remote-access
    tunnel-group RAPARIS general-attributes
    address-pool VPNPOOL
    default-group-policy dspgroup
    tunnel-group RAPARIS ipsec-attributes
    pre-shared-key *
    class-map voix
    match dscp ef
    class-map IPS
    match any
    class-map QOS
    match access-list QOS
    class-map inspection_default
    match default-inspection-traffic
    class-map inspection_defautl
    policy-map type inspect dns preset_dns_map
    parameters
    policy-map voix
    class voix
      priority
    policy-map global_policy
    class inspection_default
      inspect ftp
      inspect h323 h225
      inspect h323 ras
      inspect rsh
      inspect rtsp
      inspect sqlnet
      inspect skinny 
      inspect sunrpc
      inspect xdmcp
      inspect sip 
      inspect netbios
      inspect tftp
    class IPS
      ips promiscuous fail-open
    service-policy global_policy global
    service-policy voix interface outside
    prompt hostname context
    Cryptochecksum:bb43480221ed20aafc3e397fd7432bc3
    : end
    Here is an ouput of the Packet Tracer
    dspasa2# packet-tracer input dmz tcp 10.0.0.100 234 173.194.79.26 25
    Phase: 1
    Type: FLOW-LOOKUP
    Subtype:
    Result: ALLOW
    Config:
    Additional Information:
    Found no matching flow, creating a new flow
    Phase: 2
    Type: ROUTE-LOOKUP
    Subtype: input
    Result: ALLOW
    Config:
    Additional Information:
    in   0.0.0.0         0.0.0.0         outside
    Phase: 3
    Type: ACCESS-LIST
    Subtype: log
    Result: ALLOW
    Config:
    access-group dmz-in in interface dmz
    access-list dmz-in extended permit tcp host 10.0.0.100 any eq smtp
    Additional Information:
    Phase: 4
    Type: IP-OPTIONS
    Subtype:
    Result: ALLOW
    Config:
    Additional Information:
    Phase: 5
    Type: IDS
    Subtype:
    Result: ALLOW
    Config:
    class-map IPS
    match any
    policy-map global_policy
    class IPS
      ips promiscuous fail-open
    service-policy global_policy global
    Additional Information:
    Phase: 6
    Type: NAT
    Subtype:
    Result: ALLOW
    Config:
    static (dmz,outside) X.X.X.161 10.0.0.100 netmask 255.255.255.255
      match ip dmz host 10.0.0.100 outside any
        static translation to X.X.X.161
        translate_hits = 3540, untranslate_hits = 920
    Additional Information:
    Static translate 10.0.0.100/0 to 81.80.56.161/0 using netmask 255.255.255.255
    Phase: 7
    Type: NAT
    Subtype: host-limits
    Result: ALLOW
    Config:
    static (dmz,outside) X.X.X.161 10.0.0.100 netmask 255.255.255.255
      match ip dmz host 10.0.0.100 outside any
        static translation to X.X.X.161
        translate_hits = 3540, untranslate_hits = 920
    Additional Information:
    Phase: 8
    Type: IP-OPTIONS
    Subtype:
    Result: ALLOW
    Config:      
    Additional Information:
    Phase: 9
    Type: FLOW-CREATION
    Subtype:
    Result: ALLOW
    Config:
    Additional Information:
    New flow created with id 8470, packet dispatched to next module
    Result:
    input-interface: dmz
    input-status: up
    input-line-status: up
    output-interface: outside
    output-status: up
    output-line-status: up
    Action: allow
    please help

    Hi,
    I bealeve that you must to edit your policy map and add to your default inspection the smtp traffic.
    policy-map global_policy
    class inspection_default
      inspect smtp
    Because your dmz is more trustable than the outside interface, I think you must include this type of traffic to the global inspection.
    Take care man.

Maybe you are looking for

  • 15.0.0.152 , Chrome and windows 8.1, not possible to pre-buffer

    I recently started experiencing issues with watching streams online. I have a wireless connection for my laptop, and i normally have to pause the stream for a couple of minutes to let it buffer a little of the video before i start watching anything.

  • IPhone software update 2.2 error

    I'm trying to update to the 2.2 firmware but I keep getting the following error message: +The iPhone "iPhone could not be restored. An unknown error occurred (14).+ I'm using the latest version of iTunes (updated it just an hour ago) and the latest v

  • Error Installing Reporting Server

    Hello, I am trying to install SCOM 2007 R2 Reporting Server so I can upgrade to SCOM 2012.  I get this error:  Error 26204 Error-2147217900 Conversion failed when converting from a character string to uniqueidentifier What is the issue with my instal

  • Event Photography/Viewing Stations & iPhoto

    Hi Everyone, I'm looking to expand my sports photography business by adding viewing stations. Ideally, I'd like to have 4-6 kiosks where the monitor & keyboard tie into a central computer (which I'll also have to purchase). I'd like to be able to hav

  • TS4425 Photo Stream Won't Work!

    I have updated the software to 5.2 and I am still getting the same error message! does Anyone know what I need to do?