I've been trying for 2 whole days now, and I just can't get the most simple thing to work.
The problem: Sending eMails from PHP to my eMail address does not work
I've been working with Windows and Sendmail (Sendmail was within the XAMPP package) before and everything was OK. The XAMPP-package (1.7.7) for Linux doesn't have Sendmail integrated though. So after googling around a little I found out that Postfix fits better into a LAMPP-environment.
What I have tried so far:
I've installed Postfix and wanted to configure it to just use the smtp-server of my private eMail provider (like it did on Windows). So I've confogured my php.ini like this:
[mail function] ; For Win32 only. ;SMTP = localhost ;smtp_port = 25 ; For Win32 only. ;sendmail_from = [email protected] sendmail_path = /etc/postfix mail.add_x_header = On
Note that I've commented out the "Win32 only"-stuff. The /etc/postfix/main.cf Looks like this:
smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/sasl_password myhostname = ubuntu alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases sender_canonical_maps = hash:/etc/postfix/sender_canonical mydestination = ubuntu, localhost.localdomain, localhost relayhost = mail.gmx.net mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = loopback-only
/etc/aliases is unchanged:
# Required aliases postmaster: root MAILER-DAEMON: postmaster # Common aliases abuse: postmaster spam: postmaster
postmaster [email protected]
So when I do
> sudo /etc/init.d/postfix start
everything seems to work fine and the /var/log/mail.log says: "ubuntu postfix/master: daemon started -- version 2.8.5, configuration /etc/postfix"
But when I run my PHP-script (which worked fine with Windows and Sendmail), it just runs through and nothing happens, not even an error is logged.
What I actually want to achieve:
I'm working locally on an e-commerce website. It runs fine on the dedicated webserver, but I want to also have it running locally for obvious reasons. In some cases, it sends emails, and I just want to be able to receive them with Thunderbird or in any other way. Is using Postfix overkill here? I don't need to receive emails - I just want to make the sent mails visible somehow. I could not seem to find any helpful step-by-step-tutorials for this issue (neither concerning Senmail nor Postfix - but, to be honest, I'm very new to Linux).