ammartahir1978
asked on
how to query mail quesues in postfix
hi everyone,
i have linux Suse 10.3 and runing postfix,
i want to query the mail quesues, or how can i transfer the deferred queue mails in to a csv file?
pleas ehelp
i have linux Suse 10.3 and runing postfix,
i want to query the mail quesues, or how can i transfer the deferred queue mails in to a csv file?
pleas ehelp
ASKER
thanks dramdrum, but i want to have all the deferred one's in a csv format so that i can take them out from the mailing list, and through your command i would be sitting there for ever to note down
anymore help please
anymore help please
Also postqueue -p is the same as mailq (mailq might not be available on all systems)
You can do a man postqueue and man postcat to see the full options list
You can do a man postqueue and man postcat to see the full options list
ASKER
hi dramdum,
i am a beginner so you have to teach me if you dont mind, how can i get all the deffered queue messages in a csv file?
i am a beginner so you have to teach me if you dont mind, how can i get all the deffered queue messages in a csv file?
ASKER
all i need is MAIL ID , EMAIL ADDRESS, And the error in a csv file
postqueue -p
will print out all that info
To automatically extract only those 3 fields for only the deffered mails from the output you will need some serious bash/perl scripting abilities, considering the output is in columns and more than one line for each record.
Unfortunatelly mine are not that good yet ;)
I am sure there is a scripting expert around who will help you out with this. :)
will print out all that info
To automatically extract only those 3 fields for only the deffered mails from the output you will need some serious bash/perl scripting abilities, considering the output is in columns and more than one line for each record.
Unfortunatelly mine are not that good yet ;)
I am sure there is a scripting expert around who will help you out with this. :)
ASKER
is there any way i can extract everything and then i can sort it in excel myslef?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you dramdrum, last think how can i email this file to an external email address, i have copied it to the root > desktop
The easiest way is with mutt:
mutt -s "Here are the deferred mails" -a filename.cvs user@domain.com
mutt -s "Here are the deferred mails" -a filename.cvs user@domain.com
ASKER
it says mutt command not found
anyother way?
anyother way?
Well since it is a text file you could just use the simple mail command and put it in the message body (mail cant handle attachments):
mail -s "Here are the deferred mails" > user@domain.com < filename.cvs
mail -s "Here are the deferred mails" > user@domain.com < filename.cvs
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
its saying no such file found, but it is sitting on the desktop of the root name
mail -s "here is the file" > atahir@domain.co.uk < /root/desktop/email.xls
but it says file notfound
mail -s "here is the file" > atahir@domain.co.uk < /root/desktop/email.xls
but it says file notfound
ASKER
mail -s "Here are the deferred mails" user@domain.com < filename.cvs
i have used the above command and it doesnt give me any error but i havent received the email .
how can i check
i have used the above command and it doesnt give me any error but i havent received the email .
how can i check
Take a look if its in the mail queue (with postqueue -p of course)
Look at the mail logs in /var/log/mail.log or /var/log/syslog
Look at the mail logs in /var/log/mail.log or /var/log/syslog
ASKER
it is in the mail queue dramdrum
ASKER
now mail queue is empty but i havent received it
ASKER
okay if i dont type < email.csv at the end i get the email straight away but when i do email.csv at the end of the command it does send but i never receive it.
how can i get it
how can i get it
Hmm how big is the file?
Mail queues have a size limit (i think the default is 10MB)
Mail queues have a size limit (i think the default is 10MB)
ASKER
its definately less then 10MB
ASKER
its 774 KB
I see you closed the question.
You managed to get the file?
You managed to get the file?
ASKER
yeah well not with your command but what i did is log on to that machine on my web account and emailed that file across :) i know its a way around but i really need to make it working some how so that i can email this file to myself from anywhere in the world.
have you got any other suggestions?
have you got any other suggestions?
mailq
will show you the mail queue along with the reasons mails havent been sent yet
postcat -q queuenumber
will show you the contents of the mail queuenumber