Where are the sendmail configuration files?

I am having trouble successfully sending mail from my SuSE 10 server running Apache 2.  After working with the network administrator, messages now reach the outbound mail server, but they are being bumped back.

Here is an excerpt from /var/mail/root:

"This is the Postfix program at host domain.example.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                        The Postfix program

<me@example.com>: host
    gmail-smtp-msa.l.google.com[74.125.95.109] said: 530 5.7.0 Must issue a
    STARTTLS command first. 20sm404192iwn.5 (in reply to MAIL FROM command)

...

Reporting-MTA: dns; domain.example.com
X-Postfix-Queue-ID: D291D23925
X-Postfix-Sender: rfc822; wwwrun@domain.example.com
Arrival-Date: Thu,  1 Apr 2010 18:26:33 -0500 (CDT)

Final-Recipient: rfc822; me@example.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host gmail-smtp-msa.l.google.com[74.125.95.109]
    said: 530 5.7.0 Must issue a STARTTLS command first. 20sm404192iwn.5 (in
    reply to MAIL FROM command)"

If I search for the diagnostic code, all of the solutions say to modify sendmail configuration files, like "master.cf" and "main.cf".  However, I can't find such files on my server; 'find / -name "main" -print' returns nothing.  In addition, when I run "cd /etc/mail" to navigate to the directory where everything is supposedly stored, I get the message:

"-bash: cd: /etc/mail: No such file or directory"

Do I have to create my own configuration files?  Once I get/find the config files, what do you recommend that I add/modify to fix the mailing error posted above?  And once everything is set, is it good to go, or will I have to restart Apache or reboot the Virtual Machine?

P.S. I am sending mail through PHP's "mail()" function, which I read uses the "sendmail" command.
LVL 1
sffcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Avinash ZalaWeb ExpertCommented:
if you are using the php's mail() function and there are only three things to be set properly in php.ini file

Here are that variables:

[mail function]
; For Win32 only.
SMTP = your SMPT host
smtp_port = Your SMTP Port, usually 25

; For Win32 only.
sendmail_from = me@example.com

If you are running on Linux

then set the below variable

sendmail_path =

for set up this variable check below link:

http://askville.amazon.com/setup-sendmail_path-variable-php-ini-file-sendmail-server-configured/AnswerViewer.do?requestId=13576366

Hope this helps.
Addy
0
ajay_mhasalCommented:
Hi,

As per the returned mail you are using postfix and not the sendmail and to fix this edit file "/etc/postfix/main.cf" and add following two line in it

smtpd_use_tls = yes
smtpd_tls_auth_only = no

And finally restart postfix.

# service postfix restart

Note: Php;s mail() function works fine with postfix and you just need to fix the problem of postfix without changing the function.
0
sffcAuthor Commented:
Hi ajay_mhasal,

I changed those lines in /etc/postfix/main.cf, and I seem to be making progress.  At first the TLS still wasn't running, but I ran "postfix upgrade-configuration", and this solved the problem.  I also put the entry "smtp_tls_loglevel = 2" into main.cf.  My message still doesn't send, but at least it is establishing a secure connection (I think).  Here is the log for an e-mail I tried sending:

Apr  2 16:13:30 myserver postfix/pickup[27628]: 896CA26E1B: uid=30 from=<wwwrun>
Apr  2 16:13:30 myserver postfix/cleanup[27709]: 896CA26E1B: message-id=<20100402211330.896CA26E1B@myserver.domain.org>
Apr  2 16:13:30 myserver postfix/qmgr[27629]: 896CA26E1B: from=<wwwrun@myserver.domain.org>, size=420, nrcpt=1 (queue active)
Apr  2 16:13:30 myserver postfix/smtp[27641]: setting up TLS connection to gmail-smtp-msa.l.google.com
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:before/connect initialization
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv2/v3 write client hello A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv2/v3 read server hello A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read server hello A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read server hello A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 read server hello A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read server certificate A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read server certificate A
Apr  2 16:13:30 myserver postfix/smtp[27641]: certificate verification depth=0 subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
Apr  2 16:13:30 myserver postfix/smtp[27641]: certificate verification failed for gmail-smtp-msa.l.google.com: num=20:unable to get local issuer certificate
Apr  2 16:13:30 myserver postfix/smtp[27641]: verify return: 0
Apr  2 16:13:30 myserver postfix/smtp[27641]: certificate verification depth=0 subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
Apr  2 16:13:30 myserver postfix/smtp[27641]: certificate verification failed for gmail-smtp-msa.l.google.com: num=27:certificate not trusted
Apr  2 16:13:30 myserver postfix/smtp[27641]: verify return: 0
Apr  2 16:13:30 myserver postfix/smtp[27641]: certificate verification depth=0 subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
Apr  2 16:13:30 myserver postfix/smtp[27641]: certificate verification failed for gmail-smtp-msa.l.google.com: num=21:unable to verify the first certificate
Apr  2 16:13:30 myserver postfix/smtp[27641]: verify return: 0
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 read server certificate A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read server key exchange A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read server key exchange A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 read server done A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 write client key exchange A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 write change cipher spec A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 write finished A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 flush data
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read finished A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read finished A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read finished A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:error in SSLv3 read finished A
Apr  2 16:13:30 myserver postfix/smtp[27641]: SSL_connect:SSLv3 read finished A
Apr  2 16:13:30 myserver postfix/smtp[27641]: Unverified: subject_CN=smtp.gmail.com, issuer=Thawte Premium Server CA
Apr  2 16:13:30 myserver postfix/smtp[27641]: TLS connection established to gmail-smtp-msa.l.google.com: TLSv1 with cipher RC4-MD5 (128/128 bits)
Apr  2 16:13:30 myserver postfix/smtp[27641]: Server certificate could not be verified
Apr  2 16:13:31 myserver postfix/smtp[27641]: 896CA26E1B: to=<email@domain.org>, relay=gmail-smtp-msa.l.google.com[74.125.95.109], delay=1, status=deferred (Authentication failed: SASL authentication failed; server gmail-smtp-msa.l.google.com[74.125.95.109] said: 535-5.7.1 Username and Password not accepted. Learn more at                   ?535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 22sm217115iwn.0)

Obviously, I'm trying to connect to Gmail's SMTP server.

Does this give any clues to the next step?

Thanks for your help so far!
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

ajay_mhasalCommented:
HI,

I thought you were using local smtp server to send mail, Gmail smtp does not allows to send the mail without authentication and pl. visit follwoing URL's if you wish to use gmail's smtp

http://deepakssn.blogspot.com/2006/06/gmail-php-send-email-using-php-with.html

http://www.24hourapps.com/2009/02/php-mail-using-gmail-smtp-and-phpmailer.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
uaynebCommented:
Just a quick note about your first post

I dont' think find / -name "main" -print would work .  You'd need "find / -name "main.cf" -print"  or else "find / -name "main*" -print

Other ways if finding things on unfamiliar systems in general

If you install findutils-locate package you can use the "updatedb" and "locate" command (this isn't installed by default on suse).  You would run updatedb manually to initialize the db (instalilng findutils-locate also puts this in cron). And then you can use the locate command

The second way is if you know where the postfix or sendmail binary is, you can see if a package installed it using rpm command. If it lists a package (e.g. foobar.rpm) then you can query to see the list of files in that package .  And most likely you'll see what directory it installed the config files in.

e.g. on my sles10sp2 box

sles10sp2:~ # which postfix
/usr/sbin/postfix  <-- path of postfix
sles10sp2:~ # rpm -q -f /usr/sbin/postfix <-- query package that installed it
postfix-2.2.9-10.23  <-- package name is "postfix" with version 2.2.29
sles10sp2:~ # rpm -q --list postfix | grep main.cf  <-- query package name and optionally grep for file
/etc/postfix/main.cf
/etc/postfix/main.cf.default
/var/adm/backup/postfix/main.cf
sles10sp2:~ #


0
sffcAuthor Commented:
Oh yeah, I almost forgot to choose the solutions on this question!  The answer I ended up going with was ajay_mhasal's idea of using a PHP-powered class like PHPMailer rather than routing it through Linux.  It works well!

Also, I also discovered why I couldn't find the sendmail configuration files: even though sendmail worked, it was essentially just an "alias" for postfix!

I don't see the "Accept Multiple Solutions" button any more, but I want to assign some points to one solution and the rest to another solution.  Could you take the alert off so that this option is available again?
0
sffcAuthor Commented:
I have posted the answer to this question on the question thread.  Please remove the alert on this question so that I can accept multiple solutions.
0
sffcAuthor Commented:
The PHP-based mailing methods work well!  The reason that there were no sendmail configuration files is because sendmail was simply an "alias" for postfix.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.