I am getting an error using my email ext plugin from hudson.
I am trying send an email to the following schema:
"< firstName >_< LastName >#< subgroup >.< companyName >.com
ex: John_Doe#stacks.stackoverflow.com
I cannot send emails to this address via the email extension plugin.
The regular email generator works with this address schema.
I am wondering if the Address Checker module in the plugin is too strict about the address name.
Is there any workaround?
I get the following spew from Hudson:
Jun 22, 2009 2:48:53 PM hudson.plugins.emailext.ExtendedEmailPublisher sendMail
WARNING: Could not send email.
javax.mail.internet.AddressException: Illegal address in string ``''
at javax.mail.internet.InternetAddress.(InternetAddress.java:94)
at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:287)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:249)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:241)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:199)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:372)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:360)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:188)
at hudson.model.Run.run(Run.java:962)
at hudson.model.Build.run(Build.java:112)
at hudson.model.ResourceController.execute(ResourceController.java:93)
at hudson.model.Executor.run(Executor.java:119)
Is this really how you have it in Hudson?
"< firstName >_< LastName >#< subgroup >.< companyName >.com
(you have an open quote but no close quote)
If so, that may be your problem.
Yup this is a bug (HUDSON-7057).
Based off of the latest code in the trunk:
this fails: " email1#server.com email2#server.com"
works as expected: "email1#gmail.com email2#gmail.com "
works as expected: "email1#gmail.com email2#gmail.com"
Scrutinize what you put in the recipient list for random whitespace.
I'm using that plugin too and I haven't had any such problems.
The warning appears to be complaining about your configuration. Maybe you'd want to double-check the email address that you typed? Whitespace as separator char for multiple emails? Also, double-check your sytem configuration and make sure you've configured your SMTP server or the default suffix correctly.
You can browse the code but I would guess that the javax mail validator is not too strict - it's built in to java. In the latest code, I don't see the InternetAddress(String) constructor on line 287, so I wonder what version of the plugin you are currently using.
Also, what options do you have selected for email? Send to culprits?
Related
I'm trying to add my email address in Store Email Address, But it is saying "Invalid email address "admin#mydomain"."
Note that my tld is uncommon.
I think that is the reason for the error message.
I can add .com email address easily btw.
Is there any way to add the email?
Thank you.
in validation.js you have
['validate-email', 'Please enter a valid email address. For example johndoe#domain.com.', function (v) {
return Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*#([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
}],
You will have to play with this regular expression.
if you look into this expression you will find a . jsut remove every thing excluding ] from . till end and should solve.
I had the same issue, but your suggestions were misleading.
The error message comes up not from this java script, but app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php
The error is generated from lib/Zend/Validate/EmailAddress.php, because it calls hostname verification from Hostname.php in the same directory.
There you can find in row nr. 117 an array called $_validTlds
there put your domain ('works' or in my case 'wien'), take care alphabetical order, and quotes and commas. save and try again,
it will work. Good luck.
Working on a customised email template in CQ5, I have created in following text file under etc/notification. The workflow is triggered when a form is filled in by the user.
From: Order Brochure <order.brochures#gmail.com>
To: ${payload.email}
CC:
Subject: Order Brochures Confirmation ${payload.BrochureID}
Dear ${payload.Name},
Thank you for your Brochure Order, your reference is ${payload.orderBrochureID}.
Your email address is {$payload.email}.
Everything in this template works fine, except for the "To: ${payload.email}". Even the "Your email address is {$payload.email}" part displays the user inputted email fine. It also works if I input a static email address in "To:".
What am I doing wrong here? Below is the error in logs
Process execution resulted in an error:
javax.mail.internet.AddressException: Illegal address in string ``''
com.day.cq.workflow.WorkflowException: javax.mail.internet.AddressException: Illegal
address in string ``''
Remove the "CC:" it's attempting to parse the email address for this header and it's a null.
When you're dealing with these types of problems when the error is occurring within a CQ library. I recommend using a custom logger to assist with the troubleshooting.
Details of logging can be found at Logging - docs.day.com
Here's an example OSGi log configuration for your issue.
This error might be cumming because you are using a string as an Internet Address.
you need to typecast ${payload.email} to Internet Address.
How can I get the email address out of a string like:
def emailAddress="john#doe.com <\john#doe.com\\>"
so that I can use it in a call to Contactperson.findByEmailAddress(variable)
JavaMail provides a class for representing email addresses that can parse strings in the format you have. Take a look at javax.mail.internet.InternetAddress.
Grails has a mail plugin that will automatically make JavaMail available.
A simple solution is
Contactperson.findByEmailAddress(emailAddress.split('<')[0])
But you need to do some validation work first to avoid format errors.
I'm assuming the email you need to compare is inside the brackets:
Contactperson.findByEmailAddressIlike('%<${variable}>%')
You'll probably need to escape the special characters depending on your database.
What I'm trying to do is format the email address like so Foo Bar <foo#bar.com> so email clients (including web based like gmail) will show the sender as "Foo Bar" and not just "foo" since that is the prefix on the email.
Is this possible in Magento 1.5? If I try to put the formatting in the field itself I get an error message.
That's what the Sender Name field does. This is what my setup looks like and what it looks like in Thunderbird (my webmail client formats it similarly, too):
You may look at code/core/Mage/Core/Model/Email.php for the actual mail implementation. You may notice it uses Zend_Mail. Now, here is the catch:
For security reasons, Zend_Mail filters all header fields to prevent header
injection with newline (\n) characters. Double quotation is changed to single
quotation and angle brackets to square brackets in the name of sender and recipients.
If the marks are in email address, the marks will be removed.
What you can do though is to make a module to rewrite the current class Mage_Core_Model_Email and overwrite the send() function. I covered rewriting classes before in this question's answer. Then, in this new rewritten class, you could PHPmailer, invoke shell mail commands, or whatever PHP library you would happen to know that would allow this behaviour.
Best of luck.
I'm not sure if it can work. In magento inside is a Zend_Validate which does validation of such email addresses. And I dont think so that email like 'Foo Bar ' is valid. But I think the display in customer's email client depend on client, no?
My application uses sendmail to send outbound email. I set the 'From:' address using the following format:
Fred Dibnah <fred#dibnah.com>
I'm also setting the Reply-To and Return-Path headers using the exact same format.
This seems to work in the vast majority of cases but I have seen at least one instance in which this fails, namely when the name part of the above string contains a period (full stop):
Fred Dibnah, Inc. <fred#dibnah.com>
This fails deep inside the TMail code (I'm using Ruby) but it seems like a perfectly valid thing to do.
My question is, should I actually be setting the Return-Path and Reply-To headers using only the email address as opposed to the above Name + Email format? E.g.
fred#dibnah.com
Thanks.
In a situation like this, it is best to turn to the RFCs.
Upon reading up on your question, it appears as if You shouldn't be setting the Return-Path value ever. The final destination SMTP server is supposed to be setting this value as it transitions the message to your mailbox (http://www.faqs.org/rfcs/rfc2821.html starting at 4.4).
According to http://www.faqs.org/rfcs/rfc2822.html the Reply-To field can have the following formats
local-part "#" domain (fred#dibnah.com for example)
display-name (Fred Dibna for example)
I would recommend using option 1 as it seems to be the most basic, and you will likely have less issues with that format. In choosing option 1, your Reply-To field should look like the following:
Reply-To: fred#dibna.com