Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Apr 06, 2010 8:20 pm 
Offline
Senior Newbie

Joined: Tue Mar 30, 2010 11:18 pm
Posts: 10
I can send emails to (some) adresses with this command:

echo 'test' | msmtp xxxxx@gmail.com

it also works with some other addresses, but not with any of the temporary ones I tried out.

Anyway, here are the relevant conf files


Code:
account gmail
host smtp.gmail.com
port 587
protocol smtp
auth on
from xxx@infocalypse-net.info
user xxx@infocalypse-net.info
password xxxxxx
tls on
tls_starttls on
tls_trust_file /usr/share/ca-certificates/mozilla/Thawte_Premium_Server_CA.crt


account default : gmail




Code:
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "/usr/bin/msmtp -t"


So shouldn't wordpress now use that to send emails? I can send to some addresses with the manual command, so shouldn't it work? Well it doesn't. Wordpress doesn't do anything, and all of the various plugins I tried don't work either.

Edit:

I tried changing the flags in my php.ini
"/usr/bin/msmtp -t -i" doesn't work either, nor do any of the other ones I've tried.

According to the msmtp docs, 'sendmail' mode is enabled by default, so it should be compatible. I'm just not sure if I need to do something special to make it work.


Top
   
 Post subject:
PostPosted: Tue Apr 06, 2010 11:18 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Why don't you install postfix and let your server send emails itself?


Top
   
 Post subject:
PostPosted: Tue Apr 06, 2010 11:42 pm 
Offline
Senior Newbie

Joined: Tue Mar 30, 2010 11:18 pm
Posts: 10
Because I don't want a mail server running on it. I've already changed the mx records to google's. It's a security issue having a mail server running, and it uses up memory. Besides, I can send email fine with this already. It's the mail() function that doesn't work.


Top
   
 Post subject:
PostPosted: Wed Apr 07, 2010 1:32 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
It's not that much of a security issue having a mail server installed, don't have an open really, hell don't open port 25 to incoming connections if you're that worried (although you won't get bounce messages). As for memory my postfix is using around 1.5MB of memory on a 32 bit ubuntu distribution. Nothing to worry about.

If you really want to use smtp on an external server for PHP you should consider using http://pear.php.net/package/Mail if you still want to use the inbuilt mail() try enabling php error logging and see if it's dumping an error message. You could also check /var/log/syslog I don't know if msmtp logs it's messages there but it'll be somewhere in /var/log


Top
   
 Post subject:
PostPosted: Mon Apr 19, 2010 1:07 am 
Offline
Senior Newbie

Joined: Tue Mar 30, 2010 11:18 pm
Posts: 10
For anyone who reads this; I solved the problem. What was happening is this:

msmtp is configured to only allow read/write permissions for the user who owns the conf file, ~/.msmtprc

If you want apache to be able to access the conf file, you need to copy ~/.msmtprc over to /etc and give the user running apache read access. Making sure to rm the file in ~/ once you've done that.

Couldn't be any simpler, yet nowhere I looked told me this.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group