Hope I hit the right subforum.
I'm setting up a website with a contact form. I want the form to use the mail() function in PHP to send it to the SMTP server running on the same machine. Here's how far I've come:
- Debian Sarge is installed, updated and running
- SSH server and Webmin (latest, version 1.320) for remote administration are both running well
- Dovecot IMAP server (no need for POP) seems to be working as it should
- Roundcube webmail runs as it should
- PHPMyAdmin runs as it should
I don't need mail sending to the outside world, I'm not going to use this as a "real" mail server. I only want the form data submitted presented as mails, as that is the easiest way of sorting and handling it (it's a failure report system for use at work) if you see what I mean.
I've tried Exim4, but can't get it to work. Since I want as much as possible to be administrated through Webmin, I installed an exim-module for Webmin, but it doesn't install.
Setting up webmin-exim (0.2.6-3) ...
Error: The new file /usr/share/webmin-exim/exim4.config does not exist!
dpkg: error processing webmin-exim (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
How do I get rid of it, and make APT stop complaining?
Now, Exim4 was just a tip from another forum, I don't need to use that if better software exists. I need the mail() function in PHP to work, and that requires (as I understand) a SMTP server on the same machine.
For the mail functions to be available on a Linux or similar machine, PHP must have access to the Sendmail binary during compile time.
Now, what does this mean? That a Sendmail binary must be available when the PHP processor is compiled, or when the script is compiled (I thought scripts where interpreted, correct me if I'm wrong)? Debian installs PHP in binary form, so I never compile it.
Long post short, I need a step-by-step guide for setting up a server where I can use the mail() function in PHP.
Problem solved, my system is now fully working. The mail() function and everything might have worked all along. I first solved the APT problem by editing /var/lib/dpkg/available (found that file by looking into some of the APT output I got with various APT commands) and removing the reference to the webmin-exim package, then deleting all webmin-exim* files in /var/lib/dpkg/info.
Then I could install Postfix, and it worked out of the box, it seemed. In Webmin I looked in User Mailboxes in the Postfix module, and my mails from the form was there. I realised that User Mailboxes viewed mails from /var/spool/mail, and by pointing Dovecot to /var/mail instead of Detect automatically, it was all working. So simple it's embarrasing, even for a newbie (well, for me at least).