phpBB + authenticated SMTP problem

28 11 2008

It took us almost a week to figure out the problem between phpBB and the authenticated SMTP server (mail.authsmtp.com); but we did it! Now, two days after that, I almost forgot how we solved it. So, I want to write about it so that I don’t forget.

First, I tried to get phpBB configured to work directly with the SMTP server. I wasn’t successful with that, so I decided to go with the default way phpBB sends emails. The default way uses sendmail to send emails. We configured sendmail to relay on postfix and then to relay on mail.authsmtp.com; that got us really close.

Up to that point, phpBB was sending the email requests through sendmail to postfix and finally to mail.authsmtp.com; but the ‘from address’ was getting rejected. I was 100% sure that the ‘from address’ was getting set correctly; but it was still trying to send the emails as “apache@123.123.123.123″ (or something like that)

What we had to do is change the /etc/php.ini file to have this line:

sendmail_path = /usr/sbin/sendmail -t -i -fetagwerker@aycron.com

After that, I restarted Apache, tried again and it worked! (lets say that etagwerker@aycron.com was an authorized ‘from address’ for mail.authsmtp.com, but it was something different)

Even after figuring this out, I kept seeing errors in the mail.authsmtp.com control console. That was because the postfix deferred queue were full with wrongly constructed email requests. After clearing that (see previous post); the problem was solved!



working with Amazon Web Services

27 11 2008

I think the key to working with an AWS box is to get the image right. Today it took me a few minutes to realize that I had picked the wrong image for me. I wanted my image to have “yum” ready to go. I love the idea of typing “yum install java” and having Fedora install Java for everybody.

I love simplicity and tools that save us time. An AWS box makes some things really simple: you don’t need physical space (no server room needed), you can manage it remotely from the start, you can bring up images within minutes, you can switch images within minutes (Fedora 4, to Fedora 8, to Ubuntu, to whatever you want), you can choose between Windows and Linux.

There are many advantages, but the one that does it for me is that it saves time. It took me one hour to get signed up, install the tools and start my first instance. These days, that is priceless.

I can install Apache: yum install httpd

And I already have a web server running: apachectl start

That’s it! We now have a new development environment.

Sure, in the long run; it’s probably less expensive to have your own boxes in your own physical location (or is it?)



dealing with SMTP client queues

25 11 2008

I have been dealing with a PHP + SMTP problem during the last few days. I got to the point where I needed to delete old (malformed) messages from the queues I had in my Linux box. Basically, the implementation of the message notifications worked this way: PHP BB -> PHP -> sendmail -> postfix -> mail.authsmtp.com

So, first I had to check the sendmail queue and then the postfix queue. Then, delete the malformed messages. So here is how I did it.

To check the sendmail queues, use the sendmail command:

[etagwerker@host ~]$ sudo /usr/sbin/sendmail -bp
/var/spool/mqueue is empty
Total requests: 0

To check the postfix queues, use the postqueue command:

[etagwerker@host etagwerker]# /usr/sbin/postqueue -p
-Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——-
F41C2958D7     1218 Tue Nov 25 10:30:53  donotreply@aycron.com
(host mail.authsmtp.com[62.13.128.189] said: 502 5.0.0 One (or more) of the message ‘From’ addresses is not registered – login at: http://control.authsmtp.com (in reply to end of DATA command))
ernesto.tagwerker@aycron.com

16E00958CF     1679 Mon Nov 24 19:06:25  apache@ip-10-251-43-207.ec2.internal
(host mail.authsmtp.com[62.13.128.189] said: 502 5.0.0 One (or more) of the message ‘From’ addresses is not registered – login at: http://control.authsmtp.com (in reply to end of DATA command))
etagwerker@aycron.com

To clear the postfix deferred queue, use the postsuper command:

[root@ip-10-251-43-207 etagwerker]# /usr/sbin/postsuper -d ALL deferred
postsuper: Deleted: 37 messages

“deferred” in the last example identifies the queue name.

[root@ip-10-251-43-207 etagwerker]# /usr/sbin/postqueue -p
Mail queue is empty

This post came from many google searches, a bunch of man pages (postqueue, sendmail and postsuper) and this thread: http://lists.freebsd.org/pipermail/freebsd-questions/2003-July/013112.html