> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autotee.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Email Verification (2FA)

> Set up email verification for courses that require two-factor authentication

Some golf courses require **email verification** (also called two-factor authentication or 2FA) when you log in. This means after entering your username and password, the course sends a 6-digit **booking code** to your email that you must enter to complete the login.

AutoTee can handle this automatically by reading the booking code from your email inbox using a protocol called **IMAP**.

<Info>
  Currently, Bethpage State Park is the primary course that requires email verification. More courses may be added in the future.
</Info>

## What is IMAP?

**IMAP** (Internet Message Access Protocol) is a standard way for applications to read emails from your inbox. When you check your email in an app like Apple Mail or Outlook, it uses IMAP behind the scenes.

AutoTee uses IMAP to:

1. Watch your inbox for the booking code email from ForeUp
2. Read the 6-digit code from the email
3. Automatically submit the code to complete your login

Your email credentials are **encrypted** with the same security used for your course account passwords.

## What You'll Need

To set up email verification, you need two things:

| Field            | What It Is                                                     | Example               |
| ---------------- | -------------------------------------------------------------- | --------------------- |
| **Email**        | The email address linked to your course account                | `you@gmail.com`       |
| **App Password** | A special password for IMAP access (not your regular password) | `abcd efgh ijkl mnop` |

<Warning>
  You **cannot** use your regular email password for IMAP. Most email providers require you to generate a separate **App Password**. This is a security feature — the App Password only grants access to read email and can be revoked at any time.
</Warning>

## Setting Up Gmail (Most Common)

Most users will use a Gmail account. Follow these steps to get your IMAP credentials.

### Step 1: Enable 2-Step Verification on Google

App Passwords require 2-Step Verification to be turned on for your Google account.

<Steps>
  <Step title="Go to Google Account Security">
    Visit [myaccount.google.com/security](https://myaccount.google.com/security) and sign in.
  </Step>

  <Step title="Find 2-Step Verification">
    Under **How you sign in to Google**, click **2-Step Verification**.
  </Step>

  <Step title="Turn It On">
    Follow the prompts to enable 2-Step Verification if it's not already on. You'll need your phone to verify.
  </Step>
</Steps>

### Step 2: Generate an App Password

<Steps>
  <Step title="Go to App Passwords">
    Visit [myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords) and sign in.
  </Step>

  <Step title="Name Your App Password">
    In the **App name** field, type something like `AutoTee` so you remember what it's for.
  </Step>

  <Step title="Click Create">
    Google will show you a 16-character password like `abcd efgh ijkl mnop`. **Copy this now** — you won't be able to see it again.
  </Step>
</Steps>

<Tip>
  Save the App Password somewhere safe (like a password manager). If you lose it, you can always generate a new one and update it in AutoTee.
</Tip>

### Step 3: Add Credentials in AutoTee

<Steps>
  <Step title="Go to the Accounts Tab">
    Open the **Accounts** tab in AutoTee.
  </Step>

  <Step title="Add or Edit Your Account">
    Add a new account for the course that requires email verification, or edit your existing one.
  </Step>

  <Step title="Fill In the Email Verification Section">
    Scroll down to **Email Verification (2FA)** and enter:

    * **Email Provider:** Select **Gmail** from the dropdown (this automatically sets the correct server)
    * **Email:** Your Gmail address (e.g., `you@gmail.com`)
    * **App Password:** The 16-character password from Step 2
  </Step>

  <Step title="Save">
    Click **Add Account** (or save your changes). AutoTee will encrypt and store your IMAP credentials securely.
  </Step>
</Steps>

## Other Email Providers

Select your email provider from the dropdown in AutoTee. We support:

| Provider              | Notes                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------------- |
| **Gmail**             | Requires App Password (see above)                                                            |
| **Outlook / Hotmail** | Requires App Password via [Microsoft Security](https://account.microsoft.com/security)       |
| **Yahoo Mail**        | Requires App Password via [Yahoo Account Security](https://login.yahoo.com/account/security) |
| **iCloud Mail**       | Requires App Password via [appleid.apple.com](https://appleid.apple.com/account/manage)      |
| **Other**             | Select "Other" and enter your IMAP server address manually                                   |

<Info>
  The process for generating an App Password is similar across providers — enable two-factor authentication on your email account first, then generate an app-specific password.
</Info>

## How It Works

When AutoTee needs to log in to a course that requires email verification:

1. AutoTee submits your username and password to the course
2. The course sends a **booking code** email to your inbox (from `no-reply@foreupsoftware.com`)
3. AutoTee connects to your email via IMAP and watches for the email
4. Once it arrives (usually within a few seconds), AutoTee reads the 6-digit booking code
5. AutoTee submits the code to complete the login
6. Booking continues as normal

This all happens automatically — you don't need to do anything once it's set up.

## Security

<AccordionGroup>
  <Accordion title="Is it safe to give AutoTee my email credentials?">
    Yes. Your IMAP credentials are encrypted using AES-256 encryption (the same standard used by banks) before being stored. AutoTee only uses them to read booking code emails from ForeUp — nothing else.
  </Accordion>

  <Accordion title="Can AutoTee read all my emails?">
    AutoTee only searches for unread emails from `no-reply@foreupsoftware.com`. It does not read, store, or access any other emails in your inbox.
  </Accordion>

  <Accordion title="What is an App Password?">
    An App Password is a separate password generated by your email provider specifically for third-party apps. It only grants email access (not access to your full Google/Microsoft account) and can be revoked at any time without changing your main password.
  </Accordion>

  <Accordion title="Can I revoke access later?">
    Yes. Go to your email provider's security settings and delete the App Password you created. AutoTee will no longer be able to access your inbox. You can generate a new one anytime if you want to reconnect.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Login fails with 'IMAP connection failed'">
    * Verify you selected the correct email provider from the dropdown
    * Make sure you're using an **App Password**, not your regular email password
    * Check that IMAP is enabled in your email settings (Gmail: Settings → See all settings → Forwarding and POP/IMAP → Enable IMAP)
  </Accordion>

  <Accordion title="Login fails with 'Booking code email not received'">
    * Make sure the email address on your course account matches the IMAP email you configured
    * Check your spam/junk folder — the booking code email may be filtered
    * Try logging into the course website manually to confirm the email is being sent
  </Accordion>

  <Accordion title="I don't see the Email Verification section">
    The Email Verification fields only appear when adding a **ForeUp** account. Make sure you've selected a ForeUp course.
  </Accordion>

  <Accordion title="Can I use a different email for IMAP than my course account?">
    The IMAP email must be the same email that receives the booking codes from the course. This is typically the email address you used to create your course account.
  </Accordion>
</AccordionGroup>
