Linux install, no MTA on machine problem

arfon1 - December 13, 2005 - 20:35

I've got Drupal installed and it seems to be working... right up until a new user signs up. The machine never sends out the confirmation e-mail because I do not have an MTA on the machine and I cannot find a place to add smtp server settings.

I have searched the forums here but, all the answers seem to be oriented towards the windows install (e.g. referencing php.ini).

Anyone have an answer or a link to one for a linux guy?

Linux with no MTA?

styro - December 13, 2005 - 21:18

How did you manage that? ;)

When you say you have no MTA, do you mean nothing listening on port 25, or that you have stripped out the sendmail wrapper command (not the daemon) altogether?

--
Anton

No MTA = nothing

arfon1 - December 13, 2005 - 22:29

This is a fairly public server and has been attacked several times. It's JUST a http web server and I want to limit the routes cracker have to gain access on it.

Therefore, there are no mail agents, clients, daemons, MTAs or anything of the sort loaded on it.

No sendmail, procmail, qmail, POP, SMTP, IMAP etcetera on this machine.

It's even IPTABLE firewall'd on all ports except for 80.

I assumed that Drupal would connect to my ISP's smtp server for out going mail but, I can not figure out how to get it to do it.

How did you manage that? ;)

EASY! during the install when Slackware asked:

    Install package: Sendmail (Y N)
I just hit "N" and I did it for all other mail programs :)

Aha a Slackware user

styro - December 13, 2005 - 22:47

Now it makes sense ;)

The problem is a PHP one (typical). As faras I can tell by looking it up on the PHP site, it seems that PHP on Windows only uses SMTP while PHP on Unix only uses sendmail (the command). I can't see any logical reason why PHP by design couldn't use SMTP on Unix.

Keep in mind though that sendmail running locally (ie not a daemon) generally isn't a security problem - after all OpenBSD does that by default, it just processes the mail queue in batches every x number of minutes.

What you could do if you don't trust sendmail is install Postfix (my personal fave) which comes with its own sendmail compatible sendmail command. Then just not install or run any of the daemon parts of the MTA. Maybe even install Postfix on another machine, and just copy the sendmail wrapper command line app across - that might work.

--
Anton

BLECH! Still no MTA!

arfon1 - December 14, 2005 - 01:35

I installed the postfix package and tried to get an e-mail out with no success.

Then, I installed sendmail and tried to get an e-mail out with no success!

Can anyone tell me which Drupal file handles the the mail so I could maybe scratch together a perl script solution?

It's not a Drupal file

styro - December 14, 2005 - 02:12

It's the sendmail settings in php.ini. You can check these with phpinfo().

Both MTAs you installed should come with a command called sendmail. You have to make sure the path to that command matches what PHP thinks the path to that command is.

http://www.php.net/manual/en/ref.mail.php

--
Anton

Getting there!

arfon1 - December 14, 2005 - 21:33

Okay, I re-installed postfix...

I then ran mailq to check the mail queue and there were all the drupal mails waiting to be sent out.

Postfix isn't always running so I waited to see if the install had made a cron job, it had not.

I tried starting Postfix and I saw it runing ok with ps aux:

    ...0:00 sendmail: accepting connections

    ...0:00 sendmail: Queue runner@00:25:00 for var/spool/clientmqueue

It STILL didn't clear the outgoing queue so I tried to force it with: "sendmail -q" and got this error:

    postqueue: warning: unable to look up public/qmgr: No such file or directory

    postqueue: fatal: Cannot flush mail queue - mail system is down

Any idea what that error means?

Any ideas on how to get postfix to ignore the queue and send mail immediately?

I suspect postfix is misconfigured

styro - December 14, 2005 - 21:59

There may be some residual sendmail stuff around maybe?

I'd recommend asking the postfix guys for help - my knowledge of the internals is a bit scant. It always 'just worked' for me.

--
Anton

Yeah

arfon1 - December 14, 2005 - 23:42

"It always 'just worked' for me."

Oh, Great! Just rub it in! :)

Yeah, it's a postfix problem... I'm going to follow that path.

If any DRUPAL DEVs read this: Quit using PHP's mail function! Write a little MTA script to allow users to enter an upstream smtp server!

Would this work?

styro - December 15, 2005 - 01:13

http://www.edoceo.com/creo/perl-sendmail.php

You probably wouldn't need postfix any more :)

I doubt any Drupal dev would want to write and maintain something like this - it's not a part of Drupal, and very very few people would ever need it.

--
Anton

 
 

Drupal is a registered trademark of Dries Buytaert.