LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   provide username and password with sendmail (https://www.linuxquestions.org/questions/programming-9/provide-username-and-password-with-sendmail-775761/)

rooky 12-15-2009 05:16 AM

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.

centosboy 12-15-2009 05:44 AM

Quote:

Originally Posted by rooky (Post 3792107)
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.

rooky 12-15-2009 06:20 AM

Quote:

Originally Posted by centosboy (Post 3792129)
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

centosboy 12-15-2009 08:44 AM

Quote:

Originally Posted by rooky (Post 3792163)
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

rooky 12-15-2009 11:42 AM

Quote:

Originally Posted by centosboy (Post 3792277)
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?

centosboy 12-15-2009 01:00 PM

i dont know...but i know you can do the way i sent you in that link...

rooky 12-16-2009 12:43 AM

Okay, what do u suggest about the missing sendmail.mc file??
Do i need to create one?

centosboy 12-16-2009 01:41 PM

Quote:

Originally Posted by rooky (Post 3793264)
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?


All times are GMT -5. The time now is 06:24 PM.