LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-15-2009, 05:16 AM   #1
rooky
LQ Newbie
 
Registered: Apr 2009
Location: India
Distribution: Mandriva 8, RHEL
Posts: 14

Rep: Reputation: 0
Post provide username and password with sendmail


Hi,

I am writing a shell script to send mail notifications. But while trying to send a mail from my system, (using sendmail) it says:

"Client does not have permission to submit mail to this server"

I think i need to provide username/password with /usr/lib/sendmail. But I could not find the options in man pages.

Can anyone help me with the syntax please?

Thanx,
Rooky.
 
Old 12-15-2009, 05:44 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by rooky View Post
Hi,

I am writing a shell script to send mail notifications. But while trying to send a mail from my system, (using sendmail) it says:

"Client does not have permission to submit mail to this server"

I think i need to provide username/password with /usr/lib/sendmail. But I could not find the options in man pages.

Can anyone help me with the syntax please?

Thanx,
Rooky.
if your server uses authsmtp, then yes you will have to. but you have not given enough of the error for anyone to know. it could be just locked down by ip...??

look for lines such as these in the sendmail.mc

Code:
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
if this is the case you have to encode the user name and pass before you are allowed to send email.

see here:-
https://helpdesk.ndchost.com/index.p...kbarticleid=49



a true test to see why you cannot send email is to telnet to the mail server on port 25 and identify yourself if it gets that far. from the return codes you will be able to see why you cannot send email.

Last edited by centosboy; 12-15-2009 at 05:47 AM.
 
Old 12-15-2009, 06:20 AM   #3
rooky
LQ Newbie
 
Registered: Apr 2009
Location: India
Distribution: Mandriva 8, RHEL
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by centosboy View Post
look for lines such as these in the sendmail.mc

Code:
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
There is no sendmail.mc file in my /etc/mail directory

my /etc/mail consists of:

sendmail.hf, sendmail.cf, submit.cf

Here is the error snapshot:

reciever@somewhere.com... Connecting to [mail.server.ip.addr] via relay...
220 mail.server.somewhere.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Tue, 15 Dec 2009 16:39:56 +0530
>>> EHLO somewhere.com
250-mail.server.somewhere.com Hello [mail.server.ip.addr]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
>>> MAIL From:<sender@somewhere.com> SIZE=156
454 5.7.3 Client does not have permission to submit mail to this server.
reciever@somewhere.com... Deferred: 454 5.7.3 Client does not have permission to submit mail to this server.
Closing connection to [mail.server.ip.addr]
>>> QUIT
 
Old 12-15-2009, 08:44 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by rooky View Post
There is no sendmail.mc file in my /etc/mail directory

my /etc/mail consists of:

sendmail.hf, sendmail.cf, submit.cf

Here is the error snapshot:

reciever@somewhere.com... Connecting to [mail.server.ip.addr] via relay...
220 mail.server.somewhere.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Tue, 15 Dec 2009 16:39:56 +0530
>>> EHLO somewhere.com
250-mail.server.somewhere.com Hello [mail.server.ip.addr]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
>>> MAIL From:<sender@somewhere.com> SIZE=156
454 5.7.3 Client does not have permission to submit mail to this server.
reciever@somewhere.com... Deferred: 454 5.7.3 Client does not have permission to submit mail to this server.
Closing connection to [mail.server.ip.addr]
>>> QUIT
oh sorry - thought you administered the remote smtp server.
from the error, it looks you are simply not allowed to relay mail via this server.could be one of many reasons..blacklisted...no proper rDNS...need to authenticate first..
something you would have to check with the server administrator
 
Old 12-15-2009, 11:42 AM   #5
rooky
LQ Newbie
 
Registered: Apr 2009
Location: India
Distribution: Mandriva 8, RHEL
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by centosboy View Post
oh sorry - thought you administered the remote smtp server.
from the error, it looks you are simply not allowed to relay mail via this server.could be one of many reasons..blacklisted...no proper rDNS...need to authenticate first..
something you would have to check with the server administrator
I do have an account in the server. The question is how do i provide the username/password with sendmail so that the server relays my mail?
 
Old 12-15-2009, 01:00 PM   #6
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
i dont know...but i know you can do the way i sent you in that link...
 
Old 12-16-2009, 12:43 AM   #7
rooky
LQ Newbie
 
Registered: Apr 2009
Location: India
Distribution: Mandriva 8, RHEL
Posts: 14

Original Poster
Rep: Reputation: 0
Okay, what do u suggest about the missing sendmail.mc file??
Do i need to create one?
 
Old 12-16-2009, 01:41 PM   #8
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by rooky View Post
Okay, what do u suggest about the missing sendmail.mc file??
Do i need to create one?
on a redhat distro it should be in /etc/mail.
not sure if it is missing - did you search?? was redhat an rpm install??
if so

rpm -qc sendmail
or
rpm -ql sendmail

or locate sendmail.mc

anyway, you dont need to touch this file for what you want to do as far as i know.
i think you just have to find another way of sending the mail so that it can do an smtp auth when connecting to remote smtp server.
tbh - you shouldnt have to authenticate if you are relaying mail. does this server point to mx records?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can any one provide me solution on the sendmail server ravindersingh Linux - Server 1 12-25-2008 12:24 PM
How to provide password from command prompt ? p_s_shah Solaris / OpenSolaris 5 06-09-2008 07:59 AM
Supplying hostname/username/password to sendmail pwabrahams Linux - Networking 1 01-09-2007 08:32 PM
How to provide password for pppd at runtime deepalalla Linux - Networking 0 12-29-2004 04:33 AM
How to config sendmail to require username/password? jimwillsher Linux - Security 1 02-09-2004 09:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration