Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiftmailer Address Error #1496

Closed
jacurtis opened this issue May 17, 2017 · 4 comments
Closed

Swiftmailer Address Error #1496

jacurtis opened this issue May 17, 2017 · 4 comments
Labels

Comments

@jacurtis
Copy link

I am repeatedly getting an error in my logs stating basically that my "TO" address is not being attached to the email, and thus being rejected by Swiftmailer.

The exact error states:

 production.ERROR: ***Swift_RfcComplianceException*** [0] : /home/user/laravel-site/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php [Line 345] => Address in mailbox given [] does not comply with RFC 2822, 3.6.2.

It seems like the address is not being appropriately attached to the emails. I have double-checked the config/mail.php file to see if the address is configured appropriately there. It seems like it is (in that file at least), and it pulls correctly the email and name from the .env file. I went as far as to hardcode the data (instead of pulling from the .env file and it still didn't work.

Does anyone have any idea how to fix this error? The error basically says I do not have any email to send the email from, but there is an email there. Where else do i look to solve this and/or what is causing it in the first place?

@hillelcoren
Copy link
Member

If you uncomment this line the values being used will get logged to storage/logs/laravel-info.log

https://github.com/invoiceninja/invoiceninja/blob/master/app/Ninja/Mailers/Mailer.php#L46

@turbo124
Copy link
Member

What version of PHP are you using?

Are you using mod_php?

I've read about issues with PCRE libs which can cause this error to pop up:

swiftmailer/swiftmailer#382 (comment)

@jacurtis
Copy link
Author

jacurtis commented May 17, 2017

I am using:

  • Ubuntu 16
  • Nginx
  • php_fpm
  • php 7.1
  • AWS SES for email using SMTP credentials

I also ran the info log to see what info has been received. This is the output in the log:

production.INFO: customer@email.com | admin@email.com |  [] []

I changed the actual email addresses. But the first email address is correctly the customer's email (intended recipient), and the second email is the logged in user's email (my work email in this case).

The rest is just the square brackets, this is the problem as those should be email address and name of where the email is being sent from (billing@company.com).

So now the question is why is the company email not filling.


It looks like that is pulling from a constant CONTACT_EMAIL - now i need to find where the constant is set.

@jacurtis
Copy link
Author

We can close this. The reason for the problem turned out that for some reason constants where not getting written to. I found the constants file and tested logged various other constants. For some reason constants were mostly null even when they were supposed to pull from the .env file. Weird issue. I think it had to do with me messing around with composer earlier and messing something up.

I just kept the database and did a fresh deploy of the code back from the original github repo and it solved the issue. This was an issue specific to me and not in general to the project.

Thank you for the help though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants