I am using Ruby on Rails 4, I own my own webserver with domainname, but use a local maschine to send mails.
I send mails via SMTP (ActionMailer::Base.smtp_settings = {..settings..})
To my question: Is it possible to send mails with the message-id that is like ...#example.com (my domainname) and not like ...#localhostname.mail?
And if I cannot get it from SMTP (or how ever those message-ids are generated) could I just override the message-id-header so that abcd#localhostname.mail becomes abcd#example.com? Or does that mess something up? For example when I send a mail from my system and another from my normal mail program.
Thanks in advance
There are settings for your SMTP server software (postfix?) to set a domain name so it doesn't use your local hostname. You should go through the documentation of your SMTP software to find out which setting this is (sorry, I'm not a real email expert).
Related
What do I have:
Laravel app (5.5.45)
Mailgun
I send mail like this:
//App\Listeners namespace
Mail::to($event->user)->send(new Report($event->report));
There are no errors in app logs. And there are no incoming mail in the Mailgun dashboard. And, obviously, no mail on my mailbox (spam too).
I'm using debug bar, and when email sending is triggered, my mail appears in the debug bar.
What have I tried:
composer update
Delete Mailgun domain and create a new one
php artisan config:cache
Use Mailgun sandbox domain
Serve my Laravel app via HTTPS and HTTP
Nothing helped.
Question: how can I debug mail senging in other ways? I know about Mailgun webhooks, but I can set up a webhook for my local app.
P. S. When I'm sending mail using curl, everything is ok. So, I can say that my api keys are ok.
Edit 1:
dd(Mail::to(...));
returns null.
Edit 2: everything is ok when sending via SMTP.
From Laravel 5.3V Notify system feature is introduced try this
https://laravel.com/docs/5.4/notifications
We have had issues with our server being used to send spam via cfmail to our remote SMTP server. I cannot see where it is occurring, but the emails are sent from a domain that is not one on our server.
Is there a way using ColdFusion administrator to specify that only emails showing as from someone#mydomain.com are sent to the SMTP host via the spool?
Thanks in advance,
Paul
It sounds to me like the <cfmail> side of things here is a red herring and you have got an open relay on your mail server. You seriously need to disable that immediately! If your SMTP server has to relay email for your CFML app then make sure it's not configured to relay everything, instead just for the IP address of the CF server, or for the credentials the CF server uses to connect to it.
If you don't know how to configure the relaying settings for your SMTP server, raise another question on serverfault.com asking how. Provide the exact details of your SMTP server, as well as the requirement to still allow relaying for the CF server.
An app is designed to be installed on a user's computer, hence, an email function from the app would very much depends on the user's ISP service. Port 25 may be open or may be blocked.
When I use standard code for mail ua including port 25, it seems to deliver the email, however, for some user whose ISP blocks port 25 email does not go through. I'd like to have a reliable way to determine if port 25 fails to deliver email Instantly and then try to use another port to send email. In other words, I'd like to leverage two ports, if port X fails then automatically switch to port Y. Doable?
Btw, the web server side scripting language I'm using is Adobe ColdFusion's sibling, Railo, and the specific tag is CFMAIL. As mentioned above, wrapping CFTRY around CFMAIL does not help for this purpose.
Thanks.
There are multiple factors in determining if your message gets delivered.
1) When you send your message with CFMAIL, you can either specify a mail server in the cfmail tag, or use the server default. When the tag is executed, coldfusion/railo will try to access that server. If the server is unavailable or blocked, your message will go to the coldfusion/railo undeliverable folder. The only way to check that is to write a script to monitor the undeliverable folder and its content.
2) IF coldfusion/railo successfully connect to the SMTP server and attempts to hand off the email, your notifications would come from the SMTP server rather than coldfusion/railo. The message would be sent from the SMTP server to the failto="" path, or the from="" if not specified. That email would be notified for "mailbox does not exist", "relay not allowed", "user over their mailbox limit", etc....
If you need to monitor those bounces, you could create a separate email account for the failto="" and use CFPOP to monitor the email account for bounces.
Also, if you use a company like sendgrid for your outgoing SMTP server, they will provide an API to monitor bounces, opt outs, spam complaints, etc...
I don't have too much experience programming in C++, but I need to build a basic application for sending state emails from a computer using windows or linux, and I've found that POCO C++ suppoorts both platforms, but I have a proxy http provider behind to filter unauthorized connections, so, how could I do it?.
You can't send SMTP e-mail through a HTTP proxy.
But you can make a HTTP connection to a website you control. And you can write a web-to-email script and put that on your website. E.g. your script can take a status message as a POST parameter and then send it out as e-mail.
Spammers often try to hack web-to-email scripts to send spam, so please make sure your script has a hard-coded destination e-mail address. That way the spammer can only send mail to you, not everyone else on the Internet. Whatever you do, don't pass the destination e-mail address as a parameter.
regarding web to email scripts - make sure you strip newlines from anything that ends up in email headers! (to prevent spammers from injecting headers)
I would like to create a mail sender on C++ (not Mail Client for eg. GMail). In this mailer I want to be able to change the headers also.
I have already downloaded and installed the POCO libraries, that might help (I found it on a similar anwser).
For example, what I would like is a command like below:
e-mailsend(to,headers,subject,message);
// Or something like:
email.send(to,headers,subject,message);
However, If possible, I would like to use a C++ Mail function not a system function (like mail-utils in unix).
If you need any more explanation please comment...
In your comments you asked for an option without an SMTP server.
SMTP requires an SMTP Server. The choice is that could send emails directly (e.g. to joe at yahoo.com on port 25) or to a SMTP server that will relay the message.
Ideally, you will want your own SMTP server locally (so your application is simpler and your SMTP server sends the messages in the background, handles retries, bounces and connection errors) and use a reputable SMTP service or an existing email account.
If you want to send spam, I'd strongly advise against it.
If you want to send a small number of messages that will be opened by people expecting those messages, use a normal account (Yahoo, GMail, Google Apps, etc) and if you find your application not responsive enough, install Postfix, Sendmail or whatever local SMTP server you like.
If you want to send a large volume of emails and you are sure those message won't get you targeted as a spammer, use an SMTP service, like SendGrid (note: they also have a web API that you might find easier to use than SMTP).
Depending on which of the above you need, I'm sure answering your original question with a recommendation for SMTP C++ clients (like POCO) with become simpler.