MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Overriding the mail From address  (Mono Support )

Viewed 9199 time(s), 9 post(s) 10/9/2012 1:07:23 PMby DanC
DanC

DanC

10/9/2012 1:07:23 PM
I have tried to override the from address when sending messages (and including an emai sent to the recipient). No matter what I do the email always arrives with the sender's registered email address as the From address. I am using this we config key (also set by the portal administration settings):

<add key="MailFromAddress" value=noreply@fusedev.altacontact.co.uk/>

Any idea why I am not able to overrride? Does this key only allow you to overrid certain email notification message? Does it have no effect on the messaging functionality? Do I need the code to be able to make the change programmatically?

Many thanks,
This content has not been rated yet. 
85 Reputation 9 Total posts
denis

denis

10/9/2012 4:24:14 PM
This value is used when sending various system notification messages, but is not used for every mail message sent from MonoX. For example, there is no sense in using it in the messaging system, where two users are communicating with each other: the e-mail address of the user that is sending the message is used instead. Which Web part(s) are you trying to modify?
This content has not been rated yet. 
7207 Reputation 956 Total posts
DanC

DanC

10/9/2012 4:33:42 PM
Hi Denis,

Thanks for responding. It is in the messaging webpart that we particularly want to override the from address. We are finding that some emails are not getting through as the IP address of the SMTP server may not match the SPF record held for that domain - at least that's what we are thinking. Some emails are being received and some aren't. If we can standardise the from address we can at least rule out that option.
This content has not been rated yet. 
85 Reputation 9 Total posts
denis

denis

10/9/2012 4:45:37 PM
I would first look in the MonoX log files (MonoX/ApplicationData/Logs) and SMTP server logs.
It could be difficult to change the behavior of that particular Web part (MessageCreate.ascx), as it takes care of multiple scenarios (sending messages to user groups and messaging lists, etc.). There is the OnMessageSending event that holds the SnMessage entity that in turn could be used to implement your own logic and/or cancel the existing logic, but let's try to find errors in the log files first.
This content has not been rated yet. 
7207 Reputation 956 Total posts
DanC

DanC

10/11/2012 10:36:50 PM
Hi Denis,
The log files don't report an error, and I wouldn't expect them too. I believe the emai is being sent out but rejected further down the process.Is it possible that the recipient's email provider is checking the domain in the from address and our sending server IP address and being rejected because of an SPF record? Could that be happening? Isn't this called spoofing - where we are sending an email address using a registeres user's email address (for example phil@bbc.co.uk) but our server's IP address isn't listed as a recognised server to be sending on behalf of the bbc.co.uk domain?
If this is right, how can we assure that an emailthat is sent out from our server using the register user who sent the message's email address will actually arrive. Currently we are experiencing a less than 100% success rate with outgoing email and we think it is because of this reason. What we need to be able to do is override the from email address for every outgoing email, but we don't have the code and I assume the Mail namespace is unavailble for us to make changes.
If we are right it would seem core functionality is not working correctly.

This content has not been rated yet. 
85 Reputation 9 Total posts
denis

denis

10/12/2012 12:47:32 PM
We can easily add this feature to the next upgrade, which will be available until the end of the month. Without the source code, it would be a more difficult task. Would this be satisfactory?
This content has not been rated yet. 
7207 Reputation 956 Total posts
GeorgeBirbilis10

GeorgeBirbilis10

10/16/2012 9:55:04 AM
btw, could try sending the same e-mail programmatically (or by hand) from the server and select to get a delivery receipt to see what happens to it on the way
This content has not been rated yet. 
0 Reputation 2 Total posts
DanC

DanC

10/16/2012 10:15:07 AM
Hi George,

You would think the NDR would be helpful, wouldn't you!
Here it is in all it's ambiguous glory:
Delivery has failed to these recipients or distribution lists:
john.samuel@altacontact.co.uk

An error occurred while trying to deliver this message to the recipient's e-mail address. Microsoft Exchange will not try to redeliver this message for you. Please try resending this message, or provide the following diagnostic text to your system administrator.

Diagnostic information for administrators:
Generating server: fusedev.altacontact.co.uk
john.samuel@altacontact.co.uk
#< #5.0.0> #SMTP#
Original message headers:
Received: from mail pickup service by fusedev.altacontact.co.uk with Microsoft
SMTPSVC;
Tue, 9 Oct 2012 21:38:04 +0100

MIME-Version: 1.0

From: <dan@ittium.com>

To: <john.samuel@altacontact.co.uk>

Date: Tue, 9 Oct 2012 21:38:04 +0100

Subject: Test

Content-Type: text/plain; charset="us-ascii"

Content-Transfer-Encoding: quoted-printable

Message-ID: <ALTA-DEV-SERVERbYiM00000585@fusedev.altacontact.co.uk>

X-OriginalArrivalTime: 09 Oct 2012 20:38:04.0952 (UTC) FILETIME=[FBC12180:01CDA65D]
This content has not been rated yet. 
85 Reputation 9 Total posts
DanC

DanC

10/16/2012 10:15:51 AM
Hi Denis,

Having that functionality in the next release would help a great deal!
Thanks for offering the solution to our problem!

Dan.
This content has not been rated yet. 
85 Reputation 9 Total posts