The Perfect Setup - Debian Etch: smart_host
On Fedora Core 6 in /etc/mail/sendmail.mc I configured Sendmail's smart_host, so visitors of my site practically use my ISP's smtp server to send me their message filling in a web form. For configuration I used instructions provided by: http://www.go2linux.org/node/35.
Now I have Postfix, because I've set up Debian Etch following the guide lines of The Perfect Setup instructions.
Can anyone tell me how to do a smart-host like configuration now, so my visitors can keep on doing the same thing: send me mail using a web form on my site?
No reax, so question 2: is there a form mail for Postfix?
My ISP is 1&1 in Germany and they have strange habits. For example, I cannot get a PHP mail form script working. This is what 1&1 says about it: The only FormMail script you can use on the 1&1 servers is the NMS FormMail.pl. This can be downloaded from http://nms-cgi.sourceforge.net/scripts.shtml. (See: http://faq.1and1.com/scripting_langu...ned/index.html. As a matter of fact, FormMail.pl works with Sendmail, not Postfix.
Nevertheless, on Fedora Core 6 I did get form mail working with a perl script that addresses Sendmail. The script was written by Kristina Pfaff-Harris and it can be found here: http://tesol.net/scripts/AutoCGIMail/.
For the Perfect Etch Setup on my Debian machine I installed Postfix instead of Sendmail. Kristina does not offer her script for Postfix.
My question: can anyone recommend a good Postfix mail form script?
So can I use Postfix just like Sendmail?
Thank you, Falko, for your response.
If Postfix works like Sendmail, does that mean that I can change Sendmail to Postfix and everything works fine?
I've tried that before. On my FC6 machine with Sendmail I've got a perl script with content as displayed below. After configuring smarthost in Postfix on my Debian machine I tried this same perl script after changing every instance of Sendmail in the cgi file to Postfix. I didn't really believe it would work, but if experts tell me Postfix behaves like Sendmail, I assume that scripts written for Sendmail work with Postscript. It didn't.
Below is a part of the cgi file where I changed every instance of sendmail to postfix (I didn't change it below and I tried the script also in its original form, but nothing worked):
# This email script generated by AutoCGIMail v1.2
# by Kristina Pfaff-Harris (http://www.tesol.net/scripts/)
# If you're having problems getting this to work, try putting
# $debugging = 1; on the next line.
$path_to_sendmail = "/usr/sbin/sendmail";
$email_field = "01Uw_e-mailadres";
$use_autoresponse = "Yes";
$autoresponse_message1 = "Geachte ";
$autoresponse_message2 = ",
But it's all not that simple. So how do I adapt things in such a way that my perl scripts, working well in Sendmail, keep on working in Postfix?
(Later this week I'll configure the apps again and try instructions at http://www.fredshack.com/docs/postfix.html)
During my experiments to get to know Debian and ISPConfig I always login as root. If something goes really wrong, I just reinstall the OS.
# which sendmail
No luck: that's what is in my cgi script already.
I'll describe the working situation first.
Let's assume you own domain happydomain.com. Let's also assume that your ISP's outgoing mail server uses this smtp code: smtp.nicehost.com, and your email address is firstname.lastname@example.org.
user name: blahusername
Say you need an smtp server to send email through mail forms on your web page, hosted on your own server at home. If you want to use your ISP's smtp server you can do this with the help of smarthost.
The following configuration works flawlessly in Fedora Core 6 (FC6) with Sendmail:
In /etc/mail/sendmail.mc add these lines:
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
These lines have to be modified to look like:
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
In order to authenticate to the email server of your ISP make sure to have the following line in the file /etc/mail/sendmail.mc:
FEATURE(`authinfo', `hash /etc/mail/authinfo')
and create this file:
with this inside:
AuthInfo:your.smtp.server "U:email@example.com" "I:user" "P: passwd" "M:LOGIN PLAIN"
where you modify this line to look like this:
AuthInfo:smtp.nicehost.com "U:firstname.lastname@example.org" "I:blahusername" "P:blahpassword" "M:LOGIN PLAIN"
Now generate the sendmail.cf file using this command:
make -C /etc/mail
Create a file named: /etc/mail/genericstable
with this inside it: root email@example.com
(do not replace firstname.lastname@example.org with your own data)
makemap hash /etc/mail/genericstable < /etc/mail/genericstable
makemap hash /etc/mail/authinfo < /etc/mail/authinfo
and make authinfo readable only by root:
chmod 600 /etc/mail/authinfo
This did it for me. I can send emails using my ISP's outgoing mail server with my FC6 server.
I have not been able, so far, to find instructions on the web how to configure Postfix in the same manner as Sendmail. Alright, I have modified a line in /etc/postfix/main.cf to look like: relayhost = smtp.nicehost.com, but my web form didn't execute anything besides telling me the mail was sent, which wasn't the case.
I'm not amazed that it doesn't work because no authentication method was set up.
Any suggestions how to get it working for Postfix?
PHP mail form in Fedora Core 6: yes
Earlier I wrote:
My ISP is 1&1 in Germany and they have strange habits. For example, I cannot get a PHP mail form script working (...)
I have just tried the form on my FC6 server and the PHP mail form worked fine (the mail was sent and received), so what I've stated earlier about 1&1 is wrong.
The mail form did not work on Debian Etch (The Perfect Setup), which is on the same LAN behind the same router. Neither did it work on my Mac OS X (PPC) Apache server.
I wonder why that is. Could it be that PHP on my FC6 machine has different PHP modules installed which are needed for PHP mail forms?
Does anybody have a clue where to look for clues?
My postfix/sendmail problems seemed to be caused by the fact that I had 2 PCs running next to each other. When I switched the first one off, sendmail started working OK on PC #2, probably because port 25 was now free. I'll check postfix later.
How long should one keep on solving a problem?
OK, so this is what I've got today:
1. Debian Etch installed (Perfect Setup) on my trial server #2
2. Postfix modified according to these guidelines: http://www.howtoforge.com/postfix_re...her_mailserver
3. My mail form cgi script points to: /usr/sbin/sendmail
4. When I send mail through my web page I get an OK but no mail is ever sent (again!)
5. Server #1 is switched off so there is no interference
When server #1 is doing the job everything is going well with sendmail on FC6, so I assume there is nothing wrong with my mail form.
How long should one keep on solving a problem which shouldn't exist?
Thanx for any help anyway.
|All times are GMT +2. The time now is 22:33.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.