+ Start a Discussion
yuichicyuichic 

Unable to process inbound emails with apex code

Hello.

I'm trying to process inbound emails with apex code.
I generated Email Services Domain, and made very simple apex class. (api version is 11.1)

global class MailTest {
        Webservice static Messaging.InboundEmailResult test(Messaging.InboundEmail email) {
            Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
            result.success = true;
            return result;
        }
}

I sent emails to the generated email address from my company's mail server and gmail, but these emails returned with error.
The content of returned email is

-------------------------------------------------

This message was created automatically by the mail system (ecelerity).

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

>>> MailTest.test@(generated domain).in.salesforce.com (reading confirmation): 554 Not a valid address

------ This is a copy of the original message, including all headers. ------

Return-Path: <(my email address)>
Authentication-Results: mx4-sjl.mta.salesforce.com smtp.mail=(my email address); spf=pass; sender-id=pass
Authentication-Results: mx4-sjl.mta.salesforce.com header.from=(my email address); sender-id=pass; domainkeys=good
X-SFDC-DOMAINKEYS: Pass
DomainKey-Status: good
X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01
Received-SPF: pass (mx4-sjl.mta.salesforce.com: domain gmail.com designates 64.233.182.191 as permitted sender)
X-SFDC-TLS-VERIFIED: no
X-SFDC-TLS-CIPHER: None
X-SFDC-TLS-STATUS: false
X-SFDC-SENDERID-PRA: Pass
X-SFDC-SENDERID: Pass
X-SFDC-SPF: Pass
X-SFDC-Interface: external
...

-------------------------------------------------

Any ideas on cause of this problem?
yuichicyuichic
I see.
I'll try again after the spring release.

Thanks.
Rasmus MenckeRasmus Mencke
We have made a number changes in the Spring '08 release, both to the signature and security settings.

You can see sample code of how the new signature looks here

http://wiki.apexdevnet.com/index.php/Force.com_Email_Services

http://wiki.apexdevnet.com/index.php/Force.com_Email_Services


Message Edited by Rasmus Mencke on 02-08-2008 08:29 AM
yuichicyuichic
I could process inbound emails using new version of API.
Thank you very much!!