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?

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.

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?

Click to expand...

Postfix is compatible to Sendmail, so I don't know why it shouldn't work with Postfix. Postfix even comes with a binary called sendmail to guarantee Sendmail compatibility.

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):

#!/usr/bin/perl

# 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.

This did it for me. I can send emails using my ISP's outgoing mail server with my FC6 server.

POSTFIX

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.

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.

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.

1. Debian Etch installed (Perfect Setup) on my trial server #2
2. Postfix modified according to these guidelines: http://www.howtoforge.com/postfix_relaying_through_another_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.

I cannot tell you (yet) what's in the mail log because I removed Debian and reinstalled Fedora Core 6 to reproduce the sendmail/smarthost configuration once again.

Unfortunately, I failed, because all of the sudden FC6 told me its mirror sources were exhausted or something like that.

So I tried Debian Etch's Perfect Setup again, but unfortunately I never got passed the moment where I have to give the mysql myserver.mydomain.com root password. This problem has been addressed in this forum but the solution in the earlier case was not suitable for me.

I'll get back to this issue later, but I've got to get one thing off my chest: I am a long time Mac user (since 1986) and I am beginning to come to the conclusion that Linux is the solution for people with a lot of patience and time who cannot afford a Mac.

2. Download and check this PHP mail form script: http://www.lekkah.com/mailz.zip
(edit the mailz.php file: put your own mail address above the line written in capitals in order to receive and check the test mail you'll send).

The PHP mail script (also Perl scripts) runs flawlessly on PC1 with FC6. On PC2 I have Debian Etch installed, perfect setup, with ISPConfig. I didn't do anything differently in those two cases, but neither PHP nor CGI form mail work on PC2. I get the success message but no mail is ever received.

For me this is crucial, because I use form mail on my websites. If I cannot get it to work with Debian Etch I'll be stuck with FC6 for the rest of my life.

In case someone runs into the same problem as I did, here is a new development.

On PC1 I've got FC6 running. Formmail works.

On PC2 I tried several distro's. Even when I tried to reproduce PC1's FC6 installation, Formmail might work one time but the next time it might not. At this moment I'm lucky again: formmail works.

What did I change? When I installed Fedora 7, I made sure that the domain name I chose was the same one as the one on PC1. So if PC1 is abc.dummy.com, then PC2 is now xyz.dummy.com.

What's so important about the domain name in a LAN situation if no further connections depend on it? I'm not sure. My ISP is 1und1 and it could be that once their system excepts domain dummy.com they refuse domain dummier.com and any other domain name for the same customer.