Skip to content

Commit

Permalink
intial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dietercoopman committed Aug 5, 2022
1 parent cfb14b6 commit 0980b25
Show file tree
Hide file tree
Showing 22 changed files with 269 additions and 424 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a
url: https://github.com/dietercoopman/mailspfchecker/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/:vendor_name/:package_name/discussions/new?category=ideas
url: https://github.com/dietercoopman/mailspfchecker/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/:vendor_name/:package_name/security/policy
url: https://github.com/dietercoopman/mailspfchecker/security/policy
about: Learn how to notify us for sensitive bugs
- name: Report a bug
url: https://github.com/:vendor_name/:package_name/issues/new
url: https://github.com/dietercoopman/mailspfchecker/issues/new
about: Report a reproducable bug
28 changes: 0 additions & 28 deletions .github/workflows/update-changelog.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

All notable changes to `:package_name` will be documented in this file.
All notable changes to `mailspfchecker` will be documented in this file.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) :vendor_name <[email protected]>
Copyright (c) dietercoopman <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
95 changes: 39 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,60 @@
![showsql](https://banners.beyondco.de/mailspfchecker.png?theme=light&packageManager=composer+require&packageName=dietercoopman%2Fmailspfchecker&pattern=architect&style=style_1&description=A+Laravel+package+to+check+if+your+application+can+send+e-mail+in+name+of+a+given+address.&md=1&showWatermark=1&fontSize=100px&images=https%3A%2F%2Flaravel.com%2Fimg%2Flogomark.min.svg)

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/support-ukraine.svg?t=1" />](https://supportukrainenow.org)
# A package to check if you can send e-mail through a given mailserver in name of a given e-mail address

# :package_description
[![Latest Version on Packagist](https://img.shields.io/packagist/v/dietercoopman/mailspfchecker.svg?style=flat-square)](https://packagist.org/packages/dietercoopman/mailspfchecker)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/dietercoopman/mailspfchecker/run-tests?label=tests)](https://github.com/dietercoopman/mailspfchecker/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/dietercoopman/mailspfchecker/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/dietercoopman/mailspfchecker/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/dietercoopman/mailspfchecker.svg?style=flat-square)](https://packagist.org/packages/dietercoopman/mailspfchecker)

[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/run-tests?label=tests)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
<!--delete-->
---
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
# Mail spf checker

1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
3. Have fun creating your package.
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
---
<!--/delete-->
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
A Laravel package to check if your application can send e-mail in name of a given address.

## Support us
## Use case

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)
Most of the web applications are sending mails. Mostly through a local mail server or an external mailing service.
When sending in name of a domain without using the legitimate mailserver of the domain it can get tricky.
Most of the time your mail ends up in a spam folder. This can be solved by configuring a correct SPF record for the domain you are sending with. This package
gives you the possibility to check if you can send with a given from address using the mailserver specified in your mail config
or a given mailserver. It also gives the possibility to retrieve a dns txt record to configure your dns.

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
## Compatibility

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
This package can be installed in Laravel 6,7,8 and 9

## Installation

You can install the package via composer:

```bash
composer require :vendor_slug/:package_slug
```

You can publish and run the migrations with:

```bash
php artisan vendor:publish --tag=":package_slug-migrations"
php artisan migrate
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag=":package_slug-config"
```shell
composer require dietercoopman/mailspfchecker
```

This is the contents of the published config file:
## Examples

```php
return [
];
```
### Using the mailserver used by your application

Optionally, you can publish the views using
```php

```bash
php artisan vendor:publish --tag=":package_slug-views"
if ($mailService->canISendAs("[email protected]")) {
// the happy path
} else {
// you can not send e-mail in name of [email protected], but I can tell you what to do
echo $mailService->howCanISendAs("[email protected]");
// Generate a txt-record with a name of dietse.dev and the value v=spf1 ip4:#.#.#.# -all
}
```

## Usage

```php
$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');
```
### Using a given mailserver

## Testing
```php

```bash
composer test
if ($mailService->using('smtp.mandrill.com')->canISendAs("[email protected]")) {
// the happy path
} else {
// you can not send e-mail in name of [email protected], but I can tell you what to do
echo $mailService->using('smtp.mandrill.com')->howCanISendAs("[email protected]");
// Generate a txt-record with a name of dietse.dev and the value v=spf1 ip4:spf.mandrill.com -all
}
```

## Changelog
Expand All @@ -80,15 +63,15 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re

## Contributing

Please see [CONTRIBUTING](https://github.com/:author_username/.github/blob/main/CONTRIBUTING.md) for details.
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## Credits

- [:author_name](https://github.com/:author_username)
- [Dieter Coopman](https://github.com/dietercoopman)
- [All Contributors](../../contributors)

## License
Expand Down
38 changes: 21 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"name": ":vendor_slug/:package_slug",
"description": ":package_description",
"name": "dietercoopman/mailspfchecker",
"description": "A package to check if you can send e-mail through a given mailserver in name of a given e-mail address",
"keywords": [
":vendor_name",
"dietercoopman",
"laravel",
":package_slug"
"mailspfchecker"
],
"homepage": "https://github.com/:vendor_slug/:package_slug",
"homepage": "https://github.com/dietercoopman/mailspfchecker",
"license": "MIT",
"authors": [
{
"name": ":author_name",
"email": "[email protected]",
"name": "Dieter Coopman",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": "^8.1",
"spatie/laravel-package-tools": "^1.9.2",
"illuminate/contracts": "^9.0"
"illuminate/contracts": "^9.0",
"mlocati/spf-lib": "^3.1",
"spatie/laravel-package-tools": "^1.9.2"
},
"require-dev": {
"laravel/pint": "^1.0",
Expand All @@ -30,18 +31,17 @@
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"spatie/laravel-ray": "^1.26"
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"VendorName\\Skeleton\\": "src",
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories"
"Dietercoopman\\Mailspfchecker\\": "src",
"Dietercoopman\\Mailspfchecker\\Database\\Factories\\": "database/factories"
}
},
"autoload-dev": {
"psr-4": {
"VendorName\\Skeleton\\Tests\\": "tests"
"Dietercoopman\\Mailspfchecker\\Tests\\": "tests"
}
},
"scripts": {
Expand All @@ -51,15 +51,19 @@
"format": "vendor/bin/pint"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
}
},
"extra": {
"laravel": {
"providers": [
"VendorName\\Skeleton\\SkeletonServiceProvider"
"Dietercoopman\\Mailspfchecker\\MailspfcheckerServiceProvider"
],
"aliases": {
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
"Mailspfchecker": "Dietercoopman\\Mailspfchecker\\Facades\\Mailspfchecker"
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions config/mailspfchecker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

// config for Dietercoopman/Mailspfchecker
return [

];
6 changes: 0 additions & 6 deletions config/skeleton.php

This file was deleted.

Loading

0 comments on commit 0980b25

Please sign in to comment.