diff options
Diffstat (limited to 'tutors/email/index.php')
-rw-r--r-- | tutors/email/index.php | 187 |
1 files changed, 144 insertions, 43 deletions
diff --git a/tutors/email/index.php b/tutors/email/index.php index 08139e1..1a100b3 100644 --- a/tutors/email/index.php +++ b/tutors/email/index.php @@ -1,64 +1,165 @@ <?php include('../../header.php'); ?> + <section class="banner"> - <h1>Email Setup</h1> + <h1>Email setup</h1> </section> <section class="quiet flexible"> <div> <p> - This guide is for Gmail users only. While most of this guide will also be applicable to other mail providers, additional steps may be required. + Every tutor is expected to use a <em>@carpentertutoring.com</em> email address to facilitate client communication. This guide will walk you through setting up your email from scratch and configuring your mail client to use it. </p> - <h2>Receiving Mail</h2> - <p> - Once your <a href="/">carpentertutoring.com</a> email address is created, you will receive a verification email. In order to receive mail in your personal address from this alias, you will have to click the confirmation link in the verification email. Once complete, you can start receiving mail immediately. + You have two options for using your new email address. The first is <em>standalone</em> which allows you to use the mail client of your choice to send and receive mail. Some popular desktop clients are Apple's Mail app, Mozilla Thunderbird, and Microsoft Outlook. Popular mobile mail clients include the iOS Mail app and K-9 Mail for Android. Your mailbox will remain on the Carpenter Tutoring mail server and in no way interact with any personal or private mail accounts you have on other systems. </p> - <h2>Sending Mail</h2> - - <p> - Sending mail from your <a href="/">carpentertutoring.com</a> address requires a small amount of setup. - </p> - - <h3>App Password</h3> - <p> - Google 2-Step Verification requires you to first generate an App Password for your personal Gmail account. Note that <em>you must have 2-Step Verification turned on for your account in order to forward sent mail to your Carpenter Tutoring alias</em>. You can verify whether you have 2-Step Verification turned on for your Google account by <a href="https://myaccount.google.com/signinoptions/two-step-verification">visiting this link to your Google account settings</a>. If 2-Step Verification is turned off, turn it on and proceed with the following steps. + Your second choice is <em>forwarding</em>, where all of your Carpenter Tutoring mail will forward to a personal email address of your choice. Your personal email provider will need to be configured to send mail as your Carpenter Tutoring address for any client communication. The amount of setup is the same, but this method allows you to use a client such as <em>GMail</em> for managing mail. </p> <p> - <ol> - <li>On your computer, open <a href="https://myaccount.google.com/apppasswords" target="_blank">App Passwords</a>.</li> - <li>In the bottom of the window, click <em>Select app</em> and choose <em>Mail</em> from the list.</li> - <li>Click <em>Select device</em> and choose <em>Other...</em> and enter "Carpenter Tutoring" in the box.</li> - <li>Click <em>Generate</em>. You will see 16 letters and numbers in a yellow box. Copy this or write it down for the next step.</li> - <li>Click <em>Done</em>. Keep in mind you will not be able to see the App Password anymore. If you forget it before the next step, you will have to create a new one.</li> - </ol> + Remember you can change your decision anytime. See "Getting help" below. </p> - <p> - - <h3>Mail forwarding</h3> - - <ol> - <li>On your computer, open <a href="https://mail.google.com" target="_blank">Gmail</a>.</li> - <li>In the top right, click settings (⚙️) and then <em>See all settings</em>.</li> - <li>Click the <em>Accounts and import</em> or <em>Accounts</em> tab.</li> - <li>In the "Send mail as" section, click <em>Add another email address</em>.</li> - <li>Enter your name and the address you want to send from. This will be your <a href="/">carpentertutoring.com</a> address. Leave the "Treat as an alias" box checked.</li> - <li>Click <em>Next Step</em>.</li> - <li>For the "SMTP server" enter <em>smtp.gmail.com</em>. Select <em>465</em> for the port.</li> - <li>For the username and password you will enter your personal Gmail address (with "@gmail.com" suffix) and the App Password you generated in the previous step.</li> - <li>Check "Secured connection using SSL (recommended)" and click <em>Add Account</em>.</li> - <li>Return to the "Send mail as" section on the settings page and look for "When replying to a message." Check "Reply from the same address the message was sent to." This will ensure you respond to tutoring inquiries with your Carpenter Tutoring address and personal mail with your Gmail address.</li> - </ol> - - </p> - - <p>Now you should be able to immediately send mail as your Carpenter Tutoring alias. To test this, compose a new message an check the "From" box. You should see a menu there where you can choose which address to send mail from.</p> - - <p>Thank you for being a part of Carpenter Tutoring!</p> + <?php + if (empty($_POST['password'])) { + ?> + <h2>Create a mail account</h2> + <form method="post" action="/tutors/email/index.php#submit"> + <label for="name">Your full name + <input type="text" name="name" placeholder="Amy Carpenter" required /> + </label> + + <label for="password">Your new Carpenter Tutoring email password + <input type="password" name="password" minlength="8" placeholder="8 character minimum" required /> + </label> + + <label for="forward">Personal email address for forwarding + <input type="email" name="forward" placeholder="leave blank to use a standalone mail client" /> + </label> + + <button type="submit" class="button" alt="submit">Set me up</button> + </form> + <? + } + ?> + + <?php + if (!empty($_POST['password']) && !empty($_POST['name'])) { + // encrypt email and add to logins queue + $descriptorspec = array( + 0 => array('pipe', 'r'), + 1 => array('file', '/var/ct_logins', 'a'), + 2 => array('file', '/var/log/ct_mail_submit.log', 'a') + ); + $process = proc_open('smtpctl encrypt', $descriptorspec, $pipes); + fwrite($pipes[0], $_POST['password']); + fclose($pipes[0]); + + // include name and generated email in logins queue + $logins_queue = fopen('/var/ct_logins', 'a'); + fprintf($logins_queue, '\n%s\n', $_POST['name']); + + $names = explode(' ', strtolower($_POST['name'])); + + $last = $names[1][0]; + $first = $names[0]; + $email = "$first$last@carpentertutoring.com"; + fprintf($logins_queue, '%s\n\n', $email); + + // close queue + fclose($logins_queue); + ?> + <h2 id="submit">Configuring your mail client</h2> + + Thank you! Now we're setting up your mailbox. Once it's ready you may begin configuring your mail client based on the method you chose above. If you're unable to complete the below steps due to authentication issues, please wait 24 hours and try again. If you have questions or difficulty, see "Getting help" below. + + <?php + if (empty($_POST['forward'])) { + ?> + <h3>Standalone mail</h3> + + <p> + Instructions for configuring a mail client vary somewhat based on the application. Regardless of the client you choose, the "Connection details" below will be the same. Save them for future use, or in case your <em>@carpentertutoring.com</em> address isn't ready yet. + </p> + + <p> + <ul> + <li><a href="https://support.apple.com/en-us/HT201320">iOS Mail app</a></li> + <li><a href="https://support.microsoft.com/en-us/office/set-up-email-in-the-mail-app-7ff79e8b-439b-4b47-8ff9-3f9a33166c60">Mail app for Windows 10 or Windows 11</a></li> + <li><a href="https://support.mozilla.org/en-US/kb/manual-account-configuration">Mozilla Thunderbird</a></li> + </ul> + </p> + + <h3>Connection details</h2> + <p> + Note that if you already have an email address which we've communicated to you, use that instead of the one provided below as your username. + </p> + + <pre> +SMTP server: mail.53hor.net +Connection security: STARTTLS +Authentication method: normal password +SMTP port: 587 +SMTP password: (use the password you just submitted) +SMTP username: <?php printf('%s', $email) ?> + + +IMAP server: mail.53hor.net +Connection security: STARTTLS +Authentication method: normal password +IMAP port: 143 +IMAP password: (use the password you just submitted) +IMAP username: <?php printf('%s', $email) ?> +</pre> + <?php + } else { + ?> + <h3>Gmail forwarding</h3> + + <p> + Once your <em>@carpentertutoring.com</em> email address is created, you will begin receiving forwarded email in your Gmail inbox. Sending mail from your <em>@carpentertutoring.com</em> address via Gmail requires a small amount of setup. + </p> + + <p> + + <ol> + <li>On your computer, open <a href="https://mail.google.com" target="_blank">Gmail</a>.</li> + <li>In the top right, click settings (⚙️) and then <em>See all settings</em>.</li> + <li>Click the <em>Accounts and import</em> or <em>Accounts</em> tab.</li> + <li>In the "Send mail as" section, click <em>Add another email address</em>.</li> + <li>Enter your name and the address you want to send from. This will be your <em>@carpentertutoring.com</em> address. Leave the "Treat as an alias" box checked.</li> + <li>Click <em>Next Step</em>.</li> + <li>For the "SMTP server" enter <em>mail.53hor.net</em>. Select <em>587</em> for the port.</li> + <li>For the username and password you will enter your new Carpenter Tutoring address (with "@carpentertutoring.com" suffix) and the password you submitted in the previous step.</li> + <li>Check "Secured connection using TLS (recommended)" and click <em>Add Account</em>.</li> + <li>Gmail will prompt you to verify your new address. You should receive a confirmation code in your inbox, forwarded from your <em>@carpentertutoring.com</em> address. Use it to complete the alias setup.</li> + <li>Return to the "Send mail as" section on the settings page and look for "When replying to a message." Check "Reply from the same address the message was sent to." This will ensure you respond to tutoring inquiries with your Carpenter Tutoring address and personal mail with your Gmail address.</li> + + </ol> + </p> + + <h3>Other webmail clients</h3> + + <p> + Setup instructions for other popular webmail clients are largely the same. The configuration options for IMAP and SMTP should be identical. Below is a list of setup instructions for common providers. + </p> + <p> + <ul> + <li><a href="https://support.microsoft.com/en-gb/office/add-or-remove-an-email-alias-in-outlook-com-459b1989-356d-40fa-a689-8f285b13f1f2">Outlook.com (MS Hotmail)</a></li> + <li><a href="https://support.apple.com/guide/icloud/add-and-manage-email-aliases-mm6b1a490a/icloud">iCloud.com (Apple iCloud)</a></li> + + </ul> + </p> + <?php + } + } + ?> + <h2>Getting help</h2> + <p> + If you encounter difficulty or have questions throughout any part of this process, please reach out to <a href="webmaster@carpentertutoring.com">webmaster@carpentertutoring.com</a> and we'll get in touch to help. + </p> </div> </section> |