Tips on SMTP email

edited December 2010 in General
Info for sending e-mail via SMTP is a bit sparse so I thought I'd post a tip here in case anyone else wants to do this. My email server is accessible via authenticated user, and it's not on the localhost of the web server. I host HTTP with DreamHost but I do not use their email server. The problem I was trying to solve was that emails generated with sendmail, or from unauthenticated users, would be delivered with the From like " on behalf of MySiteName [noreply@domain.tld]". That's completely unacceptable. So here is how I changed that in config.php:

$config['mail']['backend'] = 'smtp';
$config['mail']['params'] = array(
'host' => '',
'port' => 2525,
'auth' => true,
'username' => '',
'password' => 'thepassword'
$config['mail']['appname'] = 'mySNappname';
$config['mail']['check_domain'] = true;
$config['mail']['notifyfrom'] = '"MySite Status" <>';
$config['mail']['domain'] = '';

Now emails look very professional, not spammy or system-generated.

I was also pleased to find that emails from the site have unique headers:
X-StatusNet-MessageType: mention
X-StatusNet-TargetUser: myname
X-StatusNet-SourceUser: originatorname

There is also a MessageType "subscribe".


EDIT: Revised notifyfrom, UI here removed the email address as though it was an invalid tag.


  • @CaptainStarbuck Cool stuff - thanks for that!
  • como y en donde debo insertar esas lineas de codigo en config.php .agradezco a usted me ayudar con informaci├│n precisa.ocurre que mi aplicacion con statusnet no envia notificaciones de actividad.especificamente no envia respuestas de mensajes.
  • It doesn't really matter but I added the $config[] settings at the bottom of existing settings, and right before unset() lines. Does that help?
  • yo instale statusnet. pero no envia notificaciones a los correos de los usuarios o el administrador,cuando hay alguna actividad.por ejemplo una respuesta.como puedo resolver esto? gracias.
  • It is possible that your web server does not have direct access to your email server. If you copied my text, note that my server requires access via port 2525. Maybe your server is different. I suggest you try setting up any other PC or server using any other software. If you can successfully send email from there, then you have the settings right, and Status.Net should send your email correctly too. Good luck.
  • las notificaciones de invitacion si llegan a los correos electronicos,pero las notificaciones de actividad no,como por ejemplo las respuestas de los mensajes ,la verdad es extra├▒o.
  • I understand what you're saying but I don't know enough about StatusNet to diagnose the issue. For anyone else monitoring, I'm understanding that invitation emails are getting to the recipients, but emails to notify members of activity are not. Is there a different setting for emails being sent for these two purposes? I would think that in this case notifications are probably just turned off. That is the setting that needs to be checked.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!