Re: [grinnellplans] r617 committed - Support sending mail using a different "from" and "reply-to" address, ...

11 views
Skip to first unread message

Ian Wolfcat Atha

unread,
Sep 15, 2012, 2:26:05 PM9/15/12
to grinnellplan...@googlegroups.com, Alex Cohn
Unless it's an emergency fix, you should file an Issue so we have a
full-discussion/rationale for all commits.

On Sat, Sep 15, 2012 at 11:24 AM, <grinne...@googlecode.com> wrote:
> Revision: 617
> Author: al...@alexcohn.com
> Date: Sat Sep 15 11:24:10 2012
> Log: Support sending mail using a different "from" and "reply-to"
> address, to eliminate GMail's warnings about "this message was sent by
> amazonses.com"
> Mail will be sent from a noreply address at grinnellplans.com, with the
> reply-to set to the admin email address, and signed by AWS SES.
>
> http://code.google.com/p/grinnellplans/source/detail?r=617
>
> Modified:
> /trunk/functions-email.php
> /trunk/kommand/email.php
> /trunk/passwordreset.php
> /trunk/register.php
>
> =======================================
> --- /trunk/functions-email.php Thu Jul 26 21:50:47 2012
> +++ /trunk/functions-email.php Sat Sep 15 11:24:10 2012
> @@ -6,7 +6,7 @@
>
> CFCredentials::set(array('default'=>array('key'=>AWS_KEY,'secret'=>AWS_SECRET_KEY)));
> }
>
> -function send_mail($to, $subject, $text, $from = MAILER_ADDRESS, $reply_to
> = MAILER_ADDRESS) {
> +function send_mail($to, $subject, $text, $from = MAILER_ADDRESS, $reply_to
> = ADMIN_ADDRESS) {
> if(USE_NATIVE_MAIL) {
> if (is_array($to)) $to = implode(', ',$to);
> return mail($to, $subject, $text,
> "From:$from\nReply-to:$reply_to");
> =======================================
> --- /trunk/kommand/email.php Tue Nov 1 21:08:09 2011
> +++ /trunk/kommand/email.php Sat Sep 15 11:24:10 2012
> @@ -6,7 +6,6 @@
> ?>
>
> <?php
> -$admin_email = MAILER_ADDRESS;
> if (!isset($_POST['whatoperation'])) die("Error: No operation specified.");
> $whatoperation = $_POST['whatoperation'];
> $email = $_POST['email'];
> @@ -14,7 +13,7 @@
>
> if ($whatoperation == "create") {
> $message = "An account for username " . $username . " with password " .
> $password . " has been set up for you.\n You can go to
> http://www.GrinnellPlans.com to log in.\nOnce you log in, you can change
> your password.";
> - if (send_mail($email, "Your new plan.", $message, $admin_email,
> $admin_email)) {
> + if (send_mail($email, "Your new plan.", $message)) {
> echo "Message sent";
> }
> else {
> =======================================
> --- /trunk/passwordreset.php Fri Jan 27 23:20:23 2012
> +++ /trunk/passwordreset.php Sat Sep 15 11:24:10 2012
> @@ -116,6 +116,6 @@
> $emailbody.= "If you are still having trouble accessing your
> GrinnellPlans account, reply to this email, and tell us what's going on.\n";
> $emailbody.= "If you did not request a password reset, you may safely
> ignore this email. Your password will not be changed.\n\n";
> $emailbody.= "Thanks for your continued interest in Plans!\nThe Plans
> Admins";
> - return send_mail($email,"GrinnellPlans password
> reset",$emailbody,MAILER_ADDRESS,MAILER_ADDRESS);
> + return send_mail($email,"GrinnellPlans password reset",$emailbody);
> }
> ?>
> =======================================
> --- /trunk/register.php Tue Nov 1 16:16:14 2011
> +++ /trunk/register.php Sat Sep 15 11:24:10 2012
> @@ -8,7 +8,7 @@
> $idcookie = User::id();
> $userid = $idcookie;
> $dbh = db_connect();
> -$admin_email = MAILER_ADDRESS;
> +$admin_email = ADMIN_ADDRESS;
> $domain = "grinnell.edu";
> $thispage = new PlansPage('Utilities', 'register', PLANSVNAME . ' -
> Registration', 'register.php');
> if (User::logged_in()) {
>
> --
> You received this message because you are subscribed to the Google Groups
> "grinnellplans-dev-notify" group.
> To post to this group, send email to
> grinnellplan...@googlegroups.com.
> To unsubscribe from this group, send email to
> grinnellplans-dev-...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/grinnellplans-dev-notify?hl=en.
>

Alex Cohn

unread,
Sep 15, 2012, 2:38:35 PM9/15/12
to Ian Wolfcat Atha, grinnellplan...@googlegroups.com
I agree, in general. This code has been live on prod for several months now (debugging SES is hard without the production account's AWS credentials, and I'm not willing to leave those on non-plans-dedicated instances; I meant to check this patch in sooner), and I'm preparing to rebuild the web instance, so I wanted to make sure trunk matched prod.

I am (of course) open to debating the merits of what email address plans should send from (currently, it's nor...@grinnellplans.com, with grinne...@gmail.com as the reply-to address), and whether or not DKIM signing our outgoing messages is a good idea.

Alex

Ian Wolfcat Atha

unread,
Sep 15, 2012, 2:50:31 PM9/15/12
to grinnellplan...@googlegroups.com
I guess that's no longer within my purview, but in the past we've had
a strict rule about never having code on prod that's not in SVN.
> "GrinnellPlans Development" group.
> To post to this group, send email to
> grinnellplan...@googlegroups.com.
> To unsubscribe from this group, send email to
> grinnellplans-deve...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/grinnellplans-development?hl=en.
Reply all
Reply to author
Forward
0 new messages