Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to run the webpage from /home/pedro/mywebpage This is my /etc/apache/mods-available/php5.conf I commented out the last bit. I thought it would make php work there.
Quote:
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in specific virtual host or directory
Order Deny,Allow
Deny from all
</FilesMatch>
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(p[345]?|t|tml|ps)$">
Order Deny,Allow
Deny from all
</FilesMatch>
# Running PHP scripts in user directories is disabled by default
#
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
#the following commented out by me
#<IfModule mod_userdir.c>
# <Directory /home/*/public_html>
# php_admin_flag engine Off
# </Directory>
#</IfModule>
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;changed by me
sendmail_path = /usr/sbin/sendmail -t -i
;sendmail_path =
[side note: I got a message that it would be impossible to send email from my home computer to the public internet. If that's true I can stop wasting my time.]
Thanks for that.
I got apache2 working. I got the default page. So I moved my personal webpage to /var/www/html and it works, I see it when I enter localhost in Firefox.
I got php working. I get the php info page.
My problem seems to lie in sendmail. sendmail was present in /usr/sbin but it was a dummy, almost empty file.
So I installed sendmail, which seems quite complex, a lot of files which may or may not need tweaking.
I ran sendmailconfig and that's probably where the devil lies: too many settings, which are right for me??
I am in China, so I use mail.qq.com
The domain is qq.com, POP3 is pop.qq.com:995 smtp is smtp.qq.com ports 465 to 587
I want my webpage to send mail to my qq mail address when the user clicks submit.
php has the function mail()
My contact form page does not give me any error message, but I do not get any mail.
The trick here is, I believe, to get sendmail working. If you know a good link for that, I would be very grateful.
I don't know if php can work with postfix, which is more 'native' to Ubuntu.
This link is good, but I can't get sendmail to work. Is it really that difficult??
Maybe, when I get around to publishing my web page, it will work on the server. I would still like to make it work on my laptop, just for the experience.
I think I need a working smtp server to send the mails.
This does not work at the moment and I don't know why. I changed the email to my email.
Quote:
$ echo "My test email being sent from sendmail" | /usr/sbin/sendmail myemail@domain.com
This is the last bit of /var/log/mail.log from yesterday
Quote:
Jun 27 21:49:23 pedro-schule sendmail[3670]: alias database /etc/mail/aliases rebuilt by pedro
Jun 27 21:49:23 pedro-schule sendmail[3670]: NOQUEUE: SYSERR(root): /etc/mail/aliases: line 1: missing colon
Jun 27 21:49:23 pedro-schule sendmail[3670]: /etc/mail/aliases: 0 aliases, longest 0 bytes, 0 bytes total
Jun 27 21:49:37 pedro-schule sm-mta[1445]: restarting /usr/sbin/sendmail-mta due to signal
Jun 27 21:49:37 pedro-schule sm-mta[3714]: starting daemon (8.14.4): SMTP+queueing@00:10:00
Jun 27 21:51:34 pedro-schule sendmail[3891]: u5RDpYPs003891: from=www-data, size=99, class=0, nrcpts=1, msgid=<201606271351.u5RDpYPs003891@pedro-schule.net>, relay=www-data@localhost
Jun 27 21:51:34 pedro-schule sm-mta[3892]: STARTTLS=server, relay=localhost [127.0.0.1], version=TLSv1/SSLv3, verify=NOT, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Jun 27 21:51:34 pedro-schule sendmail[3891]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Jun 27 21:51:34 pedro-schule sm-mta[3892]: u5RDpYmo003892: from=<www-data@pedro-schule.net>, size=328, class=0, nrcpts=1, msgid=<201606271351.u5RDpYPs003891@pedro-schule.net>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jun 27 21:51:34 pedro-schule sendmail[3891]: u5RDpYPs003891: to=rapidresults@foxmail.com, ctladdr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30099, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u5RDpYmo003892 Message accepted for delivery)
Jun 27 21:51:35 pedro-schule sm-mta[3894]: STARTTLS=client, relay=mx2.qq.com., version=TLSv1/SSLv3, verify=OK, cipher=RC4-SHA, bits=128/128
Jun 27 21:51:40 pedro-schule sm-mta[3894]: u5RDpYmo003892: to=<rapidresults@foxmail.com>, ctladdr=<www-data@pedro-schule.net> (33/33), delay=00:00:06, xdelay=00:00:06, mailer=esmtp, pri=120328, relay=mx2.qq.com. [120.198.201.148], dsn=5.0.0, stat=Service unavailable
Jun 27 21:51:40 pedro-schule sm-mta[3894]: u5RDpYmo003892: u5RDpemn003894: DSN: Service unavailable
Jun 27 21:51:40 pedro-schule sm-mta[3894]: u5RDpemn003894: to=<www-data@pedro-schule.net>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
Also, I'm not sure if the sendmail path in /etc/php5/apache2/php.ini should have "" or not:
Well, I got the tip to use ssmtp, they said sendmail or postfix are both overkills for my purpose, which is just sending an email to me.
I installed ssmtp which uninstalls sendmail, puts a symlink in /usr/sbin
I am getting closer.
This is the last bit of my /var/log/mail this morning:
Quote:
Jun 28 10:00:02 pedro-schule sSMTP[2182]: Server didn't like our AUTH LOGIN (530 Must issue a STARTTLS command first.)
Jun 28 10:06:14 pedro-schule sSMTP[2841]: Server didn't like our AUTH LOGIN (530 Must issue a STARTTLS command first.)
Jun 28 10:09:02 pedro-schule sSMTP[2916]: Server didn't like our AUTH LOGIN (530 Must issue a STARTTLS command first.)
Jun 28 10:19:54 pedro-schule sSMTP[3093]: Creating SSL connection to host
Jun 28 10:19:55 pedro-schule sSMTP[3093]: SSL connection using RSA_ARCFOUR_SHA1
Jun 28 10:19:55 pedro-schule sSMTP[3093]: Authorization failed (535 Error: \C7\EBʹ\D3\C3\CA\DAȨ\C2\EB\B5\C7¼\A1\A3\CF\EA\C7\E9\C7뿴: http://service.mail.qq.com/cgi-bin/h...28&&no=1001256)
Jun 28 10:20:01 pedro-schule sSMTP[3114]: Creating SSL connection to host
Jun 28 10:20:01 pedro-schule sSMTP[3114]: SSL connection using RSA_ARCFOUR_SHA1
Jun 28 10:20:02 pedro-schule sSMTP[3114]: Authorization failed (535 Error: \C7\EBʹ\D3\C3\CA\DAȨ\C2\EB\B5\C7¼\A1\A3\CF\EA\C7\E9\C7뿴: http://service.mail.qq.com/cgi-bin/h...28&&no=1001256)
Ok, I've just got ssmtp working on my test rig (Mint 17.3 64-bit Xfce). Here is how I did it. Replace gedit with your editor of choice and items in italics with your particular details. I've set this up with gmail - I would advise you to do that in the first place and then try with another email provider after you get it working.
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=username@gmail.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587
AuthUser=username@gmail.com
AuthPass=password
UseTLS=YES
UseSTARTTLS=YES
# Where will the mail seem to come from?
rewriteDomain=gmail.com
# The full hostname
hostname=smtp.gmail.com:587
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
Then I went onto Gmail and changed the following setting:
Code:
My Account->Sign-in & security->Allow less secure apps: ON
Then back on the command line:
Code:
ssmtp destination_email_address
and entered:
Code:
To: destination_email_address
From: username@gmail.com
Subject: Testing
Hello world!
Thanks for your efforts on my behalf! Very grateful!
I looked through all the settings on my email settings, but I do not find anything corresponding to
Quote:
My Account->Sign-in & security->Allow less secure apps: ON
I tried setting the AuthMeth to CRAM-MD5 but then I get:
Quote:
Jun 29 08:04:58 pedro-schule sSMTP[3651]: SSL connection using RSA_ARCFOUR_SHA1
Jun 29 08:04:58 pedro-schule sSMTP[3651]: Server rejected AUTH CRAM-MD5 (502 Error: auth command not implemented)
Without that I get the same as yesterday:
Quote:
Jun 29 08:06:50 pedro-schule sSMTP[3657]: Creating SSL connection to host
Jun 29 08:06:50 pedro-schule sSMTP[3657]: SSL connection using RSA_ARCFOUR_SHA1
Jun 29 08:06:51 pedro-schule sSMTP[3657]: Authorization failed (535 Error: \C7\EBʹ\D3\C3\CA\DAȨ\C2\EB\B5\C7¼\A1\A3\CF\EA\C7\E9\C7뿴: http://service.mail.qq.com/cgi-bin/h...28&&no=1001256)
In a terminal I am getting the same errors showing as are written to the mail.log.
In China you have to get a license (ICP Internet Content Provider license) to open a web site. We have that now, but the ISP says they have not yet been officially informed by the authorities, so web site is not public yet. Once our webpage is open I'll try this again from the web site. If it doesn't work then, I'll ask the ISP to help.
You perhaps missed the bit where I said "Then I went onto Gmail and changed the following setting:".
Code:
My Account->Sign-in & security->Allow less secure apps: ON
should be done in your Gmail account.
Are you able to have access to a Gmail account to test carry out the steps I laid out? It will no doubt work with other email providers, although not all, but I know it works with Gmail.
You shouldn't need to be playing around with other settings. Try to keep it simple.
been away for a few days, sorry for the late reply. I did note your advice about the setting, but qqmail does not have an equivalent setting, as far as I can see.
We live in China. google is not available except using a vpn. I can't just open gmail. I have a vpn, but not everybody does, so I'd rather not use gmail. The mails sent from here may or may not arrive, depending on the mood of the government!
qq is big in China, everyone has it. foxmail.com is just an alias for qq.com
Once the site is open, I'll try this from there. We still haven't got a functioning webpage, they company still has not received official approval, although we have.
to take up this thread again: now we have our web page online, but the contact form still will not work. I wonder if you have any idea why not.
If you go to www.rapidresults.wang and then contact>send us a message you can see the contact form.
A right click and you can view the source code. If you then click on send_mail.php you will see this error:
Quote:
PHP Notice: Undefined index: email_address in D:\freehost\fa5d40d2\web\send_mail.php on line 21
PHP Notice: Undefined index: comments in D:\freehost\fa5d40d2\web\send_mail.php on line 22
<td>
<input type="text" name="email_address" value="" maxlength="100" style="width:260px; height:20px; background-color:#D0F18F;" />
</td>
</tr>
<tr>
<td>Comments:</td>
<td>
<textarea name="comments" id="comments" style="text-align:left; width:520px; height:90px; background-color:#D0F18F;">
This form is NOT working at the moment, please email us directly. Sorry for the inconvenience.
</textarea>
</td>
It still won't work. The web hosting people are useless, they just say we don't know anything about web pages, but I think I may know why it will not work: The server is a Windows server and Windows does not/may not use PHP, it uses asp.net, whatever that is.
I saw a tutorial on the net about how to set up a contact form using asp. Haven't tried it yet, but I will look into it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.