From efa761b12cf2122e83693dc5c450606a4029e5aa Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Sun, 30 Oct 2011 08:10:35 -0400 Subject: [PATCH] Remove whitespace [Gun.io WhitespaceBot] --- .gitignore | 20 ++++++++++ INSTALL | 8 ++-- README | 112 ++++++++++++++++++++++++++--------------------------- SECURITY | 2 +- cmaildir.c | 2 +- test.sh | 4 +- 6 files changed, 84 insertions(+), 64 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac8f968 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc + +# Logs and databases # +###################### +*.log + +# OS generated files # +###################### +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db diff --git a/INSTALL b/INSTALL index 8ae1c07..7fca772 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ -Written by Cory Wright - cwright /at/ standblue.net +Written by Cory Wright - cwright /at/ standblue.net -To install quser just unpack the tarball, cd into the quser src +To install quser just unpack the tarball, cd into the quser src directory, and do the normal make and make install routine. tar xzf quser-0.8.tar.gz @@ -10,6 +10,6 @@ directory, and do the normal make and make install routine. sudo make install cmaildir will be installed in /usr/local/bin/ while validate-sender, -validate-recipient, mybadmailto, and mybadmailfrom will be installed -in /var/qmail/bin/ . If you don't like this then just change the +validate-recipient, mybadmailto, and mybadmailfrom will be installed +in /var/qmail/bin/ . If you don't like this then just change the Makefile, but I feel that these are the best places for these programs. diff --git a/README b/README index 1e4eb20..e5b5c2e 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ Written by Cory Wright - corywright gmail.com -You can find the most up to date documentation online at +You can find the most up to date documentation online at http://projects.standblue.net/software/quser/ Tools included with quser. @@ -12,35 +12,35 @@ Tools included with quser. * mybadmailto -cmaildir is a short C program for checking Maildir's for -new mail. If run with no arguments cmaildir checks ~/Maildir/ -for new mail and also reports messages in the inbox. If -arguments are passed to cmaildir then it expects them to be -paths to Maildir style directories, but do not include the -/cur/ and /new/ portions, the Maildir is the set together. -I wrote cmaildir because I use Courier-IMAP and it uses -Maildirs for its folders. I have my list addresses setup to -go straight into my IMAP folders so with cmaildir I can run -the following to get a status of all my folders +cmaildir is a short C program for checking Maildir's for +new mail. If run with no arguments cmaildir checks ~/Maildir/ +for new mail and also reports messages in the inbox. If +arguments are passed to cmaildir then it expects them to be +paths to Maildir style directories, but do not include the +/cur/ and /new/ portions, the Maildir is the set together. +I wrote cmaildir because I use Courier-IMAP and it uses +Maildirs for its folders. I have my list addresses setup to +go straight into my IMAP folders so with cmaildir I can run +the following to get a status of all my folders (including ~/Maildir/): shell$ cmaildir ~/Maildir/.Lists.qmail/ ~/Maildir/.Lists.moto/ You have 6 new messages, 37 saved -While this may not be that convenient to type at a command -line, its most useful in a .bash_profile file or as a bash +While this may not be that convenient to type at a command +line, its most useful in a .bash_profile file or as a bash alias. -validate-sender is a little C program I wrote because I needed -to check a sender against a list before allowing it to post to -an address. I had setup an address for people to add addresses -to badmailfrom but only wanted certain users to be able to have -this ability. validate-sender is designed to be called from a -.qmail file after bouncesaying or condredirect. It takes the -filename of the list file as an argument. The list file should -contain a list of addresses or domains, one per line. Domain -entries can either be in the form @site.dom or site.dom. For +validate-sender is a little C program I wrote because I needed +to check a sender against a list before allowing it to post to +an address. I had setup an address for people to add addresses +to badmailfrom but only wanted certain users to be able to have +this ability. validate-sender is designed to be called from a +.qmail file after bouncesaying or condredirect. It takes the +filename of the list file as an argument. The list file should +contain a list of addresses or domains, one per line. Domain +entries can either be in the form @site.dom or site.dom. For example: |bouncesaying "You are not in my list of allowed senders" validate-sender /etc/badmailadders @@ -51,23 +51,23 @@ Or, with condredirect to alert me when somebody tries to submit: |condredirect myemailaddress validate-sender /etc/badmailadders |/usr/local/bin/addtobadmailfrom -validate-sender returns 1 if a match is found, and 0 if no match -is found. 111 is returned if there is an error. I stick validate-sender -in /var/qmail/bin since the only place it will probably ever be -used is with qmail. +validate-sender returns 1 if a match is found, and 0 if no match +is found. 111 is returned if there is an error. I stick validate-sender +in /var/qmail/bin since the only place it will probably ever be +used is with qmail. -Please note that no method is fool proof against forgeries, -just see what djb has to say. In other words, dont trust your -system to anything like this, it should only be used for trivial +Please note that no method is fool proof against forgeries, +just see what djb has to say. In other words, dont trust your +system to anything like this, it should only be used for trivial checks. The validate-recipient program is very similar to the validate-sender -program, except it checks against the value of the SMTP envelope recipient -address. This is mainly for use in .qmail-default files. For example, if -all of your mail passes through a mail gateway that forwards mail using -smtproutes then you probably use a .qmail-default file for this. If you -know in advance the complete list of addresses that should be forwarded +program, except it checks against the value of the SMTP envelope recipient +address. This is mainly for use in .qmail-default files. For example, if +all of your mail passes through a mail gateway that forwards mail using +smtproutes then you probably use a .qmail-default file for this. If you +know in advance the complete list of addresses that should be forwarded then you can block anything else from being forwarded. @@ -75,41 +75,41 @@ then you can block anything else from being forwarded. |forward "$DEFAULT"@someotherserver.example.com -validate-recipient uses the same exit codes as validate-sender. +validate-recipient uses the same exit codes as validate-sender. -mybadmailfrom is a program that allows individual users to manage -their own badmailfrom lists. If a user is sick of getting mail from -a certain address or domain then all they need to do is add it to -their personal badmailfrom list. Once the list is ready the user can +mybadmailfrom is a program that allows individual users to manage +their own badmailfrom lists. If a user is sick of getting mail from +a certain address or domain then all they need to do is add it to +their personal badmailfrom list. Once the list is ready the user can add a line to their .qmail file before all the rest: |mybadmailfrom ~/Maildir/mybadmailfrom ./Maildir/ Although messages from addresses listed in ~/Maildir/mybadmailfrom will -bounce, I should note that this works in a very different way from the -badmailfrom file that qmail-smtpd uses. Addresses listed in -/var/qmail/control/badmailfrom are blocked at the SMTP connection. -Addresses listed in mybadmailfrom must first be accepted into the +bounce, I should note that this works in a very different way from the +badmailfrom file that qmail-smtpd uses. Addresses listed in +/var/qmail/control/badmailfrom are blocked at the SMTP connection. +Addresses listed in mybadmailfrom must first be accepted into the system so that qmail-local can run the .qmail file. -mybadrcptto is useful for blocking certain recipient addresses in a -.qmail-default file. For example, if you have a qmail gateway that scans -all mail for spam or viruses and forwards accepted mail onto another server, -you may want to block certain invalid or expired addresses. The badmailrcpto -program will allow you to maintain a list of addresses that you dont want to +mybadrcptto is useful for blocking certain recipient addresses in a +.qmail-default file. For example, if you have a qmail gateway that scans +all mail for spam or viruses and forwards accepted mail onto another server, +you may want to block certain invalid or expired addresses. The badmailrcpto +program will allow you to maintain a list of addresses that you dont want to pass through: |mybadrcptto ~/ex-employees.txt |forward "$DEFAULT"@internal.example.com -With this setup any mail sent to an address thats listed in the -~/ex-employees.txt file will bounce. All other mail will pass through -and be forwarded to the internal server. There is a patch available for -qmail that will block certain RCPT TO: addresses at the SMTP conversation. -The advantage to using mybadrcptto is that 1) you do not need to patch qmail, -and 2) individual users can implement their own badrcptto lists. The -disadvantage to using the mybadrcptto program as opposed to the patch is -that all email must first be accepted into the system, and only then can +With this setup any mail sent to an address thats listed in the +~/ex-employees.txt file will bounce. All other mail will pass through +and be forwarded to the internal server. There is a patch available for +qmail that will block certain RCPT TO: addresses at the SMTP conversation. +The advantage to using mybadrcptto is that 1) you do not need to patch qmail, +and 2) individual users can implement their own badrcptto lists. The +disadvantage to using the mybadrcptto program as opposed to the patch is +that all email must first be accepted into the system, and only then can qmail-local run the mybadrcptto program to check the recipient. diff --git a/SECURITY b/SECURITY index 31aed5c..e9f12d7 100644 --- a/SECURITY +++ b/SECURITY @@ -1,6 +1,6 @@ The validate-sender program (as well as the mybadmailfrom program) only checks the SENDER environment variable. This variable is set -by qmail-command using the value of MAIL FROM: from the SMTP +by qmail-command using the value of MAIL FROM: from the SMTP conversation. This can easily be forged, so you should not trust anything mission critical to the validate-sender program. It is only meant to help with trivial checks. diff --git a/cmaildir.c b/cmaildir.c index 4a82583..645c923 100644 --- a/cmaildir.c +++ b/cmaildir.c @@ -11,7 +11,7 @@ #include #include "quser.h" -int main(int argc, char **argv) { +int main(int argc, char **argv) { char *newdir=NULL; char *curdir=NULL; diff --git a/test.sh b/test.sh index 3cadf5f..08ddc16 100755 --- a/test.sh +++ b/test.sh @@ -88,7 +88,7 @@ env RECIPIENT="a@d.com" ./validate-recipient addylist chret "1" $? echo " * Testing the mybadmailfrom program" -echo +echo echo "Testing empty \$SENDER" ./mybadmailfrom list @@ -119,7 +119,7 @@ env SENDER="a@d.com" ./mybadmailfrom addylist chret "100" $? echo " * Testing the mybadrcptto program" -echo +echo echo "Testing empty \$RECIPIENT" ./mybadrcptto list