HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Procmail Shell Script
Operating System - Linux
1827881
Members
1251
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2002 01:35 AM
09-04-2002 01:35 AM
Procmail Shell Script
Dear Sir or Madam:
Would you mind explaining me each line of this script? I do not well understand with this script. What is :O means, !^, *, \ ...etc...? The script is like the following:
#Trap unapproved attachments
SHELL=/bin/sh
LOGFILE=/var/log/procmail.log
:0
* !^FROM_DAEMON
* ^Content???Type: (Multipart|Application)
* B ?? Name=(\/".+\.(EXE|COM|BAT|WAV|PIF|SCR)"|\/.+\.(EXE|COM|BAT|WAV|PIF|SCR))
{
LOGFILE=/var/log/delmail.log
:0 h i c
| ( formail ???r ???A 'From: MAILER???DAEMON@domain_name'; echo; echo " ***********SECURITY WARNING***********"; echo; echo "Your computer seems to be infected by a virus ??? I received mail from you"; echo; echo "with an attachment[$MATCH] which you probably did not send intentionally."; echo; echo "This message will be deleted automatically."; echo; echo "Please do not send any e???mail out before you have cleaned out the virus,"; echo "otherwise, it will again send itself by picking up random file from your"; echo "computer and a virus file to others."; echo; echo; echo; echo; echo " ";) | $SENDMAIL ???U ???oi ???t
LOG="Del: "
:0
/dev/null
}
Thank you so much for your explanation.
Regards,
Choth
Would you mind explaining me each line of this script? I do not well understand with this script. What is :O means, !^, *, \ ...etc...? The script is like the following:
#Trap unapproved attachments
SHELL=/bin/sh
LOGFILE=/var/log/procmail.log
:0
* !^FROM_DAEMON
* ^Content???Type: (Multipart|Application)
* B ?? Name=(\/".+\.(EXE|COM|BAT|WAV|PIF|SCR)"|\/.+\.(EXE|COM|BAT|WAV|PIF|SCR))
{
LOGFILE=/var/log/delmail.log
:0 h i c
| ( formail ???r ???A 'From: MAILER???DAEMON@domain_name'; echo; echo " ***********SECURITY WARNING***********"; echo; echo "Your computer seems to be infected by a virus ??? I received mail from you"; echo; echo "with an attachment[$MATCH] which you probably did not send intentionally."; echo; echo "This message will be deleted automatically."; echo; echo "Please do not send any e???mail out before you have cleaned out the virus,"; echo "otherwise, it will again send itself by picking up random file from your"; echo "computer and a virus file to others."; echo; echo; echo; echo; echo " ";) | $SENDMAIL ???U ???oi ???t
LOG="Del: "
:0
/dev/null
}
Thank you so much for your explanation.
Regards,
Choth
Sharing IT knowledge and Information
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 08:16 AM
09-05-2002 08:16 AM
Re: Procmail Shell Script
#Trap unapproved attachments
#Comment :)
SHELL=/bin/sh
#set environment variable(shell path for run scripts)
LOGFILE=/var/log/procmail.log
:0
# apply lines bellow for all message
* !^FROM_DAEMON
#not apply for mails from FROM_DAEMON
* ^Content???Type: (Multipart|Application)
#all mail where Content-Type=... in headers
* B ?? Name=(\/".+\.(EXE|COM|BAT|WAV|PIF|SCR)"|\/.+\.(EXE|COM|BAT|WAV|PIF|SCR))
#regexp for matching with name of attach files
#and bellow script for create reply mail(used utils formail and drop incoming mail)
{
LOGFILE=/var/log/delmail.log
:0 h i c
| ( formail ???r ???A 'From: MAILER???DAEMON@domain_name'; echo; echo " ***********SECURITY WARNING***********"; echo; echo "Your computer seems to be infected by a virus ??? I received mail from you"; echo; echo "with an attachment[$MATCH] which you probably did not send intentionally."; echo; echo "This message will be deleted automatically."; echo; echo "Please do not send any e???mail out before you have cleaned out the virus,"; echo "otherwise, it will again send itself by picking up random file from your"; echo "computer and a virus file to others."; echo; echo; echo; echo; echo " ";) | $SENDMAIL ???U ???oi ???t
LOG="Del: "
:0
/dev/null
}
--------------
programmer of AlarIT
*
http://www.alarit.com
*
#Comment :)
SHELL=/bin/sh
#set environment variable(shell path for run scripts)
LOGFILE=/var/log/procmail.log
:0
# apply lines bellow for all message
* !^FROM_DAEMON
#not apply for mails from FROM_DAEMON
* ^Content???Type: (Multipart|Application)
#all mail where Content-Type=... in headers
* B ?? Name=(\/".+\.(EXE|COM|BAT|WAV|PIF|SCR)"|\/.+\.(EXE|COM|BAT|WAV|PIF|SCR))
#regexp for matching with name of attach files
#and bellow script for create reply mail(used utils formail and drop incoming mail)
{
LOGFILE=/var/log/delmail.log
:0 h i c
| ( formail ???r ???A 'From: MAILER???DAEMON@domain_name'; echo; echo " ***********SECURITY WARNING***********"; echo; echo "Your computer seems to be infected by a virus ??? I received mail from you"; echo; echo "with an attachment[$MATCH] which you probably did not send intentionally."; echo; echo "This message will be deleted automatically."; echo; echo "Please do not send any e???mail out before you have cleaned out the virus,"; echo "otherwise, it will again send itself by picking up random file from your"; echo "computer and a virus file to others."; echo; echo; echo; echo; echo " ";) | $SENDMAIL ???U ???oi ???t
LOG="Del: "
:0
/dev/null
}
--------------
programmer of AlarIT
*
http://www.alarit.com
*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2002 07:01 PM
09-09-2002 07:01 PM
Re: Procmail Shell Script
Dear Def,
Thank you so much for your reply. I would like to ask you some remaining explanations:
:0 Is it capital o or zero? You say that "# apply lines bellow for all message". What is its long form means, I mean that URL is stand for Uniform Resource Locator and what is capital o or zero means? What is *, !, ^, \/, \, |?
* ^Content-Type: (Multipart|Application)
#all mail where Content-Type=... in headers
Would you mind telling me "all mail where Content-Type=... in headers", what this line means sir, I do not understand.
* B ?? Name=(\/".+\.(EXE|COM|BAT|WAV|PIF|SCR)"|\/.+\ (EXE|COM|BAT|WAV|PIF|SCR))
#regexp for matching with name of attach files
What is B means? What this line means sir :0 h i c? h i c? What these following lines mean?
echo " ";)|$SENDMAIL -U -oi -t
LOG="Del: "
:0
/dev/null
Thank you so much for your explanation and thank you for giving me a very good idea on writing the script.
Best regards,
Chot
Thank you so much for your reply. I would like to ask you some remaining explanations:
:0 Is it capital o or zero? You say that "# apply lines bellow for all message". What is its long form means, I mean that URL is stand for Uniform Resource Locator and what is capital o or zero means? What is *, !, ^, \/, \, |?
* ^Content-Type: (Multipart|Application)
#all mail where Content-Type=... in headers
Would you mind telling me "all mail where Content-Type=... in headers", what this line means sir, I do not understand.
* B ?? Name=(\/".+\.(EXE|COM|BAT|WAV|PIF|SCR)"|\/.+\ (EXE|COM|BAT|WAV|PIF|SCR))
#regexp for matching with name of attach files
What is B means? What this line means sir :0 h i c? h i c? What these following lines mean?
echo " ";)|$SENDMAIL -U -oi -t
LOG="Del: "
:0
/dev/null
Thank you so much for your explanation and thank you for giving me a very good idea on writing the script.
Best regards,
Chot
Sharing IT knowledge and Information
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP