SugarCRM EmailMarketing doesn't send emails - php

What I'm doing:
I use SugarCRM.
At first I complete email settings in /index.php?module=EmailMan&action=config. Test letter send fine. That works OK.
Then I create new emailing list using module "Campaigns". Then I move to a wizard to create new email /index.php?action=WizardMarketing&module=Campaigns.... and send emails.
Finally emails are sent. I watch og and see "SUCCESS" (warn only here because I changed its logging status in code from debug to warn):
Mon Sep 10 11:17:42 2012 [13138][1][WARN] Email delivery SUCCESS:Array
(
[date_entered] => 2012-09-10 07:17:20
[date_modified] =>
[user_id] => 1
[id] => 118
[campaign_id] => 362acd98-9980-c24b-921e-5020db524444
[marketing_id] => a00e472d-6026-6fc6-8919-5020db14f6a8
[list_id] => 9ac9c172-feb3-1024-bf2a-5018f1e4074b
[send_date_time] => 2012-09-10 05:05:00
[modified_user_id] =>
[in_queue] => 0
[in_queue_date] =>
[send_attempts] => 0
[deleted] => 0
[related_id] => ec106592-598f-9b45-e3e4-5022647678a6
[related_type] => Prospects
)
So seems like everything is ok. But.. I don't receive any email. And also I don't see any sent emails on DetailView (/index.php?action=DetailView&module=Campaigns....).
But they can be found in Blocked emails!
What I've done:
I tried to change email setting in EmailMan module config for inbox/outbox. Seems like they work fine with test emails. Also i tried to find php problems and changed modules\EmailMan\EmailManDelivery.php logging for success email from debug to warn to make them showing in *.log file.
Question:
Why are my emails blocked. And what do I need to do to make them send successfully?
Thanks for any help and ask my if more info is needed.

Ok, I luckily found problem just a second ago on one forum about Sugar. The problem with Blocked emails was... that system don't send two or more emails on one adress, so other tries were blocked. Creating new Marketing Company solves this problem.

Related

Determining if and possibly retrieving a Twilio incoming MMS attachment that has an unsupported content type

Using the Twilio PHP API, I'm trying to account for unsupported attachments (specifically "text/x-vCard", as sent by Android/Google Fi). When I receive the $_POST vars in my code, they look something like this:
Array
(
[ToCountry] => US
[ToState] => NJ
[SmsMessageSid] => <sms-message-id>
[NumMedia] => 0
[ToCity] => MERCHANTVILLE
[FromZip] => 08401
[SmsSid] => <sms-sid>
[FromState] => NJ
[SmsStatus] => received
[FromCity] => <from-city>
[Body] => This is the body of the message.
[FromCountry] => US
[To] => +xxxxxxxxxxx
[ToZip] => xxxxx
[AddOns] => {"status":"successful","message":null,"code":null,"results":{}}
[NumSegments] => 1
[MessageSid] => <message-sid>
[AccountSid] => <account-sid>
[From] => +xxxxxxxxxxx
[ApiVersion] => 2010-04-01
)
As you can see, there is no evidence of any error or warning that an unsupported file type has been sent. I need to either
Reply to the sender that the attachment is unsupported, or
Find the saved attachment on Twilio and forward it.
I suspect that the attachment IS saved on Twilio, because when I use the $twilio->messages('xxxxxxxxxxxxxxxx')->fetch(), I get a whole lot more info, including:
[subresourceUris] => Array (
[media] => /2010-04-01/Accounts/xxxxxxxxxxxxxxxx/Messages/xxxxxxxxxxxxxxx/Media.json
))
I don't see a documented way to retrieve the resource using PHP, so I'm stuck. I've tried:
$media = $twilio->messages("MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
->media("MEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
->fetch();
This returns some items, but they are similar to the ->fetch() return and I don't see anything that will help me download or read the media.
So after working with Twilio tech support for two weeks, I've learned that Twilio simply drops an attachment with an unsupported mime type.
As to how to get alerted to the error, there is no documented way that I could find from the Twilio docs or working with tech support, but I found a work-around that seems to do the job for now. Here's what I do:
Twilio sends me the incoming message to incoming.php on my server.
I get the attachment count using $_POST['NumMedia'].
Using $_POST['SmsMessageSid'], I query Twilio to retrieve the message stored on the server:
$msg = $client->messages($_POST['SmsMessageSid'])->fetch();
I check the $msg->numMedia value. If it's greater than the $_POST['NumMedia'] value, I know an attachment has been dropped.
If the numbers don't match, I shoot off a reply text to the sender letting them know an attachment was dropped.
I've asked Twilio support to send a note to the developers to add x-vcard as a supported type, since a LARGE number of Android phones still use it.
Thank you to #philnash for help with the problem.

Checking for an MX record with getmxrr() or dns_get_record() returns incorrect information

I am currently attempting to check the validity of an email address by first checking if an MX record exists, using getmxrr() or dns_get_record() with PHP 7 on a DigitalOcean droplet.
In my example (which returns the incorrect response), I am attempting to check an email address on the domain “nuwatches.com”. Using dns_get_record(”nuwatches.com”, DNS_ALL), I’m returned an array that DOES include an MX record, even though I know this does not exist in reality:
[5] => Array (
[host] => nuwatches.com.com
[class] => IN
[ttl] => 27
[type] => MX
[pri] => 1
[target] => mail.user-mail.net
)
However, if I use nslookup directly from the console on the DigitalOcean droplet, I’m correctly told that no MX record exists.
In addition, if I run the dns_get_record() function on a different droplet, or using an online PHP code runner, I’m also given the correct answer (which is that no MX record exists).
I’ve spoken to DigitalOcean support and they suggest there’s something strange happening with PHP on that particular droplet, perhaps with caching issues, but I can’t at all figure out what might be causing the discrepancy, especially as I'm not caching anything myself.
As it stands, my only option to get the correct response on this droplet is to run nslookup and then parse the result, but I would like to use dns_get_record() if possible.
I’d appreciate any suggestions. Thanks!
I am having similar problems with dns_get_record() when calling it with the default value for record type DNS_ANY or when calling it with DNS_ALL.
php dns_get_records( host, type ) is returning false with type=DNS_ALL but returns DNS records with DNS_TXT or DNS_A
A solution that worked for me was to use:
dns_get_record( ”nuwatches.com”, DNS_MX )
I am still investigating the reason behind this behaviour.
You can try to use a 3rd party PHP library for that.
I've just tested it and it worked for me.
bluelibraries/dns
sample
use BlueLibraries\Dns\Facade\DNS;
use BlueLibraries\Dns\Records\RecordTypes;
$records = DNS::getRecords('nuwatches.com', RecordTypes::MX);
print_r($records);
result
Array
(
[0] => BlueLibraries\Dns\Records\Types\MX Object
(
[data:protected] => Array
(
[host] => nuwatches.com
[ttl] => 3600
[class] => IN
[type] => MX
[pri] => 1
[target] => localhost
)
)
)

Sendgrid can't receive emails in application

I'm trying to receive e-mails sended to my account on sendgrid.
So What I basically have is the following:
A sendgrid account linked to http://www.rallypodium.be
A cloudflare account linked to http://www.rallypodium.be server IP adress.
A server on DigitalOcean.
Good, So I'm running Nginx on that server and I want to be able to get the e-mails send to #rallypodium.be to be saved and stored inside of my database wich is on the same DigitalOcean server.
I've set up the Inbound Parse like this:
HOST: www.rallypodium.be
URL: http://www.rallypodium.be/inbound/parse/mail
My domain is whitelabled.
I've read the docs for 10 times and still didn't figure out what I'm doing wrong.
This is how I store them:
public function ReceiveMail(Request $request)
{
DB::table('email')->insert([
'headers' => $request->get('headers'),
'html' => $request->get('html'),
'from' => $request->get('from'),
'to' => $request->get('to'),
'cc' => $request->get('cc'),
'subject' => $request->get('subject'),
'dkim' => $request->get('dkim'),
'spf' => $request->get('spf'),
'envelope' => $request->get('envelope'),
'charsets' => $request->get('charsets'),
'spam_score' => $request->get('spam_score'),
'spam_report' => $request->get('spam_report'),
'attachments' => $request->get('attachments'),
'attachment-info' => $request->get('attachment-info'),
'attachmentX' => $request->get('attachmentX')
]);
return 'ok';
}
If I take a look at the Activity Feed, then I see this:
The error message is the following:
EMAIL: robin#rallypodium.be
REASON: error dialing remote address: dial tcp 104.24.101.114:25: i/o timeout
SMTP-ID: <1f7f313f27fd051b525581562e6af9b5#rallypodium.be>
PROCESSED STRING: August 1, 2016 - 06:53:45PM
MSGID: J1irmehmR_GELI7tIpPXNg.filter0810p1mdw1.1861.579F77CC27.0
oh and this is my cloudflare DNS: http://prntscr.com/c0bjl8
Can someone help me out?
Thanks!
You are essentially trying to receive email through CloudFlare, but unfortunately CloudFlare doesn't proxy SMTP/email traffic.
Instead you'll need to add a grey-clouded record to manage your email, this will allow your email to be routed straight to your origin without CloudFlare blocking it. Note that grey clouded domains can reveal your IP Address, it is therefore recommended to have your email server on a separate server to your webserver; or even better use a Cloud email provider and get emails from them.

curl + "Validation of viewstate MAC failed."

I using curl to post data to another server,
between each posting I use a function to fetch the hidden fields
like "__VIEWSTATE".
it worked like a charm before, but they updated there website,
so i rewriten my code to use the new fieldnams,
but on the last step i gets the error:
"Validation of viewstate MAC failed."
if I do the same step in a webbrowser it works as it should,
I used an addon to fetch what postdata the browser was sending
and compared it with what my script is sending,
and its looks the same.
My knowledge of ASP.NET is minimal,
and all info i can find here about the error
recomendates changes on the ASP-NET-server.
So i hope someone here can guide me to find out why
it in the browser have a 100% successrate,
and curl have 0% successrate on that page,
but using the same functions on previus pages,
works 100% with curl.
postdata the browser was sending:
__EVENTTARGET=
__EVENTARGUMENT=
__VIEWSTATE=%2FwEPDwUKLTk2MDAxNjU3MA9kFgJmD2QWAgIDD2QWDgIFD2QWAgIBDw8WAh4EVGV4dAUfRsO2cmV0YWdzZ3J1cHBlbiBpIEfDtnRlYm9yZyBBQmRkAgcPDxYEHwAFH0bDtnJldGFnc2dydXBwZW4gaSBHw7Z0ZWJvcmcgQUIeC05hdmlnYXRlVXJsBR1%2BL0NsaWVudENhcmQuYXNweD9DbGllbnRJRD05OGRkAgkPDxYCHgdWaXNpYmxlZ2RkAgsPDxYEHwAFI0JZR0cgJiBFTkVSR0lTRVJWSUNFIFPDlkRFUlTDllJOIEFCHwEFNH4vQ3VzdG9tZXJPdmVydmlldy5hc3B4P0NsaWVudElEPTk4JkN1c3RvbWVySUQ9MjY0NDBkZAINDw8WAh8CZ2RkAg8PDxYCHwAFE1JlZGlnZXJhIGFudsOkbmRhcmVkZAIVDw8WAh8CaGQWAgIDDxBkZBYBZmQYAgUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFg0FFmN0bDAwJGJvZHkkY2hrSXNBY3RpdmUFHmN0bDAwJGJvZHkkY2hrSGFzU3VwZXJVc2VyUGVybQUfY3RsMDAkYm9keSRjaGtIYXNTdGF0aXN0aWNzUGVybQUkY3RsMDAkYm9keSRjaGtIYXNBbm51YWxSZXBvcnRTZXJ2aWNlBTBjdGwwMCRib2R5JGNoa0hhc0NvcnBvcmF0aW9uQ2hhcnRlclJlcG9ydFNlcnZpY2UFN2N0bDAwJGJvZHkkY2hrSGFzQ2VydGlmaWNhdGVPZlJlZ2lzdHJhdGlvblJlcG9ydFNlcnZpY2UFH2N0bDAwJGJvZHkkY2hrSGFzTW9uaXRvclNlcnZpY2UFK2N0bDAwJGJvZHkkY2hrSGFzRGlnaXRhbFNwYXJya2F0YWxvZ1NlcnZpY2UFJmN0bDAwJGJvZHkkY2hrSGFzUGVyc29ua29udHJvbGxTZXJ2aWNlBSVjdGwwMCRib2R5JGNoa0hhc0NvbXBhbnlSZXBvcnRTZXJ2aWNlBSRjdGwwMCRib2R5JGNoa0hhc1BlcnNvblJlcG9ydFNlcnZpY2UFHWN0bDAwJGJvZHkkY2J4UmVwb3J0c0NvbXBhbnkzBRxjdGwwMCRib2R5JGNieFJlcG9ydHNQZXJzb24zBRBjdGwwMCRtbHRDb250ZW50Dw9kZmR8z6SDM7weB%2BgWrg%2B8u3EnNPkQGA%3D%3D
__EVENTVALIDATION=%2FwEWFwKGsKOJCgK70ZWTDQLr%2BJWFDQKo1a2oCwKplfT%2BCgLRieqTAwKt6qHvAQK9rKu9AgKh%2F5ODDQKqtpTtDQLvv7CxBALa4vDGBQKCuafwDwKP1ZOjBgKsqdXxCgL6hbmQBwK%2BjaGZDQL%2FqY7cBALml%2FqcBgLYg53pDwL108DhBQLfzPnCAQLBr6dM9cK5UIsGFZ5ocJchTM8CHTFigfk%3D
ctl00%24body%24cmdSave=Spara
ctl00%24body%24txtName=BYGG+%26+ENERGISERVICE+S%C3%96DERT%C3%96RN+AB
ctl00%24body%24txtUserName=5566960836
ctl00%24body%24txtEmail=anonym%40telia.se
ctl00%24body%24txtDepartment=
ctl00%24body%24chkIsActive=on
ctl00%24body%24chkHasStatisticsPerm=on
ctl00%24body%24txtLoginName=5566960836
ctl00%24body%24txtPassword=stackoverflow
ctl00%24body%24chkHasAnnualReportService=on
ctl00%24body%24chkHasCorporationCharterReportService=on
ctl00%24body%24chkHasCertificateOfRegistrationReportService=on
ctl00%24body%24chkHasMonitorService=on
ctl00%24body%24chkHasDigitalSparrkatalogService=on
ctl00%24body%24chkHasPersonkontrollService=on
ctl00%24body%24chkHasCompanyReportService=on
ctl00%24body%24chkHasPersonReportService=on
ctl00%24body%24cbxReportsCompany3=on
ctl00%24body%24cbxReportsPerson3=on
ctl00%24body%24hidNewUser=1
the post data my script is sending
Array
(
[__EVENTTARGET] =>
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vbXBhbnlSZXBvcnRTZXJ2aWNlBSRjdGwwMCRib2R5JGNoa0hhc1BlcnNvblJlcG9ydFNlcnZpY2UFHWN0bDAwJGJvZHkkY2J4UmVwb3J0c0NvbXBhbnkzBRxjdGwwMCRib2R5JGNieFJlcG9ydHNQZXJzb24zBRBjdGwwMCRtbHRDb250ZW50Dw9kZmR8z6SDM7weB+gWrg+8u3EnNPkQGA==
[__EVENTVALIDATION] => /wEWFwKGsKOJCgK70ZWTDQLr+JWFDQKo1a2oCwKplfT+CgLRieqTAwKt6qHvAQK9rKu9AgKh/5ODDQKqtpTtDQLvv7CxBALa4vDGBQKCuafwDwKP1ZOjBgKsqdXxCgL6hbmQBwK+jaGZDQL/qY7cBALml/qcBgLYg53pDwL108DhBQLfzPnCAQLBr6dM9cK5UIsGFZ5ocJchTM8CHTFigfk=
[ctl00$body$hidNewUser] => 1
[ctl00$body$cmdSave] => Spara
[ctl00$body$txtName] => BYGG & ENERGISERVICE SÖDERTÖRN AB
[ctl00$body$txtUserName] => 5566960836
[ctl00$body$txtEmail] => anonym#telia.se
[ctl00$body$txtDepartment] =>
[ctl00$body$chkIsActive] => 1
[ctl00$body$chkHasStatisticsPerm] => 1
[ctl00$body$txtLoginName] => 5566960836
[ctl00$body$txtPassword] => stackoverflow
[ctl00$body$chkHasAnnualReportService] => 1
[ctl00$body$chkHasCorporationCharterReportService] => 1
[ctl00$body$chkHasCertificateOfRegistrationReportService] => 1
[ctl00$body$chkHasMonitorService] => 1
[ctl00$body$chkHasDigitalSparrkatalogService] => 1
[ctl00$body$chkHasPersonkontrollService] => 1
[ctl00$body$chkHasCompanyReportService] => 1
[ctl00$body$chkHasPersonReportService] => 1
[ctl00$body$cbxReportsCompany3] => 1
[ctl00$body$cbxReportsPerson3] => 1
)
The question:
What client side differences can trigger the "Validation of viewstate MAC failed"-error?
(notice: the postdata above have bean manipulated in 2 ways, first i replaced the password with "stackoverflow", and i also replace the user of email adress with anonym)
Check so see if there's not some javascript changing the values before they're posted, and to be on the save side, set the referrer page too.
used the wrong URL, sent the right postdata from start, just sent it to the wrong place.
so simple, and still so hard to find when you look at the wrong place.

OpenID check_authentication not working

Merged with OpenID check_authentication not working.
I'm trying to write my own provider in PHP (JanRain libraries are confusing as all hell, and even phpMyID doesn't document exactly what is happening). I've got authentication working, but when the relying party tries to do check_authentication, it says my server denied it.
This is debugging information I captured during a check_authentication request.
$_GET:
Array
(
[mode] => profile
[username] => jrhodes
[domain] => roket-enterprises.com
)
$_POST:
Array
(
[openid_assoc_handle] => {HMAC-SHA1}{4abdf2f1}{olw8ag==}
[openid_identity] => http://www.roket-enterprises.com/openaccount/openid:jrhodes
[openid_mode] => check_authentication
[openid_response_nonce] => 2009-09-26T10:54:41ZLg0kfQ
[openid_return_to] => http://www.wasab.dk/morten/2007/11/openid/?janrain_nonce=2009-09-26T10%3A54%3A37Z9rZCkP&openid1_claimed_id=http%3A%2F%2Fwww.roket-enterprises.com%2Fopenaccount%2Fopenid%3Ajrhodes
[openid_sig] => Xl94j3IJtfSEQ4oKfova68I8edc=
[openid_signed] => assoc_handle,identity,mode,response_nonce,return_to,signed,sreg.email,sreg.fullname,sreg.nickname
[openid_sreg_email] => jrhodes#roket-enterprises.com
[openid_sreg_fullname] => James Rhodes
[openid_sreg_nickname] => jrhodes
)
Using Specific Mode Endpoint Handler...
Answering check_authentication
Headers:
Content-Type: text/plain;
openid.mode: id_res;
openid_mode: id_res;
sreg.fullname: James Rhodes;
sreg.nickname: jrhodes;
sreg.email: jrhodes#roket-enterprises.com;
is_valid: true;
The GET and POST data is the data that my script is receiving. Everything after "Headers:" are the headers that my script is returning. According to the specifications, I can't see anything wrong with this.
I've been asking on #openid for the last 4 hours and haven't got a response (note to self: post on StackOverflow, then ask IRC). Can anyone help?

Categories