Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
drupal and ssmtp
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1869
Location: Switzerland (Romandie)

PostPosted: Sat Mar 08, 2014 8:34 pm    Post subject: drupal and ssmtp Reply with quote

I begun to make a website with drupal, and as it took me some time to figure out how to get the mail system to work, here is a working solution with ssmtp.

First, you must have drupal installed and a working website. When done, you can add a forum and begin to add content.
You can also add an user, it will work, but you will get an error message like what it was not possible to send the mail. And without the confirmation mail, the new user cannot login, and cannot create the same account again. He/she is stuck.

When reading drupal documentation, they write a lot about sendmail. Well, this is a high-end and full featured mail server, which is an overkill for most websites, and which is very complicated to setup. I don't know what I missed, but after some unsuccessful tries, I removed it and installed ssmtp which is very easy to setup.

Code:
emerge -s ssmtp


when done, you can add the user apache to the smtp group (I am not sure if this step is really needed, but it doesn't arm):

Code:
gpasswd -a apache ssmtp


It is time to configure ssmtp:

Code:
# file /etc/ssmtp/ssmtp.conf :
root=your_name@email.org        #your email address
mailhub=smtp.email.org             #your outgoing mail server
hostname=smtp.email.org           #idem
AuthUser=your_user_name
AuthPass=Your_password
FromLineOverride=YES                 #will override the From header with the one provided by drupal
# anything else is commented

and
Code:
# file /etc/ssmtp/revaliases :
root:your_name@email.org:mail.email.org      #the same address than above
# and your incoming mail server, I used it and it work, so I keep it
local_account:your_name@email.org:mail.email.org


Now we can test it:
Code:
emerge -a mailx


Code:
mailx some_name@server.com

You can add a subject and press Enter. It's time for the message. When done press Ctrl+D. If you don't want to send a copy to another recipient, just press Enter.

That's all. Your drupal site can now send emails.
_________________
"Confirm You are a robot." - the singularity
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Sat Mar 08, 2014 8:45 pm    Post subject: Reply with quote

uhhhhh, no php mail function? drupals php, and should be able to send mail through php functions. php.ini controls which sendmail implementation is used. this may be something you wish to investigate. https://drupal.org/project/phpmailer
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1869
Location: Switzerland (Romandie)

PostPosted: Sun Mar 09, 2014 8:29 am    Post subject: Reply with quote

Thanks for the link. I will try it later. For now, I discover drupal and I want to see what I can do with a base installation like the one provided by portage. For now, I still have a few other things to investigate like how to make user groups where an user or a group of users can create and manage their own users groups. Later, I will begun to look at extra features like the addition of a wiki.
_________________
"Confirm You are a robot." - the singularity
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum