Getting the following error in your script '-bash: 08: value too great for base (error token is "08")'

Loop which will fail with this error nodes="0" nodestotal="20" while [ ${nodes} -lt ${nodestotal} ] do if [ "${nodes}" -lt "10" ] then nodes="0${nodes}" fi echo ${nodes} nodes=$[${nodes}+1] done Solution nodes="0" nodestotal="20" while [ ${nodes} -lt ${nodestotal} ] do if [ "${nodes}" -lt "10" ] then nodes="0${nodes}" fi echo ${nodes} nodes=$[$((10#${nodes}))+1] done 10#${nodes} = base#number (in this case we want to be using base 10)

Read more

Share

Remove all emails for MAILER-DAEMON

mailq | grep MAILER-DAEMON | awk '{print $1}' | xargs -n 1 /usr/local/postfix/sbin/postsuper -d Mailq format 4F12F2AC5A 322 Wed May 21 13:11:39 root@solman.toon-net.local (delivery temporarily suspended: connect to example.org[208.77.188.166]: Connection timed out) user@example.org root@solman.toon-net.local = Sending email address user@example.org = Recipient

Read more

Share

How to send an entire domain to /dev/null in Postfix

vi /etc/opt/csw/postfix/main.cf virtual_alias_maps = hash:/opt/csw/etc/postfix/virtual # vi /opt/csw/etc/postfix/virtual @exampledomain.com blackhole@localhost # /opt/csw/sbin/postmap hash:/opt/csw/etc/postfix/virtual # vi /etc/opt/csw/postfix/aliases blackhole: /dev/null # newaliases example output root@server:/etc/opt/csw/postfix> mailx test@exampledomain.com Subject: test . EOT root@server:/etc/opt/csw/postfix> grep example /var/log/syslog Oct 30 06:51:36 server.example.com postfix/local[26477]: [ID 197553 mail.info] C045F83C6: to=<blackhole@localhost.example.com>, orig_to=<test@exampledomain.com>, relay=local, delay=0.45, delays=0.18/0.27/0/0, dsn=2.0.0, status=sent (delivered to file: /dev/null)

Read more

Share

How to discard emails using the sender email address in Postfix

Make list of email address/domains you wish to discard vi /opt/csw/etc/postfix/sender_access sender@example.com DISCARD DoNotReply@spam.example.com DISCARD subdomain.example.com DISCARD Hash table the file /opt/csw/sbin/postmap dbm:/opt/csw/etc/postfix/sender_access Add into the postfix config the smtp restriction line in vi /etc/opt/csw/postfix/main.cf smtpd_sender_restrictions = check_sender_access dbm:/opt/csw/etc/postfix/sender_access Reload postfix /opt/csw/sbin/postfix reload

Read more

Share

How To Delete Mails From Or To A Specific Email Address From Your PostFix Mail Queue

You can check your current mail queue like this: /usr/local/postfix/sbin/postqueue -p To delete all mails from the mail queue that come from buqg@mail.example.com or are sent to buqg@mail.example.com (the command is the same regardless of if it’s the sender or recipient address), you can use this command: mailq | tail +2 | awk 'BEGIN { RS = "" } / buqg@mail.example.com$/ { print $1 }' | tr -d '*!' | xargs -n 1 /usr/local/postfix/sbin/postsuper -d Afterwards check your mail queue again: /usr/local/postfix/sbin/postqueue -p It should now be much shorter.

Read more

Share

Permissions error on postfix package from blastwave

Error - Can send emails as root but not any other user Error May 20 23:32:51 server.example.com postfix/postdrop[7779]: [ID 947731 mail.warning] warning: mail_queue_enter: create file maildrop/610017.7779: Permission denied Solution root@server:/> cd /etc/opt/csw/postfix root@server:/etc/opt/csw/postfix> ./post-install set-permissions command_directory=/opt/csw/sbin

Read more

Share

Simple use of netcat for checking a port is open on a firewall/load balancer

Server (Listener) root@server:/var/tmp> cat pcanham.txt Welcome to the Server on port 7735. root@server:/var/tmp> netcat -l -s server.example.com -p 7735 <pcanham.txt Client root@scar:/> telnet server.example.com 7735 Trying 10.10.10.20... Connected to server.example.com. Escape character is '^]'. Welcome to the Server on port 7735. ^] telnet> q Connection to server.example.com closed.

Read more

Share

Compiling Orca in Solaris 10

Compiling Software Locations Orca - http://www.orcaware.com/orca/pub/snapshots/ (writing of the snapshot-r531 was the latest) RICHSe - http://puzzle.dl.sourceforge.net/sourceforge/setoolkit/RICHPse-3.4.1.pkg.gz Setting up the build environment Make sure the following packages are installed to a Solaris 10 env SUNWbtool, SUNWsprot, SUNWtoo, SUNWcpp, SUNWhea, SUNWarc, SUNWlibm, SUNWlibms, SUNWdfbh, SUNWcg6h, SUNWxwinc, SUNWlibC, SUNWzlib, SUNWscpu, SUNWperl584core, SUNWperl584usr On solaris 10 (or 9), grab SUNWspro CC compilers from developer toolkit, and put /opt/SUNWspro/bin on the path.

Read more

Share

Setting up an account in Solaris 10 which cannot become locked.

This isnt something you really want to have to do on a regular basis, if an account is getting locked on a regular basis you should really go find out who or what is causing this than just setting the account to never lock. But some times you have to do this. So here we go Where do i go to check lock account on X amount of logins is enabled

Read more

Share

Output Strings in Lowercase -- UNIX

This is something I found on someone else’s blog which i find useful, its always the simple things you forget. # cat uppercasefile | tr "[:upper:]" "[:lower:]" this file’s contents are in uppercase but its output should be lowercased # tr "[:upper:]" "[:lower:]" < uppercasefile this file’s contents are in uppercase but its output should be lowercased # cat uppercase | tr '[A-Z]' '[a-z]' this file’s contents are in uppercase

Read more

Share