I am currently using a Mac Mini Server running OS X Server. The server hosts several Ruby on Rails applications using Phusion Passenger where two of them uses a PostgreSQL database. One of these applications has a mailing list database that uses ActionMailer to send emails. As of the writing of this post the application will send 224 emails when we send a newsletter out.
We were using a GoDaddy email address in the SMTP configuration. The emails took only five minutes to send. However GoDaddy only allows 250 emails to be sent per day. They also only allow you to purchase relays 50 at a time with a three month minimum. We were not sure how well that would work for us with the growth of our mailing list. At the rate we are growing we could add 50 people to the mailing list sooner than three months we would have already paid for. I felt that we should visit turning on the Mail Server on our Mac Mini Server.
After getting some questions answered from Apple I was able to get the Mail Server working where I can send and receive emails. However when I send those same emails it takes 30 minutes instead of five. The documentation for OS X Server still has old information from Lion Server referencing Server Admin Tools which no longer apply for OS X Server.
I was hoping that the time to send emails might be the same since the database for the Rails application and the mail server were on the same machine. However in general I understand in some cases there could be some contention with using the same resources. Is there is any way that I can speed up the sending of the emails? Unfortunately Server Admin Tools has not been provided for OS X Server. The documentation for OS X Server is for the most part worthless since they reference Server Admin Tools which no longer exists.
Any help would be appreciated.
UPDATE 3/15/2013 10:15 am CST
Note: I am new to working with Mail Servers. Correction about the time. When I checked /var/log/mail.log I saw that the total processing time was about 41 minutes, not 30. When I checked production.log in my Rails application I watched as each email was being sent successfully. The mail log confirmed that they were being sent one at a time.
Here are the log entries for one of the emails with masked data. I also included the last log statement when the previous email was successfully sent.
Mar 14 11:06:50 hostname.domain1.com postfix/qmgr[45322]: 4B2C5603D25: removed
Mar 14 11:06:59 hostname.domain1.com postfix/smtpd[99464]: sacl_check: mbr_user_name_to_uuid(emailuser@emaildomain.com) failed: No such file or directory
Mar 14 11:06:59 hostname.domain1.com postfix/smtpd[99464]: sacl_check: mbr_user_name_to_uuid(@emaildomain.com) failed: No such file or directory
Mar 14 11:06:59 hostname.domain1.com postfix/smtpd[99464]: 28899603D28: client=hostname.domain1.com[208.52.189.83], sasl_method=PLAIN, sasl_username=iosusername
Mar 14 11:06:59 hostname.domain1.com postfix/cleanup[99468]: 28899603D28: message-id=<5141f599b105_17b1c3fc6cdc290d811372e@hostname.domain1.com.mail>
Mar 14 11:06:59 hostname.domain1.com postfix/qmgr[45322]: 28899603D28: from=<emailsender@senddomain.com>, size=6545, nrcpt=1 (queue active)
Mar 14 11:06:59 hostname.domain1.com postfix/smtpd[99464]: disconnect from hostname.domain1.com[208.52.189.83]
Mar 14 11:06:59 hostname.domain1.com postfix/smtpd[97748]: connect from localhost[127.0.0.1]
Mar 14 11:06:59 hostname.domain1.com postfix/smtpd[97748]: 6F4DD603D2F: client=localhost[127.0.0.1]
Mar 14 11:06:59 hostname.domain1.com postfix/cleanup[99478]: sacl_check: mbr_user_name_to_uuid(emailuser@emaildomain.com) failed: No such file or directory
Mar 14 11:06:59 hostname.domain1.com postfix/cleanup[99478]: sacl_check: mbr_user_name_to_uuid(@emaildomain.com) failed: No such file or directory
Mar 14 11:06:59 hostname.domain1.com postfix/cleanup[99478]: 6F4DD603D2F: message-id=<5141f599b105_17b1c3fc6cdc290d811372e@hostname.domain1.com.mail>
Mar 14 11:06:59 hostname.domain1.com postfix/smtpd[97748]: disconnect from localhost[127.0.0.1]
Mar 14 11:06:59 hostname.domain1.com postfix/qmgr[45322]: 6F4DD603D2F: from=<emailsender@senddomain.com>, size=7038, nrcpt=1 (queue active)
Mar 14 11:06:59 hostname.domain1.com postfix/smtp[99473]: 28899603D28: to=<emailuser@emaildomain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.3, delays=0.01/0/0/0.29, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 6F4DD603D2F)
Mar 14 11:06:59 hostname.domain1.com postfix/qmgr[45322]: 28899603D28: removed
Mar 14 11:07:00 hostname.domain1.com postfix/smtp[97741]: 6F4DD603D2F: to=<emailuser@emaildomain.com>, relay=mx-eu.mail.am0.yahoodns.net[77.238.177.9]:25, delay=1.1, delays=0/0/0.34/0.79, dsn=2.0.0, status=sent (250 ok dirdel)
Mar 14 11:07:00 hostname.domain1.com postfix/qmgr[45322]: 6F4DD603D2F: removed
UPDATE 3/15/2013 4:11 PM CST
I continue to check things. I decided to send 5 emails using the same software I had problems with the time. They are still sending slower than with the GoDaddy email account. I decided to take a look at sacl_check message where it did not find the file or directory. This message appears for each email that I checked. I read this link below that discussed this. One of the comments mentioned that some settings needed to be made in file /etc/postfix/main.cf. I have my email setup for local networks only. The other option was to forward somewhere. I was advised by Apple Enterprise Support to set it up like this since it will only be used by ActionMailer in my Rails applications to send emails. No emails will be received by the email address I created. I have not modified /etc/postfix/main.cf. I'm not sure which modifications I need to make. There will never be local users as such to verify.
https://discussions.apple.com/thread/3241121?start=0&tstart=0