How can I send a mail via the CLI in DMS with a file attached? #4349
-
Daily virus scans on my machine trigger an email to send if anything is found with the below command: Using the eicar test file to check everything is working, the email is sending but the log file which should be attached is missing and the path is prepended to the mail body. Note I have mounted the directory to the container and can |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You need to provide more context please. Do I understand this correctly?
How is the mail being tested with DMS? Is it arriving inbound via port 25 to Postfix? Or are you using Fetchmail/Getmail? We have two integrations for ClamAV:
SpamAssassin itself is only configured for anti-spam we don't have it setup for ClamAV, nor do we run Non-issue with Normally most mail would come into DMS through Postfix which uses a content filter for Amavis, or smtpd milter for rspamd. These can reject mail that has viruses, or with Amavis it can quarantine it, in both cases neither should deliver into the intended Dovecot mailbox. When you've clarified if I understood correctly. I can show a minimal reproduction to test a virus mail arriving, and confirm any issues with logs, otherwise if that doesn't reproduce your problem you'll need to figure that out for a proper bug report if it's not a misconfiguration. |
Beta Was this translation helpful? Give feedback.
-
Oops I misread the issue, sorry about that. The $ mail -h
mail: invalid option -- 'h'
usage: mail [-dEIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-r from-addr] [-s subject] [--] to-addr ...
mail [-dEIiNnv] -f [name]
mail [-dEIiNnv] [-u user] Those then use Use
|
Beta Was this translation helpful? Give feedback.
-
Thanks, that's done it! Using
|
Beta Was this translation helpful? Give feedback.
Oops I misread the issue, sorry about that.
The
-a
option you provided tomail
also appears to be for setting a header, not attaching a file? I am not fond of themail
command myself as from what I've read it varies by system. It's not always the same program. In our case it's an alias tomailx
IIRC.Those then use
sendmail
I think to send the mail, which for DMS …