I have a client who has a domain and is happy with it hosted on Virtualmin.
No problems but has asked me can I help her somehow inside Virtualmin.
She has an email set up as noreply@domain.com and uses that to issue emails to her “members/users” for sending “important” messages like “authentications/tokens/etc”. That has been working just fine.
The emails contain “small print” warning not to reply to these emails directly but to use chat/contact methods instead (all of which also work fine). But inevitably there are the usual dumb folk and also the other miscreants on the web who just spam the noreply@domain.com mailbox.
At the moment she has an auto responder set up stating “this mailbox is not read by a human and your email has been deleted - please use the contact methods provided on domain.com” and she has a human task of going in and deleting the contents of the mailbox.
What she wants to know is:
“Is there some way to automate this task (cron job or postfix perhaps) in Virtualmin to delete all and any emails sent to this mailbox AFTER the auto response has been sent?”
This is NOT a spam issue because identifying this as spam will just blacklist the genuine member/user.
So this is more of a general question: Is it possible to initiate a “post/after” sending script to delete the original email. Or if it is there I haven’t found/understood it.
Yes, this is possible in Virtualmin. You can set the number of days for which messages in a mailbox will be retained. Messages older than the specified number of days are automatically deleted.
If your client sets the number of days as 1, then the autoresponder will do what it is supposed to do and the incoming email will be cleared / deleted automatically after a day.
No I don’t think so.
As I understand it: if that is done then nothing gets delivered which also means that no auto responder gets sent. A solution to spam perhaps but the auto responder is seen as important as it points the accidental replies back to the website and all the other mechanisms of contacting. She is happy with the way things work, just it would be nice to be able to clear out the mailbox automatically rather than a daily manual chore.
I have had a look at that setting page but still cannot see an option to do it.
I have just had a look and she has the “Yes respond with message” checked and a message in the box. I looked in the “Automatic reply options” tab (hoping there would be a delete original after sending option) but nothing that made any sense to me there
It is a mail alias setup, but half work (no mailbox setup). If I send via mail client with smtp settings of the virtualmin (diffentent domain) it replies ok. But no reply if I send using gmail. Not sure why
P.S. I monitored the log and gmail has issues with the domain I think but it trying to reply. I just need to fix the domains dns (its domain I add and delete alot for testing)
Jun 24 21:59:52 server postfix/smtp[1388813]: F13D53FE114: to=xxxxx.xxxx@gmail.com, relay=gmail-smtp-in.l.google.com[142.251.10.26]:25, delay=2.7, delays=0.05/0.03/1.4/1.2, dsn=5.7.26, status=bounced (host gmail-smtp-in.l.google.com[142.251.10.26] said: 550-5.7.26 This mail is unauthenticated, which poses a security risk to the 550-5.7.26 sender and Gmail users, and has been blocked. The sender must 550-5.7.26 authenticate with at least one of SPF or DKIM. For this message, 550-5.7.26 DKIM checks did not pass and SPF check for [testdomain.com] did not pass 550-5.7.26 with ip: [xxx.xxx.xxx.xxx]. The sender should visit 550-5.7.26 Prevent mail to Gmail users from being blocked or sent to spam - Gmail Help for 550 5.7.26 instructions on setting up authentication. eh12-20020a056a00808c00b00652c20d3522si1130776pfb.303 - gsmtp (in reply to end of DATA command))
P.S.S. fixed the dns with spf dkim and dmac, gmails now work. No mailbox needed.
delete the original user noreply@domain.com after remembering to take a copy of the auto-response.
add a alias noreply@domain.com check the “Yes, respond with message” and put the original auto-response message back in. nothing else.
I’m not sure if I need to concern myself with spf dkim and dmac, as I assume these have been working well enough for the plain email accounts on this server (never having cared about aliases before)
I’m off to test - but thanks this looks like an incredibly simple solution
That didn’t work! Completely screwed up her site - I forgot she uses the account noreply@domain.com to send out the email
I quick reload from backup an apologetic telephone call and hope nothing was lost.
With no mailbox I just cannot see why it would work. there has to be a mailbox for it to land in so it can be replied to (auto respond) and that the message can be sent from.
as long as you know the account details, no need to reload from backup, its just smtp authentication.
Really she can use any smtp account to send and then use noreply@ as the reply-to address in the mail client. There no need for a noreply pop account.
I don’t know how she uses the account in her App I don’t know/think it has any “reply to” - because she doesn’t wish to encourage any reply so no need for it. the App has the password to use the email I don’t (I was just running as root on the server and dumped the account without really thinking hence my immediate recourse to a backup (taken just before blowing it up!)
Just edit the noreply POP account as above, no email will go to the mailbox but you will get the reply.
Test using a gmail account and see if it replies. Postfix does all the work.
So all you have done there is uncheck the “Yes deliver to mailbox”
I’m getting wary now about doing anything. Still looking for @calport 's suggestion of “set the number of days for which messages in a mailbox will be retained”
Saved OK.
Went out to my email (on a different server) sent an email (it confirmed it was sent. But no response and used Usermin to login to test@domain.com and nothing in the inbox.
Back to my email and sent the same test message to noreply@domain.com (remember it does have that " Yes, deliver to mailbox " checked and I get back almost instantly the auto response. Looking in Usermin noreply@domain.com the test message is there just as expected waiting for me or my client to delete it