Ant Mail-Task - X-Auto-Response-Suppress header - email

I got some old jobs which are sending mails via an Ant Mail Task (Ant 1.7.1) using the JavaMail Library (JavaMail 1.5.0). Now the sender shouldn't receive any automated response mails.
For some reasons the Reply-To header is ignored by the Exchange Server / Outlook and I don't know if / how I can set the Return-Path header in the Ant Task.
So the easiest way would be to just set the X-Auto-Response-Suppress: All header.
Is that possible in the named Ant version?

In JavaMail you can set the return path header via the 'mail.smtp.from' session property.

Related

ant mail task : Limitation on addresses with dot on either sides

My ant script based on the mail task works fine with mail addresses of the form A#B.C where A,B, and C are strings NOT containing dots, '.' .
Alas, I need it to work with addresses of the form:
A.D#B.C and A#E.B.C
which are in common use today.
<mail mailhost="x.com" mailport="587" tolist="mail#y.z.com" subject="? was updated.">
<from address="mail#cvkimball.com"/>
</mail>
Is this a limitation of the ant mail task?
I failed to provide the SMTP server's user and password attributes.
Since I was testing with an e-mail dress on the same server, the server (apparently) didn't check the user and password and my test succeded.

symfony 5.2 Can't send smtp emails via MAILER : Expected response code "250"

I am trying to send mails via smtp on my website, ( Symfony 5.2 ), but every time I try to use the built-in mailer bundle, I get the error :
Expected response code "250" but got code "530", with message "530 5.7.1 Authentication required".
I've tried sending mails using a php script, with the same smtp configuration, and it works everytime.
In my .env file :
MAILER_DSN=smtp://mail.infomaniak.com:587?encryption=tls&auth_mode=login&username=MY_USER_NAME&password=MY_PASSWORD
Any idea ?
Thanks !
According to this https://symfony.com/doc/current/mailer.html#transport-setup, the mailer dsn format should be.
MAILER_DSN=smtp://user:pass#smtp.example.com:port
And not
MAILER_DSN=smtp://mail.infomaniak.com:587?encryption=tls&auth_mode=login&username=user&password=pass
Notice how the user and password are specified. Might also worth mentioning that you might need to URL encode your password should it contain characters that need such an encoding.
Have you tried the format from the docs?

Sitecore custom MTA for localhost

I am trying to figure out EXM for Sitecore. I installed it and now I am trying to configure it to send emails from my local machine. SAC MTA is not an option because I don't have access to App Center. I am left with custom MTA.
I was trying to configure config files to use gmail smtp:
Sitecore.EDS.Providers.CustomSmtp.config
<smtpSettings type="Sitecore.EDS.Core.Net.Smtp.SmtpSettings, Sitecore.EDS.Core" singleInstance="true">
<server>smtp.gmail.com</server>
<port>465</port>
<userName>*****#gmail.com</userName>
<password>*****</password>
<authenticationMethod>Login</authenticationMethod>
<startTls>true</startTls>
<proxySettings ref="exm/eds/proxySettings" />
</smtpSettings>
Sitecore.EDS.Providers.CustomSmtp.Sync.config
<pop3Settings>
<pop3Setting type="Sitecore.EDS.Core.Net.Pop3.Pop3Settings, Sitecore.EDS.Core" singleInstance="true">
<server>pop.gmail.com</server>
<port>995</port>
<userName>****#gmail.com</userName>
<password>****</password>
<useSsl>true</useSsl>
<startTls>true</startTls>
<proxySettings ref="exm/eds/proxySettings"/>
</pop3Setting>
</pop3Settings>
But when I try to "send quick test" through EXM I get "Failed to connect to the email server. Please try again later". Can anyone help me with that configuration. And is it even possible? I remember reading something about paid license to use custom MTA. Would it mean, that you need to pay to send email via EXM?
To switch from using the Sitecore MTA to using the Custom SMTP, you must disable the Dyn configurations and then enable the CustomSmtp configurations:
In the Website\App_Config\Include\EmailExperience folder, add the suffix .disabled to the end of the following file names:
Sitecore.EDS.Providers.Dyn.config
Sitecore.EDS.Providers.Dyn.Sync.config
In the  Website\App_Config\Include\EmailExperience folder, remove the suffix .disabled from the following file names:
Sitecore.EDS.Providers.CustomSmtp.config.disabled
Sitecore.EDS.Providers.CustomSmtp.Sync.config.disabled

Unrecognised attribute 'enableSsl' in .NET v4.0

We've been running a new system in test for a while now and creating emails to a folder so they don't accidentally go out to clients. Now we've turned on live emailing we are getting issues with sending.
I'm using ActionMailer.NET and the code to create and send the email is below. I won't include the View:
EmailResult x = new EmailController().EmailWorkOrderForApprovalToClient(model);
System.Net.Mail.Attachment file = new System.Net.Mail.Attachment(FilePath);
x.Mail.Attachments.Add(file);
x.Deliver();
Which gives the error
The SMTP server requires a secure connection or the client was not
authenticated. The server response was: 5.7.57 SMTP; Client was not
authenticated to send anonymous mail during MAIL FROM
The web.config looks like this:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="ClientServices#topupconsultants.com">
<specifiedPickupDirectory pickupDirectoryLocation="" />
<network defaultCredentials="false" host="smtp.office365.com" password="secret" port="587" userName="ClientServices#myco.com" />
</smtp>
</mailSettings>
My assumption is that enableSsl="true" needs to be added to the network line, but when I do that and try to go to the SMTP Email section of the site in IIS, I get the error:
Unrecognized attribute 'enableSsl'
I'm not that hot on IIS, but I've checked that the Application Pool and its .NET CLR version is 4.0.30319. I've also checked that .NET v4.5 is installed on the server.
This is baffling me, and I'm hoping I don't have to totally change my code to a method that allows me to specify SSL at that point.
Answering my own question here, and basically the answer is: "Don't believe the error message". In all the configurations I tried, I believed the error message when it told me that is was unacceptable. However, I tried it anyway, and it uses the enableSsl attribute when it sends, and this allows the connection to Office 365 to succeed.
Slightly irritating IIS bug that I'll forget about in a week, but right now is very annoying.
This is issue on IIS no need to worry about this error message
SmtpClient object enableSsl value get mapped
this silly issue is wasted my much time :D

How to use Ant mail task? what are the manditory inputs?

I am using ms- outlook. What are the manditory inputs for this Ant task and how can i find my mailhost and mailport number?
According to the Ant's Mail task documentation, the following information is required:
from attribute or <from> nested element.
tolist, cclist, or bcclist attributes or their equivalent nested elements <to>, <cc>, or <bcc>.
either message or messagefile attribute, alternatively nested <message> element.
If you SMTP server requires authentication, you must provide user and password attributes.
Basically these are required for any mail client.
Mail host and port, the address of an SMTP server, you can get from your system administrator.