Magento/exim emails not arriving, sent to and from own domain - magento

We have an interesting problem related to Exim. We use Magento.
Emails are being sent by our server to customers and we have the send copy by separate or bcc in backend. We use Google apps MX.
But the email never arrives. If the email is sent to a different email address or domain then it arrives. And if it is the same account:
sent from: info#domain.com
to: customer#house.com
bcc: info#domain.com
the emails don't arrive # info#domain.com
Question: what can this be? I have the idea that exim is not sending the email with info#domain.com to the Google apps MX server for sending
ps. I already read this, but that is OK and not the problem http://inchoo.net/ecommerce/magento/fight-spam-emails/comment-page-1/#comment-53370
Major thanks
UPDATE ADDED MAILLOG
2013-07-23 19:55:29 1V1go5-00034h-8G <= domain#domain.com U=domain
P=local S=10216 T="Uw bestelling is vandaag verzonden" from
for rgoossSNIPPED#gmail.com contact#domain.com
2013-07-23 19:55:29 1V1go5-00034h-8G => contact#domain.com
F= R=lookuphost T=remote_smtp S=10281
H=ASPMX.L.GOOGLE.com [2a00:1450:4013:c01::1a] X=TLSv1:RC4-SHA:128
C="250 2.0.0 OK 1374602129 r42si29746715eep.2 - gsmtp" 2013-07-23
19:55:30 1V1go5-00034h-8G => rgoossSNIPPED#gmail.com
F= R=lookuphost T=remote_smtp S=10281
H=gmail-smtp-in.l.google.com [2a00:1450:4013:c01::1a]
X=TLSv1:RC4-SHA:128 C="250 2.0.0 OK 1374602130 x6si29680305eew.317 -
gsmtp" 2013-07-23 19:55:30 1V1go5-00034h-8G Completed
2013-07-24 10:29:09 1V1uRZ-0005yg-PX <= domain#domain.com U=domain
P=local S=10056 T="Uw bestelling is geplaatst en wordt verwerkt" from
for SNIPPED#loyenslo-eff.com
contact#domain.com 2013-07-24 10:29:10 1V1uRZ-0005yg-PX =>
contact#domain.com F= R=lookuphost T=remote_smtp
S=10120 H=ASPMX.L.GOOGLE.com [2a00:1450:4013:c00::1b]
X=TLSv1:RC4-SHA:128 C="250 2.0.0 OK 1374654550 z6si31979271eel.292 -
gsmtp" 2013-07-24 10:29:10 1V1uRZ-0005yg-PX =>
SNIPPED#loyenslo-eff.com F= R=lookuphost
T=remote_smtp S=10120 H=mail.loyenslo-eff.com [62.132.204.200] C="250
ok: Message 36327691 accepted" 2013-07-24 10:29:10 1V1uRZ-0005yg-PX
Completed
And I updated some settings. This is what I am seeing:
2013-07-29 14:40:11 1V3mkF-0004vN-Jf <= info#mywebstore.com U=shirts350 P=local S=11736 T="Uw bestelling is geplaatst en wordt verwerkt" from <info#mywebstore.com> for info#mywebstore.com
2013-07-29 14:40:12 1V3mkF-0004vN-Jf => info#mywebstore.com F=<info#mywebstore.com> R=lookuphost T=remote_smtp S=11810 H=ASPMX.L.GOOGLE.com [2a00:1450:4013:c01::1a] X=TLSv1:RC4-SHA:128 C="250 2.0.0 OK 1375101612 3si5304843eej.103 - gsmtp"
2013-07-29 14:40:12 1V3mkF-0004vN-Jf Completed
2013-07-29 14:40:12 1V3mkG-0004vS-1k <= info#mywebstore.com U=shirts350 P=local S=11740 T="Uw bestelling is geplaatst en wordt verwerkt" from <info#mywebstore.com> for mytestemail#gmail.com
2013-07-29 14:40:12 1V3mkG-0004vS-1k => mytestemail#gmail.com F=<info#mywebstore.com> R=lookuphost T=remote_smtp S=11814 H=gmail-smtp-in.l.google.com [2a00:1450:4013:c00::1b] X=TLSv1:RC4-SHA:128 C="250 2.0.0 OK 1375101612 e5si53052514eeg.102 - gsmtp"
2013-07-29 14:40:12 1V3mkG-0004vS-1k Completed

I changed the exim.conf file but this is not The solution. Email from and to The Same domain. And from and to The Same email ard not sent
As I understand it:
The code below looks at local_domains to see of the email is for here, or the outside world. As our email is not handled by the local mail server, but rather google local domains should also be routed via smtp
this line excludes local domains from smtp
domains = ! +local_domains
so we uncommented it
thx
# This router routes to remote hosts over SMTP using a DNS lookup. Any domain
# that resolves to an IP address on the loopback interface (127.0.0.0/8) is
# treated as if it had no DNS entry.
lookuphost:
driver = dnslookup
# domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
transport = remote_smtp
no_more

I've run into this same problem and this is how I solved it. Instead of changing lookuphost like the other answer, I added another router
In the routers section of my exim conf after the lookuphost router, I added
routetogoogle:
driver = manualroute
route_list = mydomain.com
transport = remote_smtp
This manually forces anything going to mydomain.com to use the remote_smtp transport which will look up the correct MX records. Subtle difference from changing lookuphost - but this will allow you to still deliver mail locally for other domains if needed.

I have a magento running in an EC2 instance and for email hosting I am using bluehost, I solve this by setting "Set Return Path" to Yes in System->Configuration->Advanced->System->Mail Sending Settings

Related

Asterisk: PJSIP_HEADER and Websocket

I need to add custom header when calling the client's webrtc. Used by asterisk 13 + siphtml5.
Dialplan:
exten => 198,1,Answer()
same => n,Set(PJSIP_HEADER(add,X-DRP)=71234567890)
same => n,DIAL(PJSIP/${EXTEN})
Asterisk log:
Connected to Asterisk 13.17.2 currently running on ubuntu-xenial (pid = 8895)
== WebSocket connection from '192.168.0.44:58096' forcefully closed due to fatal write error
== WebSocket connection from '192.168.0.44:58595' for protocol 'sip' accepted using version '13'
-- Added contact 'sip:a9gn89sg#192.168.0.44:58595;transport=ws' to AOR '199' with expiration of 450 seconds
== Contact 199/sip:a9gn89sg#192.168.0.44:58595;transport=ws has been created
== Contact 199/sip:3qogi2fo#192.168.0.44:58096;transport=ws has been deleted
-- Contact 199/sip:a9gn89sg#192.168.0.44:58595;transport=ws is now Unknown. RTT: 0.000 msec
== Setting global variable 'SIPDOMAIN' to 'aster13'
== DTLS ECDH initialized (automatic), faster PFS enabled
-- Executing [198#default:1] Answer("PJSIP/199-00000008", "") in new stack
> 0x7f0ea0071960 -- Strict RTP learning after remote address set to: 123.135.239.111:58827
[Oct 23 16:02:31] ERROR[8943]: pjproject:0 <?>: icess0x7f0ea000ce18 ..Error sending STUN request: Network is unreachable
[Oct 23 16:02:31] ERROR[8943]: pjproject:0 <?>: icess0x7f0ea000ce18 ..Error sending STUN request: Network is unreachable
> 0x7f0ea0071960 -- Strict RTP learning after ICE completion
> 0x7f0ea0071960 -- Strict RTP switching to RTP target address 192.168.100.97:58827 as source
-- Executing [198#default:2] SIPAddHeader("PJSIP/199-00000008", "X-DRP: 79161234567") in new stack
-- Executing [198#default:3] Set("PJSIP/199-00000008", "PJSIP_HEADER(add,X-DRP)=79161234567") in new stack
-- Executing [198#default:4] Verbose("PJSIP/199-00000008", "Set(OldContact="199" <sips:199#192.168.100.97:54514;transport=ws;rtcweb-breaker=no;click2call=no>;+g.oma.sip-im;language="en,fr")") in new stack
Set(OldContact=199 <sips:199#192.168.100.97:54514;transport=ws;rtcweb-breaker=no;click2call=no>;+g.oma.sip-im;language=en,fr)
-- Executing [198#default:5] Dial("PJSIP/199-00000008", "PJSIP/198") in new stack
-- Called PJSIP/198
-- PJSIP/199-00000008 requested media update control 26, passing it to PJSIP/198-00000009
== DTLS ECDH initialized (automatic), faster PFS enabled
-- PJSIP/198-00000009 is ringing
> 0x7f0ea0071960 -- Strict RTP learning complete - Locking on source address 192.168.100.97:58827
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [198#default:7] Hangup("PJSIP/199-00000008", "") in new stack
== Spawn extension (default, 198, 7) exited non-zero on 'PJSIP/199-00000008'
-- Added contact 'sips:199#192.168.100.97:54514;transport=ws;rtcweb-breaker=no' to AOR '199' with expiration of 200 seconds
== Contact 199/sips:199#192.168.100.97:54514;transport=ws;rtcweb-breaker=no has been created
== Contact 199/sip:a9gn89sg#192.168.0.44:58595;transport=ws has been deleted
-- Contact 199/sips:199#192.168.100.97:54514;transport=ws;rtcweb-breaker=no is now Unknown. RTT: 0.000 msec
And I can't find header X-DRP in debug log of my browser:
recv=INVITE sips:198#192.168.100.97:54445;transport=ws;rtcweb-breaker=no SIP/2.0
Via: SIP/2.0/WSS 192.168.100.97:54445;rport;branch=z9hG4bKPja4ca4b5b-62c2-4953-a761-d13d34696007;alias
From: "199"<sip:199#ubuntu-xenial>;tag=a1b0c71d-f89b-4226-a84e-82e7db8b2b21
To: <sips:198#192.168.100.97;rtcweb-breaker=no>
Contact: <sips:asterisk#ubuntu-xenial:5060;transport=ws>
Call-ID: a47911b2-c6d4-4222-961b-f0418a4e00c0
CSeq: 30108 INVITE
Content-Type: application/sdp
Content-Length: 1085
Allow: OPTIONS,SUBSCRIBE,NOTIFY,PUBLISH,INVITE,ACK,BYE,CANCEL,UPDATE,PRACK,REGISTER,MESSAGE,REFER
Supported: 100rel,timer,replaces,norefersub
Session-Expires: 1800;refresher=uac
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 13.17.2
v=0
o=- 780155122 780155122 IN IP4 192.168.49.32
s=Asterisk
c=IN IP4 192.168.49.32
t=0 0
m=audio 15018 UDP/TLS/RTP/SAVPF 0 101
a=connection:new
a=setup:actpass
a=fingerprint:SHA-256 AA:94:9A:8F:24:9A:BD:C2:6B:BA:57:4D:E2:D3:1F:1E:B1:F9:87:B1:96:C7:29:93:B8:75:16:D6:73:9D:1E:3E
a=ice-ufrag:3e3de33532c2fcdc32d71b2f086be032
a=ice-pwd:78e4b4b93a861933107a205a10cac6dd
a=candidate:Hc92a8000 1 UDP 2130706431 fe80::14:68ff:fe3e:8447 15018 typ host
a=candidate:H6893915f 1 UDP 2130706431 fe80::a00:27ff:feeb:a9e 15018 typ host
a=candidate:Ha00020f 1 UDP 2130706431 10.0.2.15 15018 typ host
a=candidate:Hc0a83120 1 UDP 2130706431 192.168.49.32 15018 typ host
a=candidate:Hc92a8000 2 UDP 2130706430 fe80::14:68ff:fe3e:8447 15019 typ host
a=candidate:H6893915f 2 UDP 2130706430 fe80::a00:27ff:feeb:a9e 15019 typ host
a=candidate:Ha00020f 2 UDP 2130706430 10.0.2.15 15019 typ host
a=candidate:Hc0a83120 2 UDP 2130706430 192.168.49.32 15019 typ host
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
a=rtcp-mux
Is PJSIP supports PJSIP_HEADER for WebSocket? Is there any other way to add custom header to INVOTE for webrtc client?
I use asterisk 13, and siphtml5 web client. Also I check wss traffic with wireshark, decrypt it and still can't find X-DRP header.
In asterisk set header using:
same => n,SIPAddHeader(HEADERNAME: ${SOMEVAR})
You need use a more updated library like jsSip in client. In this case you cant get the server header like this:
phone.on('newRTCSession', function(e){
if (e.originator == 'remote') {
console.log(e.request.headers);
}
});

Can't use RubyPress gem gives getaddrinfo: No such host is known. (SocketError)

I am trying to use a gem called RubyPress which allows to use Wordpress' xml-rpc api from ruby. But it always gives me this error:
getaddrinfo: No such host is known. (SocketError)
Here's my code:
require 'rubypress'
wp = Rubypress::Client.new(:host => "localhost/wordpress",
:username => "admin",
:password => "admin")
p wp.getOptions
I am able to connect fine using another gem called wp_rpc but rubypress doesn't seem to work. Rubypress seems to be maintained so i want to use it, it also seems to have more features.
Also, even when i try connecting to a real site, it gives a 403 error which is very strange.
I am running the server using XAMPP on Windows 7. How can I get it to work?
UPDATE:
Here's the code i used for posting, now it doesn't seem to post. Not sure where i went wrong.
wp.newPost( :blog_id => 0, # 0 unless using WP Multi-Site, then use the blog id
:content => {
:post_status => "publish",
:post_date => Time.now,
:post_content => "This is the body",
:post_title => "RubyPress is the best!",
:post_name => "/rubypress-is-the-best",
:post_author => 1, # 1 if there is only the admin user, otherwise the user's id
:terms_names => {
:category => ['Category One','Category Two','Category Three'],
:post_tag => ['Tag One','Tag Two', 'Tag Three']
}
}
)
Note: This is from the rubypress github page. Those categories and tags are not present on the blog, is that the reason?
host must be a host name (e.g. "localhost" in this particular case, or, say, "google.com"):
require 'rubypress'
wp = Rubypress::Client.new(host: "localhost",
username: "admin",
password: "admin",
path: "/wordpress/xmlrpc.php")
Probably, you might need to tune the path parameter up to point exactly to where WP’s RPC endpoint is to be found.

Ebay Australia Site ID invalid on Trading API (Modified EbayR)

Every time I try and publish a product with AddFixedPriceItem with the Site ID set to Australia (15) I get the error response:
:errors=>{:short_message=>"Input data is invalid.", :long_message=>"Input data for tag is invalid or missing. Please check API documentation."
I tried every variation of the site ID ("AU", "Australia", 15, "15") and when i switch it to the US site ID (0) everything works perfectly. Is there something that I'm doing wrong?
Im using my own customised version of EbayR (because it didn't parse the xml correctly)
Anyway here is the full raw SOAP request:
Headers:
{
'X-EBAY-API-COMPATIBILITY-LEVEL' => #compatability_level.to_s, # => 837
'X-EBAY-API-DEV-NAME' => dev_id.to_s,
'X-EBAY-API-APP-NAME' => app_id.to_s,
'X-EBAY-API-CERT-NAME' => cert_id.to_s,
'X-EBAY-API-CALL-NAME' => #command.to_s,
'X-EBAY-API-SITEID' => #site_id.to_s, # => which is 15
'Content-Type' => 'text/xml'
}
the full body request is:
<AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>....</eBayAuthToken>
</RequesterCredentials>
<Item>
<Title>dssddsheykduhfid</Title>
<ListingDuration>GTC</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<Description>This is another test description with image</Description>
<PrimaryCategory>
<CategoryID>57989</CategoryID>
</PrimaryCategory>
<SKU>dfiuhdssdsdfggfmeesddffdeseddfda</SKU>
<InventoryTrackingMethod>SKU</InventoryTrackingMethod>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>payments-facilitator#logicsaas.com</PayPalEmailAddress>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<ConditionID>1000</ConditionID>
<Country>AU</Country>
<Currency>AUD</Currency>
<DispatchTimeMax>4</DispatchTimeMax>
<PostalCode>3194</PostalCode>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>MoneyBack</RefundOption>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<Description>What! you dont want the product! .... ok</Description>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<PictureDetails>
<PictureURL>http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg</PictureURL>
</PictureDetails>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>AU_eBayAusPost3kgFlatRateSatchel</ShippingService>
<ShippingServiceCost>10</ShippingServiceCost>
</ShippingServiceOptions>
</ShippingDetails>
<Site>15</Site>
<Variations>
<VariationSpecificsSet>
<NameValueList>
<Name>Size</Name>
<Value>L</Value>
<Value>S</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Red</Value>
<Value>Blue</Value>
</NameValueList>
</VariationSpecificsSet>
<Variation>
<SKU>dfiuhdssdsdfggfmeesddffdeseddfdaOMG454fgfgfg</SKU>
<StartPrice>100.99</StartPrice>
<Quantity>1</Quantity>
<VariationSpecifics>
<NameValueList>
<Name>Size</Name>
<Value>L</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Red</Value>
</NameValueList>
</VariationSpecifics>
</Variation>
<Variation>
<SKU>dfiuhdssdsdfggfmeesddffdeseddfdaOMG432325fgfgfg</SKU>
<StartPrice>100.99</StartPrice>
<Quantity>16</Quantity>
<VariationSpecifics>
<NameValueList>
<Name>Size</Name>
<Value>L</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Blue</Value>
</NameValueList>
</VariationSpecifics>
</Variation>
</Variations>
</Item>
Also I bit the bullet and payed the 75 dollars for technical support, If I don't get a response here I'll paste the response from them for all to see.
Cool, so it seems like this was an ebay issue. They are trying to fix it at the moment. But they responded with a work around:
Hello Avin ,
Thank you for reporting this issue. I can reproduce the problem and I have forwarded this to our engineering team for further investigation. We will keep the ticket open in "Waiting-BugFix" status.
Actually SiteID is not a mandatory field. SiteID will be taken from the header if you don&apos;t pass it. As a workaround, please omit the field and continue listing.
Please let me know if you have any questions.
Best Regards,
eBay Developer Support

ruby IMAP STARTTLS means automatically disconnected?

I am trying to write a simple IMAP client, that connects to an IMAP server, which enforces STARTTLS.
When i execute the command STARTTLS, the server connection is dropped. The documentation for STARTTLS on the other hand is a bit thin to know exactly, what the problem is.
The anonymized commands:
1.9.2-p320-railsexpress :001 > require 'net/imap'
=> nil
1.9.2-p320-railsexpress :002 > imap = Net::IMAP.new('SOME_HOST', 143, false)
=> #<Net::IMAP:0x0000000ba43138 #mon_owner=nil, #mon_count=0, #mon_mutex=#<Mutex:0x0000000ba430e8>, #host="SOME_HOST", #port=143, #tag_prefix="RUBY", #tagno=0, #parser=#<Net::IMAP::ResponseParser:0x0000000ba42be8 #str="* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS LOGINDISABLED] Dovecot ready.\r\n", #pos=110, #lex_state=:EXPR_BEG, #token=nil, #flag_symbols={}>, #sock=#<TCPSocket:fd 9>, #usessl=false, #responses={}, #tagged_responses={}, #response_handlers=[], #tagged_response_arrival=#<MonitorMixin::ConditionVariable:0x0000000ba42ad0 #monitor=#<Net::IMAP:0x0000000ba43138 ...>, #cond=#<ConditionVariable:0x0000000ba42aa8 #waiters=[], #waiters_mutex=#<Mutex:0x0000000ba42a58>>>, #continuation_request_arrival=#<MonitorMixin::ConditionVariable:0x0000000ba42a30 #monitor=#<Net::IMAP:0x0000000ba43138 ...>, #cond=#<ConditionVariable:0x0000000ba42a08 #waiters=[], #waiters_mutex=#<Mutex:0x0000000ba429b8>>>, #idle_done_cond=nil, #logout_command_tag=nil, #debug_output_bol=true, #exception=nil, #greeting=#<struct Net::IMAP::UntaggedResponse name="OK", data=#<struct Net::IMAP::ResponseText code=#<struct Net::IMAP::ResponseCode name="CAPABILITY", data="IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS LOGINDISABLED">, text=" Dovecot ready.">, raw_data="* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS LOGINDISABLED] Dovecot ready.\r\n">, #client_thread=#<Thread:0x007f416ed31420 run>, #receiver_thread=#<Thread:0x0000000ba41b58 run>>
1.9.2-p320-railsexpress :004 > imap.starttls
=> #<struct Net::IMAP::TaggedResponse tag="RUBY0001", name="OK", data=#<struct Net::IMAP::ResponseText code=nil, text="Begin TLS negotiation now.">, raw_data="RUBY0001 OK Begin TLS negotiation now.\r\n">
1.9.2-p320-railsexpress :006 > imap.disconnected?
=> true
I get the same behaviour in 2.0.0-p353-railsexpress.
Is this the correct behaviour and if so, how to correctly use ruby with an STARTTLS IMAP server?
thanks and regards!
Both client and server are working correctly up to the point where the client is supposed to start TLS negotiation. After that point the IMAP layer doesn't know what happens. You're going to enable TLS debug logging somewhere or sniff the network packets to make further progress.

What are all the tld's recognized by NSDataDetector?

When testing Cocoa data detector I found that forecast.io isn't picked up but www.forecast.io and forecast.com are.
What are all the top level domains found by NSDataDetector without prefixing them with www.?
I wrote about how to pick an Apple friendly TLD and my findings are recounted below.
I just took the text file from ICANN and prepended all the extensions with 'example.' and the only ones detected at least in my locale(US) were these:
Uppercase:
example.com
example.EDU
example.EU
example.GOV
example.LY
example.NET
example.ORG
Lowercase:
example.ar
example.at
example.au
example.be
example.br
example.ca
example.ch
example.cn
example.de
example.dk
example.edu
example.es
example.eu
example.fi
example.fr
example.gov
example.gr
example.hk
example.hu
example.il
example.is
example.it
example.jp
example.kr
example.lu
example.ly
example.ma
example.mx
example.net
example.nl
example.no
example.nz
example.org
example.pt
example.ru
example.se
example.sg
example.th
example.tn
example.tr
example.tw
example.ua
example.uk
example.us
From my own testing, it looks like anything with www. on the front will be detected.
As an update to Steve's answer, here are the lowercased tld's that were detected for me, as of Nov 1, 2016:
example.ar
example.at
example.au
example.cc
example.ch
example.cn
example.co
example.com
example.de
example.dk
example.edu
example.es
example.eu
example.fi
example.fm
example.fr
example.gov
example.gr
example.hk
example.hr
example.hu
example.ie
example.il
example.info
example.io
example.is
example.it
example.kr
example.lu
example.ly
example.ma
example.me
example.mx
example.net
example.nl
example.no
example.nz
example.org
example.pt
example.pw
example.rs
example.ru
example.se
example.sg
example.si
example.th
example.tn
example.tr
example.tw
example.ua
example.uk
example.us

Resources