Plesk 12 সারি বিবরণ সহ একটি মেল পেতে চেষ্টা


1

আমি একটি মেল সেট আপ করার চেষ্টা করছি যা মেল কাতারে 100 টি মেইল ​​উপস্থিত থাকলে আমাকে বলবে। আমি কোনও লিনাক্স সার্ভার ব্যক্তি নই তাই আমি @ কিছু সাহায্যের প্রশংসা করি। আমার আছে:

            # get server hostname
            hostname=`cat /etc/hostname`

            current_mailq= "/var/qmail/bin/qmail-qstat"

            # `postqueue -p | tail -n 1 | cut -d' ' -f5`

            yourEmail="xxxx@gmail.com"


            if [ "$current_mailq" -gt "100" ]
            then
            echo "Mail queue problem - there is currently $current_mailq mails in queue. Please check it out." > check_email_queue_outgoing.txt
            mail -s "$hostname - mail queue alert - there are $current_mailq emails in queue" "$yourEmail" < check_email_queue_outgoing.txt
            else
            echo "Mail queue is fine - there is currently $current_mailq mails in queue. Please check it out."
            echo "Do nothing, situation is fine."
            fi

যা আমি একটি plesk ফোরামে খুঁজে পেয়েছি।

আমি ক্রোন কাজ চালানোর সময় এটি বলে

        Output from command /home/xxxxxx/check_email_queue.sh ..

        /home/xxxxxx/check_email_queue.sh: line 2: 
        : command not found
        /home/xxxxxx/check_email_queue.sh: line 3: 
        : command not found
        cat: /etc/hostname: No such file or directory
        /home/xxxxxx/check_email_queue.sh: line 6: 
        : command not found
        /home/xxxxxx/check_email_queue.sh: line 7: /var/qmail/bin/qmail-qstat
        : No such file or directory
        /home/xxxxxx/check_email_queue.sh: line 8: 
        : command not found
        /home/xxxxxx/check_email_queue.sh: line 10: 
        : command not found
        /home/xxxxxx/check_email_queue.sh: line 12: 
        : command not found
        /home/xxxxxx/check_email_queue.sh: line 13: 
        : command not found
        /home/xxxxxx/check_email_queue.sh: line 21: syntax error near unexpected token `fi'
        /home/xxxxxx/check_email_queue.sh: line 21: `fi'
        Mail handler 'limit-out' said: REPLY:554:5.7.0 Your message could not be sent. The user xxxxxx is not allowed to send email.

কোন ধারণা দয়া করে?

সম্পাদনা করুন ...

আমি ব্যবহারকারীকে রুটে পরিণত করেছি এবং এটি এখন মেল প্রেরণ করে তবে অন্যান্য ত্রুটিগুলি রয়ে গেছে - আমি মেল সারির আকারটি খুঁজে বের করতে পারি না ধন্যবাদ ধন্যবাদ

উত্তর:


0

এই সংস্করণটি ব্যবহার করে দেখুন:

#!/bin/bash

hostname=`cat /etc/hostname`

current_mailq="`postqueue -p | tail -n 1 | cut -d' ' -f5`"
yourEmail="xxxx@gmail.com"

echo "$current_mailq"

if (( "$current_mailq" >= "100" )) ; then
echo "Mail queue problem - there is currently $current_mailq mails in queue. Please check it out." > check_email_queue_outgoing.txt
mail -s "$hostname - mail queue alert - there are $current_mailq emails in queue" "$yourEmail" < check_email_queue_outgoing.txt
else
echo "Mail queue is fine - there is currently $current_mailq mails in queue. Please check it out."
echo "Do nothing, situation is fine."
fi

মনোযোগ দিন ভাল পোর্টেবল বাশ / শ / সেন্টিমিটার কোড করা সত্যিই শক্ত। আইএমও, গো ভাষা নেওয়া এবং যে কোনও ওএসের জন্য পরিষ্কার পোর্টেবল প্রোগ্রাম তৈরি করা ভাল ।

আমাদের সাইট ব্যবহার করে, আপনি স্বীকার করেছেন যে আপনি আমাদের কুকি নীতি এবং গোপনীয়তা নীতিটি পড়েছেন এবং বুঝতে পেরেছেন ।
Licensed under cc by-sa 3.0 with attribution required.