Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i need help for sendmail configuration in our linux machine.

Here the things: I want to send email to outside by using our exchange server as the mail relay.But when sending the email through the server,it will response "user unknown".To make it worse, it will bounce back all the sent message to my localhost.

I already tested our configuration by using external mail server such as gmail and yahoo,the configuration is working without any issue and the email can be sent to the recipient.Most of the configuration of my sendmail is based on here.

authinfo file :

AuthInfo:my_exchange_server "U:my_name" "I:my_email" "P:my_passwd" "M:PLAIN LOGIN"
AuthInfo:my_exchange_server:587 "U:my_name" "I:my_email" "P:my_passwd" "M:PLAIN LOGIN"

sendmail.mc :

FEATURE(authinfo,hash /etc/mail/authinfo.db)
define(`SMART_HOST', `my_exchange server')dnl
define('RELAY_MAILER_ARGS', 'TCP $h 587')
define('ESMTP_MAILER_ARGS', 'TCP $h 587')
define('confCACERT_PATH', '/usr/share/ssl/certs')
define('confCACET','/usr/share/ssl/certs/ca-bundle.crt')
define('confSERVER_CERT','/usr/share/ssl/certs/sendmail.pem')
define('confSERVER_KEY','/usr/share/ssl/certs/sendmail.pem')
define('confAUTH_MECHANISMS', 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
TRUST_AUTH_MECH('EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
define('confAUTH_OPTIONS, 'A')dnl

My first assumptions the problem occur is due to the authentication problem, as exchange server need encrypted authentication (DIGEST-MD5).I have already changed this in the authinfo file (from plain login to digest-md5 login) but still not working.

I also can telnet our exchange server.So the port is not being blocked by firewall.

Can someone help me out with this problems?I'm really at wits ends. Thanks.

share|improve this question
    
Have you added the IP of your sendmail box to the list of IPs that are allowed to relay mail through exchange? –  EEAA May 15 '12 at 3:07
    
@ErikA how can i do that?can you show me the way? –  user119720 May 15 '12 at 3:11

2 Answers 2

First of all, try testing your exchange relay by following these directions:

http://support.microsoft.com/kb/153119

Depending which version of exchange you're running, you may also need to setup a new receive connector and allow your Linux server to relay through it.

http://technet.microsoft.com/en-us/library/bb232021.aspx

Always make sure you test your server afterwards to make sure you haven't inadvertently created an open relay.

share|improve this answer
    
I have already tested my exchange relay but it show this error: 530 5.7.1 Client was not authenticated Connection closed by foreign host. maybe this is because of the security reasons? –  user119720 May 15 '12 at 3:56
    
Did you specify the IP for the server in the send connector? So it's actually allowed to relay? Did you also restart the transport service after making the changes to the connector? –  xstnc May 15 '12 at 6:16
    
Also: do you try to auth with a special account? If so, do you HAVE to? Could it be set to Anonymous? –  xstnc May 15 '12 at 6:23
    
@xstnc can i know where should i check the settings that you have mention?is it in our sendmail box or is it at the exchange mail server?because if its in the exchange mail server i need to wait as I do not have the permission to access that server =( –  user119720 May 15 '12 at 7:07
    
Sorry that I forgot to mention! Some of it is exchange and some of it is sendmail. The smtp relay and connector is set in exchange, and the auth I was asking about is the sendmail server. If you can't check the exchange, it would be a good place to start checking the auth for the other server! –  xstnc May 15 '12 at 7:13

Create anonymous relay connector on Exchange Server

Create connector using powershell

New-ReceiveConnector -Name "Anonymous Relay" -Usage Custom -PermissionGroups AnonymousUsers -Bindings 0.0.0.0:26 -RemoteIpRanges 192.168.1.1

-RemoteIpRanges Parameter is allowed to relay server ip address

Add permissions

Get-ReceiveConnector "Anonymous Relay" | Add-ADPermission -User "NT AUTHORITY\ANONYMOUS LOGON" -ExtendedRights "Ms-Exch-SMTP-Accept-Any-Recipient"

No auth nesessary after this powershell command

Add allowed relay server ip to list

$RecvConn = Get-ReceiveConnector "Anonymous Relay"
$RecvConn.RemoteIPRanges += "192.168.1.2", "178.151.1.2", "8.8.8.2"
Set-ReceiveConnector "Anonymous Relay" -RemoteIPRanges $RecvConn.RemoteIPRanges

Links

All info avalible on MS TechNet Allow Anonymous Relay on a Receive Connector

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.