Multiple email receivers in prometheus alertmanager "to" field - email

How can I create a receiver configuration with multiple email addresses in the "to" field?

You can put comma separated email addresses in the to field.
to: 'user1#example.com, user2#example.com'

For prometheus 1.8 I am using two "to" configurations in the same receiver.
receivers:
- name: 'bla1-and-bla2-mails'
email_configs:
- to: 'bla1#example.com'
from: 'prometheus#example.com'
require_tls: false
send_resolved: true
- to: 'bla2#example.com'
from: 'prometheus#example.com'
require_tls: false
send_resolved: true

Related

Shopware 6 unable to sent Email

I installed and configured Shopware 6.
I configured Emails under Settings → System → Mailer (URL …/admin#/sw/settings/mailer/index)
Unfortunately Emails are still not sent (e.g. Order confirmation or Contact form)
In var/log/prod-2023-01-15.log is see the following line :
[2023-01-15T16:26:33.140153+00:00] app.ERROR: Could not send mail: Failed sending mail to following recipients: {{ recipients }} with Error: Expected response code „250“ but got c ode „550“, with message „550 5.7.1 Sender mismatch“. Error Code:0 Template data: {„recipients“:{„thorsten.niehues#posteo.net“:"thorsten.niehues#posteo.net"},„senderName“:„{{ sale sChannel.name }}“,„salesChannelId“:„c6aa23ebbf0b48d490237ff19bdb47b3“,„templateId“:„5e09e2c5fdb248da8329b09b16d8b6ef“,„customFields“:null,„contentHtml“:„\n
\n The following Message was sent to you via the contact form.\n \n Contact name: {{ contactFormData.firstName }} {{ contactFormData.lastName }}\n \n Contact email address: {{ contactFormData.email }}\n \n Phone: {{ contactFormData.phone }}\n \n Subject: {{ contactFormData.subject }}\n \n Message:\n {{ contactFormData.comment|nl2br }}\n \n\n“, „contentPlain“:„The following Message was sent to you via the contact form.\n\nContact name: {{ contactFormData.firstName }} {{ contactFormData.lastName }}\nContact email address: {{ contactFormData.email }}\nPhone: {{ contactFormData.phone }}\n\nSubject: {{ contactFormData.subject }}\n\nMessage:\n{{ contactFormData.comment }}\n“,„subject“:„Contact form re ceived - {{ salesChannel.name }}“,„mediaIds“:}
I tried to remove all variables form the template to make sure it is not a template issue … but then I still get the error :
[2023-01-15T16:32:14.098476+00:00] app.ERROR: Could not send mail: Failed sending mail to following recipients: {{ recipients }} with Error: Expected response code „250“ but got c ode „550“, with message „550 5.7.1 Sender mismatch“. Error Code:0 Template data: {„recipients“:{„thorsten.niehues#posteo.net“:"thorsten.niehues#posteo.net"},„senderName“:„PlsUseV ariable“,„salesChannelId“:„c6aa23ebbf0b48d490237ff19bdb47b3“,„templateId“:„5e09e2c5fdb248da8329b09b16d8b6ef“,„customFields“:null,„contentHtml“:„Test Contact Form / Email (HTML)“, „contentPlain“:„Test Contact Form / Email (Plain)“,„subject“:„Contact Request“,„mediaIds“:}
550 5.7.1 Sender mismatch is an error returned by the mail server and means that the mail was rejected. This could be because the mail data is either incomplete or violates some security settings of the mail server.
Since it specifically mentions the sender, have you made sure that the mail of the sender is set? By default it should use the address set in the settings of the administration. Have a look at what is set for the Shop owners email address at Settings > Basic information in the administration and verify that it is a valid email address. You can also read the value of the setting quickly by using the CLI:
bin/console system:config:get core.basicInformation.email
Likewise you can also write the setting from the CLI:
bin/console system:config:set core.basicInformation.email doNotReply#localhost.com
Note: You can also set a reply-to address in the mailer settings core.mailerSettings.senderAddress but the address set in the basic information has priority and will be used instead unless it is empty. See the corresponding code here.

Sender address rejected using Ansible mail

I get the following error when I try to send an email from an Ansible playbook using mail.
SMTPRecipientsRefused: {'Jack.Jones#nsd.com': (504, '5.5.2 <root>: Sender address rejected: need fully-qualified address')}
The playbook contains
- name: Send the processing resumed email
mail:
host: smtphost.nsd.com
port: 25
to: Jack.Jones#nsd.com
subject: "Processing of {{ event_name }} events has been resumed"
body: "Processing of {{ event_name }} events has been automatically resumed by the CICD pipeline."
I've tried all sorts of variations for the to: address and nothing seems to fix it.
So the error message is a bit misleading the problem is actually caused by the absence of the from: field not the value in the to: field.
In the absence of the from: field a default value of root is used. As it does not have the #nsd.com extension on it and is thus malformed from the point of view of the email server.
After adding the from: field to the playbook it works properly.
- name: Send the processing resumed email
mail:
host: smtphost.nsd.com
port: 25
to: Jack.Jones#nsd.com
from: CICD.Resume.Service#nsd.com
subject: "Processing of {{ event_name }} events has been resumed"
body: "Processing of {{ event_name }} events has been automatically resumed by the CICD pipeline."

Serverless - Referencing api gateway address in CloudFront origin definition

Using Serverless Framework,
i am creating an api gateway in my template :
functions
test:
handler: test.handler
events:
- http:
path: save-subscription
method: post
cors: false
later on i want to use this api address xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/
as a domain name of an oigin of my cloudfront origins
DomainName: xxxxxxx.execute-api.us-east-1.amazonaws.com
OriginPath: dev
Is there a way to reference the api address dynamically/programmatically before it even exist, and do I need to use depends on?
Thanks
- DomainName:
Fn::Join:
- ""
- - "Ref": "ApiGatewayRestApi"
- ".execute-api.${self:custom.region}.amazonaws.com"
worked for me.
Found the answer here : https://www.richdevelops.dev/blog/how-do-i-get-my-api-gateway-url

FOSUserBundle not sending registration email

I have found a few topics related to the same issues, but the solution for them was a miss-configuration of the smtp settings.
I am using symfony 3.0 and latest FOSUserBundle. My config settings are:
fos_user:
db_driver: orm
firewall_name: main
user_class: AppBundle\Entity\User
resetting:
email:
template: email/password_resetting.email.twig
registration:
form:
type: AppBundle\Form\RegistrationType
confirmation:
enabled: true
from_email:
address: registration#site.com
sender_name: 'Our Team'
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
port: "%mailer_port%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
I am able to send other emails from the same project, using the same swiftmailer settings.
I have checked the web developer tool and the email is prepared for sending
Web profiler - email area
The registration email is not received in the inbox or spam folders.
Could you let me know if I have missed anything in the configuration files that prevents the registration email from being sent?
Thanks,
Lucia
I found a solution for my problem. The registration email address had to be the same as the one used for the swiftmailer username settings. Having it set to a different email address did not work for me.

Rails 3.2: Devise: Email Name

I have a Rails 3.2 application which uses Devise for authentication.
I would like the confirmation email for signups to have "Foo Signups" as the from: email name and "signups#foo.com" as the email address. Right now, I just have "signups#foo.com" as the from: email address.
My config looks like this:
# in the file config/initializers/devise.rb
Devise.setup do |config|
config.mailer_sender="signups#foo.com"
# etc...
and
# in the file config/environments/development.rb
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
authentication: "plain",
enable_starttls_auto: true,
user_name: ENV["GMAIL_ADDRESS"],
password: ENV["GMAIL_PASSWORD"]
}
where GMAIL_ADDRESS and GMAIL_PASSWORD are my Gmail user and password as environment variables and different from signups#foo.com.
How do I configure SMTP or Devise to make "Foo Signups" as the email name and "signups#foo.com" as the email address?
With ActionMailer you can set your from email address similar to "#{#user.name} <#{#user.email}>"
I have not tried this in Devise, but I would think the same thought process would work for the config since I am sure it is just sending that info along to ActionMailer:
Devise.setup do |config|
config.mailer_sender= "Foo Signups <signups#foo.com>"
#...
end