Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SES configuration not working in 1.1.2

    Bug Report
    3
    27
    6430
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mikeyapina last edited by mikeyapina

      Here is my .env

      MAIL_DRIVER=smtp
      MAIL_HOST=email-smtp.us-west-2.amazonaws.com
      MAIL_PORT=587
      MAIL_USERNAME=ses username not in base64
      MAIL_PASSWORD=ses password not in base64
      MAIL_ENCRYPTION=tls
      SHOP_MAIL_FROM=admin@ov3rt.com
      ADMIN_MAIL_TO=admin@ov3rt.com
      MAIL_FROM_NAME=admin

      I also have this mail.php

      <?php

      return [

      /*
      |--------------------------------------------------------------------------
      | Mail Driver
      |--------------------------------------------------------------------------
      |
      | Laravel supports both SMTP and PHP's "mail" function as drivers for the
      | sending of e-mail. You may specify which one you're using throughout
      | your application here. By default, Laravel is setup for SMTP mail.
      |
      | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
      |            "sparkpost", "log", "array"
      |
      */
      
      'driver' => env('MAIL_DRIVER', 'ses'),
      
      /*
      |--------------------------------------------------------------------------
      | SMTP Host Address
      |--------------------------------------------------------------------------
      |
      | Here you may provide the host address of the SMTP server used by your
      | applications. A default option is provided that is compatible with
      | the Mailgun mail service which will provide reliable deliveries.
      |
      */
      
      'host' => env('MAIL_HOST', 'email-smtp.us-west-2.amazonaws.com'),
      
      /*
      |--------------------------------------------------------------------------
      | SMTP Host Port
      |--------------------------------------------------------------------------
      |
      | This is the SMTP port used by your application to deliver e-mails to
      | users of the application. Like the host we have set this value to
      | stay compatible with the Mailgun e-mail application by default.
      |
      */
      
      'port' => env('MAIL_PORT', 587),
      
      /*
      |--------------------------------------------------------------------------
      | Global "From" Address
      |--------------------------------------------------------------------------
      |
      | You may wish for all e-mails sent by your application to be sent from
      | the same address. Here, you may specify a name and address that is
      | used globally for all e-mails that are sent by your application.
      |
      */
      
      'from' => [
          'address' => env('SHOP_MAIL_FROM'),
          'name' => env('MAIL_FROM_NAME')
      ],
      
      /*
      |--------------------------------------------------------------------------
      | Global "Admin" Address
      |--------------------------------------------------------------------------
      |
      | General admin related admins, such as order notifications.
      |
      */
      
      'admin' => [
          'address' => env('ADMIN_MAIL_TO'),
          'name' => env('ADMIN_MAIL_NAME', 'Admin')
      ],
      
      /*
      |--------------------------------------------------------------------------
      | E-Mail Encryption Protocol
      |--------------------------------------------------------------------------
      |
      | Here you may specify the encryption protocol that should be used when
      | the application send e-mail messages. A sensible default using the
      | transport layer security protocol should provide great security.
      |
      */
      
      'encryption' => env('MAIL_ENCRYPTION', 'tls'),
      
      'stream' => [
          'ssl' => [
             'allow_self_signed' => true,
             'verify_peer' => false,
             'verify_peer_name' => false,
          ],
      ],
      
      /*
      |--------------------------------------------------------------------------
      | SMTP Server Username
      |--------------------------------------------------------------------------
      |
      | If your SMTP server requires a username for authentication, you should
      | set it here. This will get used to authenticate with your server on
      | connection. You may also set the "password" value below this one.
      |
      */
      
      'username' => env('eewewewew not in base64'),
      
      'password' => env('ewewewew not in base64'),
      
      /*
      |--------------------------------------------------------------------------
      | Sendmail System Path
      |--------------------------------------------------------------------------
      |
      | When using the "sendmail" driver to send e-mails, we will need to know
      | the path to where Sendmail lives on this server. A default path has
      | been provided here, which will work well on most of your systems.
      |
      */
      
      'sendmail' => '/usr/sbin/sendmail -bs',
      
      /*
      |--------------------------------------------------------------------------
      | Markdown Mail Settings
      |--------------------------------------------------------------------------
      |
      | If you are using Markdown based email rendering, you may configure your
      | theme and component paths here, allowing you to customize the design
      | of the emails. Or, you may simply stick with the Laravel defaults!
      |
      */
      
      'markdown' => [
          'theme' => 'default',
      
          'paths' => [
              resource_path('views/vendor/mail'),
          ],
      ],
      

      ];

      M 1 Reply Last reply Reply Quote 0
      • M
        mikeyapina @mikeyapina last edited by

        @mikeyapina

        ok I am getting a new error tried some different things and can both send email at the CLI as well as it appears everything is connecting as before. What I wanted to do was find a un/pw with no weird characters -- then I cleared everything and slowly tested everything .. I believe I have a good setup now suing this scenario now I am getting an error for AWS

        From this error ---

        [2020-08-21 15:19:07] local.ERROR: Region must be a valid RFC host label. {"exception":"[object] (Aws\Exception\InvalidRegionException(code: 0): Region must be a valid RFC host label. at /var/www/html/bagisto/vendor/aws/aws-sdk-php/src/ClientResolver.php:543)
        [stacktrace]

        I found this script inside the pointing to error files

                // Check region is a valid host label when it is being used to
                // generate an endpoint
                if (!self::isValidRegion($args['region'])) {
                    throw new InvalidRegionException('Region must be a valid RFC'
                        . ' host label.');
                }
        
        1 Reply Last reply Reply Quote 0
        • M
          mikeyapina last edited by

          What I have figured out about the setting driver -- if I set it to SES I get results in the laravel.log file in storage. If I set it to SMTP I am able to see the errors in the SMTP mail.log file.

          These are the issues in summary:

          SES setting:

          I am getting:
          [2020-08-20 23:12:30] local.ERROR: Expected response code 250 but got code "530", with message "530 Authentication required^M
          " {"exception":"[object] (Swift_TransportException(code: 530): Expected response code 250 but got code "530", with message "530 Authentication required^M

          SMTP

          Aug 19 20:44:59 ip-172-31-19-18 sm-mta[30721]: 07JKiwwO030719: to=vote2020@ov3rt.com, delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=122519, relay=email-smtp.us-west-2.amazonaws.com. [52.88.217.130], dsn=5.0.0, stat=Service unavailable

          CLI

          I can send email sends out using SMTP

          1 Reply Last reply Reply Quote 0
          • M
            mikeyapina last edited by

            @mikeyapina said in SES configuration not working in 1.1.2:

            ses

            There appears to be a mix-match of credentials when the application is sending them to the end-point. Are you wrapping it with something? Ar you escaping it?

            The SES SMTP relies on base-64 encoding. If it is not doing a conversion to base-64 we will get an authentication issue with SES.

            M 1 Reply Last reply Reply Quote 0
            • M
              mikeyapina last edited by

              i guess we have to do something like this to the code being sent to SES (username/password> where do we do this? I believe when we send it to AWS SES but where?

              $message->embedData(base64_decode($data['photos'][$x]), 'Blah')

              The above came from the internet describing what to do with a different issue.

              1 Reply Last reply Reply Quote 0
              • M
                mikeyapina @mikeyapina last edited by

                @mikeyapina

                this is the message from AWS
                As discussed on call, the issue we are suspecting is that your application might not be encoding the SES SMTP credentials which is why we might be seeing 530 Authentication Error. You would be following up with the application vendor regarding this. Also, if you would like we would be happy to jump on a call with your vendor to discuss this further. Please do let us know

                1 Reply Last reply Reply Quote 0
                • R
                  rahul last edited by

                  Hi @mikeyapina

                  Bagisto is basically created on Laravel, a PHP framework, and its support Amazon SES SMTP.

                  I think, might be, it is a problem of configuration due to which we are getting this issue. Kindly make sure it is configured correctly.

                  You can follow this one for configuartion - https://medium.com/@martin.riedweg/configure-amazon-ses-on-laravel-5-8-in-5-minutes-764c30df6399

                  Thanks

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    mikeyapina @rahul last edited by

                    @rahul please read my messages from AWS .. it is clear you have not. The exact article I implemented before sending messages to you. Before engaging AWS SES. This is not the issue. Let me state this clearly. This is not the issue.

                    The issue is clear! please listen to this time. AWS SES requires base64 translations of its passwords in order to work. Because you do not want to listen to me let me state it again. YOU HAVE TO USE BASE64 WHEN PASSING UN/PW to AMAZON SES.

                    Please do I need to say it now for the 6th time!

                    I can communicate from the command line I just cannot communicate using your scripts .. because it isn't properly sending it encoded in base64.

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      mikeyapina @mikeyapina last edited by

                      @mikeyapina so what I am hearing is since you guys will not fix this issue I have to create up a traditional not very reliable smtp server as the only solution?

                      1 Reply Last reply Reply Quote 0
                      • V
                        Vaishali Agarwal last edited by Vaishali Agarwal

                        @mikeyapina
                        you may create ticket to our support team https://bagisto.uvdesk.com/en/customer/create-ticket/ as we can't check with out having all the privilege.. kindly raise the ticket in the provided link or share your server FTP/SFTP credentials along with SES credentials.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post