Our clients send newsletters to their users. The code that transmits the message is as follows:
<cfmail to="First Last <recipientemail>" from="Sender <noreply#ourdomain.com>" failto="noreply#ourdomain.com" subject="Any subject" type="HTML">
<cfmailparam name="Reply-To" value="adifferentemail#whateverdomain.com">
message
</cfmail>
Here's what's odd:
The mail is sent.
The recipient receives the message successfully.
Recipient replies, adifferentemail#whateverdomain.com receives their reply.
When the owner of adifferentemail#whateverdomain.com tries to reply to their reply, the email address of the recipient is the original "from address"(noreply#ourdomain.com). So they are unable to reply b/c its not the recipient's actual address.
I am at a loss for what is causing this.
Here is a screenshot of the attempt to reply to the reply.
http://postimg.org/image/7dqmo0dd3/
Related
I'm trying to create a discussion list sender using SES. The 'receive' part is fine, but when I send, I want to preserve the user's "from" address. Aside from some subject rewriting, here's what I'm doing to the headers; VERIFIED_FROM is my mailing list alias. This is py3.6, but it shouldn't matter.
msg['Reply-To'] = VERIFIED_FROM_EMAIL
msg['Return-Path'] = VERIFIED_FROM_EMAIL
When I call sendRawEmail, I get an error like this, brackets for scrubbed entries:
[ERROR] [timestamp] [request id] Client error while forwarding email for <[VERIFIED_FROM_EMAIL]> to <[all emails on list]>: An error occurred (MessageRejected) when calling the SendRawEmail operation: Email address is not verified. The following identities failed the check in region US-WEST-2: ["user who sent the message" user#domain.com]
I can't put all users on the verified list. I could set the 'from' to my list address, but then I lose the identity of the sender.
I'm sure this has been done with SES- but how?
The reply-to field and the return-path field are fields that require a validated email address. [1]
With each email you relay, you can create a unique email address for people to reply to (e.g. abcdef123#yourdomain.com) which you can then relay back to the same threads using the Message-ID and In-Reply-To headers.
You can also modify what the name looks like for the message using the Name <email#yourdomain.com> header too.
[1] https://forums.aws.amazon.com/message.jspa?messageID=221703
When any user sends any email via Mail Manager, the default reply_to email address is set as the Help_desk_emailid by Vtiger. I want to change that reply_to email address and want to use some custom dynamic email address for all the outgoing emails via Mail manager only; not for any other outgoing emails such as events, reminders etc.
It would be really helpful even if i need to do that directly in the code in core files.
All the emails through Mail Manager are sent via different module and not using /modules/Emails/mail.php
All the emails are sent from /modules/Emails/models/Record.php via send() function.
So to change the reply_to email address we need to modify below line in send() function:
$replyTo = $currentUserModel->get('email1');
You can change reply to email address in /modules/Emails/mail.php
if(isUserInitiated()) {
$replyToEmail = $from_email;
} else {
$replyToEmail = $from_email_field;
}
Just change the logic of getting from email address or else you can add static email address.
I had email source with me and want parse original recipient of email.
Lets say "user1#test.com" is receiving a email, but in "To" list user1#test.com, user2#test.com & user3#test.com are mentioned. I want to get only user1 from email source.
In initial analysis, email from mdeamon server contains "X-MDaemon-Deliver-To:" tag. Similarly email from Devcot mail server contains "Delivered-To:". But not getting generic parsing logic to get original email recipient.
How I can parse email to get original recipient of an email?
The best way to get this information is probably to parse the Received headers to see who the message was delivered for. In other words, look for a Received header that has a for token followed by x#x.com (where x#x.com will be the recipient).
I am trying to get the email addresses for which my mails bounced and the only way I could find was to read the bounced Email using javamail and try finding the Email addresses Contained in the Message. I am able to read the Emails and now My challenge is finding the Emails therein.
Here is My method:
public String findEmailInString(String message) {
String email = "";
Pattern pat = Pattern.compile("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*#[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$");
Matcher match = pat.matcher(message);
while (match.matches()) {
email = match.group();
}
return email;
}
EDIT My messages are in this Format:
"
This is an informative message sent by mail.simbatech.biz.
The server was not able to deliver your email message
Subject: GAtungo
Date: Fri, 14 Nov 2014 15:52:58 +0300
to the following addresses:
<gatungowanungai#simbatech.biz> (mail.simbatech.biz: Mailbox does not exist)"
This Method is returning null despite the fact that there are email addresses in the message body. Is there a better way to achieve this?
I know that this doesn't answer the question directly but the normal practice here isn't to attempt to parse the bounce message at all.
Instead when you send your emails out you set a different Return-Path header for each email that you send. You can then uniquely identify which user this message is from.
This technique is called VERP.
I set up the sendmail email backend with this snippet
I open the shell and run (with actual email accounts):
from django.core.mail import send_mail
send_mail('Subject here', 'Here is the message.', 'from#example.com',
['to#example.com'], fail_silently=False)
After that, the console just prints a:
1
No error messages or anything... but the emails never arrive on the other end...
Is there anything else that I need to configure?
Thanks,
Requested the mail server's error logs from my hosting provider and saw this:
send_to_gateway router failed to expand "${perl{mailtrapheaders2}}":
Undefined subroutine &main::mailtrapheaders2 called.\n`
They are still trying to figure it out :S
In the snippet code:
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of email
messages sent.
"""
which returns a variable num_sent which is incremented for every mail that has been actually sent. This is the 1 your are seeing displayed in the console.
Probably the problem is in your mail server. sendmail connects to the mail server and tells him "take this mail and send it to adress X". If the mail server is working it takes is and says OK, and then tries to send it to the address - if something breaks during the send its mail server error and it is not send to Django.
Check your mail server log, I believe you will find the answer of "why is the main not delivered" there.