Score:-1

Procmail sends an auto reply but doesn't deliver to Inbox

in flag

I started an auto response recipe for certain user hours ago.
I got the auto reply sent and the original mail delivered into Inbox. I tested it several times.
I made some minor changes in formail and now auto reply is sent but the original mail is not delivered to Inbox.
I went back to the first recipe but the problem remains.
I also tried changing the sender address, checked spam marked mails and maillog and cannot realize what happened.

The first recipe:

:0
* ^From.*[email protected]
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: [email protected]
| (formail -rk \
    -A "X-Loop: [email protected]" \
    -A "Precedence: junk"; \
    echo "Testing";\
    echo "This is an automated response";\
    echo "Not sure to see your message";\
    echo "So please try again tomorrow" ) | $SENDMAIL -t -oi 

Changes I had done were in formail -rt (instead of -rk) and remove of -A "Precedence: junk"

UPDATE
I think I've found the problem: procmail.log: "Virus scanner failed to response within 30 seconds"
This is a problem I have some time ago. Incoming mails are delayed to deliver 30secs or a minute (this server has very low mail traffic). It seems that procmail recipes don't like that.
Is is there a configuration to tell it to wait until Clam finishes its work?

UPDATE 2
I turned off clamscan (virus scan) and the problem persists, the original mail is not delivered to inbox. Now I don't get procmail.log: "Virus scanner failed to response within 30 seconds"
This log only outputs the recipe

UPDATE 3
I use Webmin/Virtualmin as Control Panel. By default ClamAV uses clamscan

ps aux | grep clam
username 31127 0.0 0.0 26132 2144 ? S 20:30 0:00 /usr/bin/perl /etc/webmin/virtual-server/clam-wrapper.pl bin/clamscan
username 31128 0.0 0.0 9564 1156 ? S 20:30 0:00 sh -c /bin/clamscan - /tmp/clamwrapper.31127
username 31129 101 15.7 1385464 1258520 ? R 20:30 0:30 /bin/clamscan -

That's before I turned off AV.

UPDATE 4

The original mail is sent from Postfix to Procmail:

... relay=local, delay=30, delays=0.29/0.01/0/30, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)     

Procmail log:

From [email protected] Mon May 23 13:15:34 2022
 Subject: Testing auto-reply
  Folder:  (formail -rt \     -A "X-Loop: [email protected]"; \     ec     2343
Time:1653322564 From:[email protected] To:[email protected] User:user_me Size:2343 Dest: (formail -rt \
    -A "X-Loop: [email protected]"; \
    echo "Testing";\
    echo "This is an automated response";\
    echo "Not sure to see your message";\
    echo "So please try again tomorrow" ) | $SENDMAIL -t -oi Mode:None
tripleee avatar
ar flag
We can't see your SpamAssassin recipe but the error message seems unrelated to that; SpamAssassin is not a virus scanner. Are you running ClamAV or another actual virus scanner from Procmail, too? Can you please [edit] to show the associated recipe, and the actual excerpt from Procmail's log file?
us flag
Rob
Rather than running spam assassin directly from procmail, run the spam assassin daemon `spamd` as a service and initiate scans with `spamc` - see the footer on https://cwiki.apache.org/confluence/display/SPAMASSASSIN/UsedViaProcmail - that will complete your scans much faster
in flag
@tripleee Sorry you both. Spamassassin has nothing to do here. It is clamscan that causes the delays. I confused the things. I am editing the question.
tripleee avatar
ar flag
You're still not showing how you are running ClamAV. Yes, there is an option which you should be using but we can't see your recipe. It is completely unrelated to the code in your question.
tripleee avatar
ar flag
It's much better to run the AV from the mail server than from Procmail, though. See e.g. https://www.linuxbabe.com/mail-server/postfix-amavis-spamassassin-clamav-ubuntu which explains how to run ClamAV from Postfix on Ubuntu via Amavis (sorry, could not quickly find one which doesn't want you to sign up for some marketing bullshit).
tripleee avatar
ar flag
https://serverfault.com/questions/683032/configuration-of-clamav-on-fedora-core-21-with-postfix is a local question about how to do this on Fedora, but it's rather old.
in flag
@tripleee I don't understand why the code starting `:0` is not a "recipe". Despite its name it is located at /home/me/.procmailrc. As said before I could it work okay in some initial tests but suddenly original mail was not delivered to Inbox (auto-reply is OK). I turned off AV clamscan but nothing changed. I never changed Virtualmin default install (2019) of ClamAV. (Added Update 3)
tripleee avatar
ar flag
It is a recipe, but apparently unrelated to the actual question here. I have given up on asking you to show the actual code which runs ClamAV, and instead voted to close as unclear.
in flag
I don't know which code runs ClamAV and how to find it. I use Virtualmin as a control panel and I only was able to disable virus filtering
in flag
I simply added 'c' flag (copy): `:0c` Now the recipe first stores the mail in inbox directory and then the auto-reply. ClamAV is turned off
tripleee avatar
ar flag
If `procmail.log` contains an error message, something in your `.procmailrc` is producing that (or you have a really weird setup where something unrelated writes messages to Procmail's log file!)
in flag
The error message I had in procmail.log was related to more than 30secs. ClamAV delay that it had gone after I turned it off. Now it is working okay. Thanks
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.