I have ssmtp installed and configured on my linux box. It connects to a remote smtp server provided by my hosting provider and works faultlessly.
My linux box is connected to an APC UPS, and emails are sent from the ups deamon (apcupsd) when the machine looses comms with the UPS, or the battery in the UPS becomes faulty.
apcupsd also sends out "onbattery" or "onmains" emails. The problem is however that the linux box is the only thing on the UPS, things like my router and hub are NOT on the UPS, and so switch off in the event of a power outage.
Is there anyway to have the emails queued up when the linux box is unable to connect to the smtp server, and then deliver them when everything comes online?
if I try "mailq" during a power outage, it states that the queue is empty, even tho I know that an email was generated and failed to be delivered.
Thanks in advance,
Phil.
Related
I have a VPS server with CPanel on my domain (say mydomain.com). I have a SuiteCRM installed on a subdomain (say sub.mydomain.com) and I am sending mass emails from it in a batch of 90 every hour.
While sending the emails from the CRM (Authenticated SMTP mode) the emails are getting deferred with the error:
SMTP error from remote mail server after MAIL FROM:< myemail#mydomain.com> SIZE=562346: 451 <myemail#mydomain.com> server temporarily unavailable. AUP#MXRT
The SPF, DKIM and DMARC everything is fine.
I am suspecting it could be a max rate warning/failure (MaXRaTe hence MXRT) from the remote/recepient mail server. It is failing/deferring emails for Gmail, Yahoo and other email providers not for any company-specific emails like someone#somecompany.com
There seems a limit on emails for Gmail and other vendors. I had gone through these where Gmail specifically pointing out the limits and do's and don'ts:
https://support.google.com/mail/answer/22839?hl=en#zippy=%2Cyou-have-reached-a-limit-for-sending-mail
https://support.google.com/mail/answer/81126
In my case, I find myself well under the limit. So, why I am getting this error?
Second thought: It could be due to that I am sending 90 emails in one go. If I send emails one-by-one after a delay (say 3-5 seconds) then there won't be any problem. Enlighten me on this too.
I later realized that, even any one-to-one email I am sending via Thunderbird from my server (SMTP), even to a single recepients, is failing. I have checked check.spamhaus.org and intodns.com everything is alright there.
My Environment (Though this hardly matter in context of my problem but just in case):
BigRock's VPS Server with CPanel (Version)
Apache Version: 2.4.53
MySQL Version: 8.0.29
WHM Version: 102.0.18
CentOS Version: 7.9.2009 (Standard KVM)
Note: I haven't mentioned my actual domain name just for the privacy and security since I feel putting everything here will pose risks.
I have a busy CentOS webserver that sends a lot of outbound email using PHPMailer. Postfix and Sendmail are both installed on it, but as there are no user accounts that use the server for email, I wonder if I can uninstall both of those and close ports 25,110,465,587 for security. Will PHPMailer still be able to send outgoing?
No, PHPMailer (and any other mail library for any programming language, for that matter) is just an interface for the email service and not a mailer daemon by itself.
You do not need POP (you can shut that down anytime) but you will need sendmail or some other SMTP service to actually do the work PHP Mailer requests.
If you definitely need to shut down sendmail and the related ports, you can always part ways with it and implement your mail delivery logic using Mailgun, SendGrid, Elastic Email, Pepipost or some other alternative. There WILL be coding involved as you'll need to interact with those providers' APIs and they all involve some costs (Mailgun and Sendgrid have free tiers for a couple thousand emails per month, I don't remember if the others do as well) and integration efforts.
I believe you should be fine to remove any local mail service as PHPMailer is made to use an external service. You can close those ports as it's only outgoing!
The PHP mail() function usually sends via a local mail server, typically fronted by a sendmail binary on Linux, BSD and OS X platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server.
https://github.com/PHPMailer/PHPMailer
Indeed you do not need to have a local mail server, however, if it's really busy, sending via a local mail server will be far more efficient than sending via any external service, especially if these messages are being sent immediately (and synchronously) in response to HTTP requests. You can see more about this in the PHPMailer wiki on github.
You definitely don't need POP3, but you may need inbound on port 25 if you're going to receive/handle bounces from the messages you send and want them to come back to you.
In this scenario you would only need port 25 open in both directions, none of the others.
Also, be clear what you mean by sendmail. Postfix is a complete mail server and so is sendmail, but the name sendmail is also often used to refer the sendmail binary that is actually a local message submission agent - it's what gets used by the PHP mail() function. postfix provides a sendmail binary, but postfix is not sendmail.
I've been trying to figure this out for a couple days now. I've got a little linux box that should send email alerts and I need to test this functionality. It's a very, very basic linux box (painfully so).
Is it possible to setup a fake SMTP server on my desktop (IP:192.168.0.20) that it (192.168.0.2) can send emails to? I need to confirm that the messages are correct in content, but that's all. I'm perfectly fine having this spit out to the terminal. There's no DNS on the local network, or DHCP, I'm just using static IP addresses so it needs to work within that limitation.
I've been able to confirm with wireshark that the embedded computer is trying to do something over SMTP, but I don't see any message content at all, looks like it's just trying to talk to the server. I've also tried sending a message using "mail" but I keep getting an "SMTPclient: agent: unknown host" error, which I assume means it can't find the SMTP server I'm telling it to find.
I'm using Ubuntu 14.04 on my desktop.
Thanks!
So, as a basic test it works to just have an SMTP server running on your local machine. Installing Postfix should be all that's required. I set up the relay to our local mailserver but it wouldn't relay through. From the error messages I was getting I gather this is a DNS issue, it can't resolve where to direct the message. Watching wireshark you should be able to see the traffic and the attempt to send the message, which is something I guess. I will update when I have a better answer.
I have a windows 2003 server which is running the IIS(6.0) virtual SMTP server. I have written a event sink for this server to parse and pop incoming e-mails. I'm trying to get the server to accept incoming domains with a wild card. So *.something.com would be accepted by this server.
If I use an alias domain, it wont allow me to use a wild card. If I use a remote domain, I can use a wild card but I have to turn relaying on (which I don't want to do) and it attempts to send itself a message on top of that. If relaying is turned on, i get a error response 5.3.5.
With all that said, I'm looking for a way to configure my server to accept alias domains with wild cards.
I found no configuration that allowed me to do this. My solution is ugly, but it works. I kept the relay and only Allowed the server to relay to itself. I also changed the Imessage.envelopeField.MessageStatus to abort on successful read so that it wouldn't be processed by anything other then my sink (thus, not being routed to a "new" destination).
On windows 2003, to have accesses to the Imessage class you need to import cdo.dll.
I'm developing a website on an XP virtual machine and have an SMTP virtual server set up in IIS -- it delivers mail just fine. What I would like is to confirm that any emails the site sends are only going to a specific domain.
The XP firewall seems to only involve incoming connections, I can't block outgoing TCP on port 25. And I haven't been able to configure the SMTP server to filter by delivery address.
With this setup, is there any easy way to filter outgoing email by destination address?
Here's one idea:
Under Advanced Delivery options (SMTP Virtual Server Properties > Delivery tab > Advanced). There you can set a "Smart Host" which is the SMTP server that will be used to actually send the mail, so you could possibly have it deliver directly to the specific domain's incoming SMTP server.
I think the easiest way would be to add a check to your mail sending code on the website (there's got to be some class which is in charge of sending the mails out).
You could include a check which is only active when the code is compiled in debug mode (using compiler directives). Thus, when you are developing and building the site in debug mode, this code checks if the outgoing messages are valid (specific domain) or not. If they are it lets them go, else it doesn't send the mail.