Linux 软件免费装
Banner图

Codo Mailer

开发者 cododigital
更新时间 2026年10月23日 20:32
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

email smtp email log amazon ses deliverability

下载

1.0.0 1.0.1 1.0.2 1.1.0 1.1.1

详情介绍:

Codo Mailer makes sure the email your WordPress site sends (password resets, order confirmations, form notifications) actually arrives. It routes every wp_mail() call through a proper email provider instead of your server's unauthenticated PHP mail. It is built by Codo Digital, a UK web development and managed hosting company, and is the mailer we use on our own clients' sites. Everything is free. There is no Pro version, no upsell, no account to create and no tracking. Providers API providers are used over HTTPS, so blocked SMTP ports on your host don't matter. Features Secure by default Email logs hold password-reset links, so a leaky log is a site takeover waiting to happen. Codo Mailer is designed around that: For hosts and agencies: configuration in wp-config.php Every setting can be fixed with a constant. Constants override the database and show read-only in the admin screen. ` define( 'CODO_MAILER_FROM_EMAIL', 'noreply@example.co.uk' ); define( 'CODO_MAILER_FROM_NAME', 'Example Ltd' ); define( 'CODO_MAILER_PRIMARY_TYPE', 'ses' ); define( 'CODO_MAILER_PRIMARY_REGION', 'eu-west-2' ); define( 'CODO_MAILER_PRIMARY_ACCESS_KEY', 'AKIA...' ); define( 'CODO_MAILER_PRIMARY_SECRET_KEY', '...' ); define( 'CODO_MAILER_BACKUP_TYPE', 'smtp' ); define( 'CODO_MAILER_BACKUP_HOST', 'smtp.example.net' ); define( 'CODO_MAILER_BACKUP_USERNAME', '...' ); define( 'CODO_MAILER_BACKUP_PASSWORD', '...' ); define( 'CODO_MAILER_ALERT_EMAIL', 'ops@example.co.uk' ); ` Connection field names: SMTP host, port, encryption (tls, ssl, none), auth, username, password; SES region, access_key, secret_key, session_token (optional, for temporary credentials); Postmark server_token, message_stream; Mailgun domain, api_key, region (eu, us); Brevo and SendGrid api_key. If an SMTP password is a constant but the host, port, encryption or username are not, the first successful send locks the connection to that server. Changing any of them in the admin screen then stops the connection, so the password can't be redirected to another server. To move servers, set the new values as constants too. To use your own encryption key instead of the site salts, define CODO_MAILER_ENCRYPTION_KEY. See "How do I set a strong encryption key?" in the FAQ. If you rotate your salts without one, re-enter saved API keys and passwords (secrets set as constants are unaffected). For developers Source, issues and tests: github.com/Codo-Digital-Ltd/codo-mailer.

安装:

  1. Install from Plugins > Add New, or upload the codo-mailer folder to /wp-content/plugins/.
  2. Activate the plugin.
  3. Go to Settings > Codo Mailer, choose a provider and enter its credentials.
  4. Use the "Send a test" tab to confirm delivery.
Until a primary connection is saved, WordPress keeps sending email the way it did before.

升级注意事项:

1.1.1 Amazon SES sending now works on hosts that connect out over IPv6. Recommended for all SES users. 1.1.0 Personal data export and erasure for the email log, temporary AWS credentials for Amazon SES, and a new codo_mailer_message filter. 1.0.2 Safer resend, wider redaction of codes and passwords, and warnings for weak encryption keys and unencrypted SMTP logins. Recommended for all sites. 1.0.1 Security hardening for stored credentials and message headers. Recommended for all sites. 1.0.0 First release.

常见问题:

Do I need an account with an email provider?

Yes. Codo Mailer connects your site to a provider; it doesn't send email itself. Amazon SES, Postmark, Mailgun, Brevo and SendGrid all have free or low-cost tiers, or you can use your existing mailbox's SMTP server.

Does it work with WooCommerce and form plugins?

Yes. Anything that sends through wp_mail() goes through Codo Mailer.

Why doesn't my DKIM, Bcc archive or other phpmailer_init plugin work with Postmark, Brevo or SendGrid?

Some plugins change outgoing email by hooking WordPress's phpmailer_init action, which hands them the PHPMailer object just before sending: to add a DKIM signature, Bcc archive copies, embedded images or extra headers. Codo Mailer fires it for SMTP, Amazon SES and Mailgun, which send a full MIME message built with PHPMailer. Postmark, Brevo and SendGrid take the email as JSON through their APIs, so there is no PHPMailer object and phpmailer_init does not run for them; those plugins' changes are skipped. The settings screen points this out when you pick one of these providers, and warns if a plugin on your site uses the hook. What to do instead:

  • DKIM: these providers sign email themselves once you verify your domain with them, so a DKIM plugin isn't needed.
  • Bcc copies, extra headers and other changes: developers can use the codo_mailer_message filter (see "For developers"), which runs for every provider.
  • Otherwise, choose SMTP, Amazon SES or Mailgun, where phpmailer_init keeps working.

Why can't I resend a password-reset email?

The reset link was redacted before logging, so the logged copy no longer contains it. Ask the user to request a new reset, which is also safer.

What happens if both connections fail?

The failure is logged with each provider's error, WordPress's wp_mail_failed action fires, and an alert goes to your alert email and/or webhook.

Does it send any data to Codo Digital?

No. It talks only to the email provider (and alert webhook) you configure.

Does the email log work with WordPress's privacy tools (GDPR export and erasure)?

Yes. Codo Mailer adds an exporter and an eraser to Tools > Export Personal Data and Tools > Erase Personal Data. Both find log entries where the person's address is a To, Cc, Bcc or Reply-To address (exact matches only, ignoring case).

  • Export includes the date, status, sender, subject, message and attachment names of each email, and how the person's address appeared on it. Other recipients' addresses are left out. Password-reset links, one-time codes and passwords are redacted from the export even if redaction was turned off when the email was logged.
  • Erasure deletes each email that was sent only to that person. An email that was also sent to other people is kept, because it is part of their record too: the person's address is removed from it, and the erasure report says how many such emails were kept. Its subject and body are not changed. If they mention the person, you can empty the whole log with "Delete all log entries" on the Email log tab.
Settings > Privacy > Policy Guide includes suggested text about the email log and how long it is kept.

How long are emails kept in the log?

For the number of days set in "Keep logs for (days)", 30 by default. Old entries are deleted by a daily WP-Cron task, which WordPress runs when the site gets visits. If your site sets DISABLE_WP_CRON, make sure a system cron job calls wp-cron.php (or runs wp cron event run --due-now), otherwise entries are kept until it does. You can also empty the log at any time with "Delete all log entries" on the Email log tab.

Is it multisite compatible?

Yes. Each site has its own settings and log, managed by super admins only. Constants in wp-config.php apply to every site in the network.

Can I use temporary AWS credentials (an IAM role or STS) with Amazon SES?

Yes. Temporary credentials come with a session token, which Codo Mailer sends as X-Amz-Security-Token and includes in the request signature. You can supply them in three ways:

  • Leave the access key ID blank on the settings screen (and don't define it in wp-config.php). Codo Mailer then reads the standard AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN environment variables, as set on AWS Lambda and by many container platforms.
  • Define CODO_MAILER_PRIMARY_SESSION_TOKEN (or CODO_MAILER_BACKUP_SESSION_TOKEN) in wp-config.php alongside the access key and secret, for example from values your deployment refreshes.
  • Enter the session token on the settings screen. Temporary credentials expire, typically within hours, so this is only practical for testing. Saving a different access key ID removes a saved session token, and the "Remove" box next to it clears it.
Codo Mailer does not fetch credentials from the EC2 instance metadata service or the ECS container endpoint itself; on those platforms, export the role's credentials to the environment variables above.

Can I send an email with only Bcc recipients?

Over SMTP, Amazon SES and Mailgun, yes. Postmark, Brevo and SendGrid require at least one To address and will report an error.

Will a failure slow my site down?

Each provider call times out after 15 seconds. Failure alerts are sent at the end of the request, after the page has been delivered where the server supports it, so visitors don't wait for them.

Why does the settings screen warn about SMTP without encryption?

With Encryption set to None and Authenticate on, your SMTP username and password are sent to the server in plain text, where anyone on the network path can read them. Codo Mailer also turns off automatic STARTTLS in this mode, so this happens even if the server supports encryption. Choose TLS or SSL unless the server is a trusted relay on your own network. Connections to localhost are not warned about. Hosts can refuse plaintext logins outright with the codo_mailer_smtp_allow_plaintext_auth filter.

How do I set a strong encryption key?

Saved API keys and passwords are encrypted with a key derived from WordPress's AUTH_KEY, AUTH_SALT, SECURE_AUTH_KEY and SECURE_AUTH_SALT. If any of those is missing from wp-config.php, or still says "put your unique phrase here", WordPress stores it in the database, and a database backup alone is then enough to decrypt your secrets. The settings screen warns you when this is the case. To fix it, add a dedicated key of at least 32 random bytes to wp-config.php. Generate one with php -r 'echo base64_encode( random_bytes( 32 ) ), PHP_EOL;' (or wp eval 'echo base64_encode( random_bytes( 32 ) );') and add: define( 'CODO_MAILER_ENCRYPTION_KEY', 'paste-the-value-here' ); Use a random value, not a memorable passphrase: the key is hashed without key stretching, so a short phrase is a weak key. Keys shorter than 32 characters are warned about. Setting or changing the key makes existing saved secrets unreadable. To rotate it: set the new key, then re-enter each API key and password on the settings screen (secrets defined as constants in wp-config.php are unaffected). Keep the key out of version control and out of database backups, which is the point of keeping it in wp-config.php.

Can I let editors or shop managers manage email?

Yes, with the codo_mailer_capability filter, for example add_filter( 'codo_mailer_capability', fn() => 'edit_pages' );. The default is manage_options, or manage_network_options on multisite. Only give it to people you would trust with every account on the site. Anyone who can manage Codo Mailer can change the connection, so they can route all of the site's email, including password resets, through a server they control. Even with the capability lowered, two things stay with administrators: reading message bodies in the email log, and turning Redact secrets off. Bodies can contain working password-reset links, and redaction is what keeps them out of the log. Other users see the log's recipients, subjects and errors, and can still resend emails.

更新日志:

1.1.1 1.1.0 1.0.2 1.0.1 1.0.0