Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Problems with Email from Cron job

  1. #1

    Default Problems with Email from Cron job

    Running openSUSE 12.1 with Linux 3.1.0-1.2-desktop x86_64, System: openSUSE 12.1 (x86_64), KDE: 4.7.2 (4.7.2) "release 5" and all patches up to date.

    I am having problems getting cron job to email me. I have tried simple test of system mail from console and am getting the following message in my /var/log/mail file.

    Second problem is I cannot stop the system from trying.

    Clearly the issue is one of permissions but what do I change and how?

    Code:
    Apr 10 21:27:31 X3400server postfix/postdrop[28856]: warning: mail_queue_enter: create file maildrop/564062.28856: Permission denied
    Apr 10 21:27:31 X3400server postfix/postdrop[30113]: warning: mail_queue_enter: create file maildrop/564274.30113: Permission denied
    Apr 10 21:27:31 X3400server postfix/postdrop[29982]: warning: mail_queue_enter: create file maildrop/578679.29982: Permission denied
    Apr 10 21:27:32 X3400server postfix/postdrop[23681]: warning: mail_queue_enter: create file maildrop/344861.23681: Permission denied
    Apr 10 21:27:34 X3400server postfix/postdrop[27724]: warning: mail_queue_enter: create file maildrop/63313.27724: Permission denied
    Regards,
    Budgie2

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with Email from Cron job

    On 2012-04-10 22:46, Budgie2 wrote:

    > Code:
    > --------------------
    > Apr 10 21:27:31 X3400server postfix/postdrop[28856]: warning: mail_queue_enter: create file maildrop/564062.28856: Permission denied
    > Apr 10 21:27:31 X3400server postfix/postdrop[30113]: warning: mail_queue_enter: create file maildrop/564274.30113: Permission denied
    > Apr 10 21:27:31 X3400server postfix/postdrop[29982]: warning: mail_queue_enter: create file maildrop/578679.29982: Permission denied
    > Apr 10 21:27:32 X3400server postfix/postdrop[23681]: warning: mail_queue_enter: create file maildrop/344861.23681: Permission denied
    > Apr 10 21:27:34 X3400server postfix/postdrop[27724]: warning: mail_queue_enter: create file maildrop/63313.27724: Permission denied
    >
    > --------------------


    There is a folder named "/var/spool/postfix/maildrop/", it should have
    these permissions:

    Code:
    drwx-wx---  2 postfix maildrop 4096 Apr 10 00:00 ./
    If they are correct, try stopping apparmor.

    If that doesn't help, you may stop the thing by issuing "mailq", to get the
    ID of the mail causing the problem, then delete it with "postsuper -d ID".

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  3. #3

    Default Re: Problems with Email from Cron job

    Hi Robin,
    The maildrop file has the same permissions as those you show.
    How do I stop apparmor?
    I tried mailq and received permission denied. Tried again as SU and found queue empty.
    Any further suggestions?
    Budgei2

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with Email from Cron job

    On 2012-04-11 09:46, Budgie2 wrote:
    >
    > Hi Robin,
    > The maildrop file has the same permissions as those you show.
    > How do I stop apparmor?


    If it is running, with "rcapparmor stop", but there is a bug in 12.1 where
    it might ignore you. You have to verify that it is running.

    If AA is the problem, you will have entries in /var/log/audit/ or
    /var/log/apparmor/.


    Did you configure mail with yast first?

    > I tried mailq and received permission denied. Tried again as SU and
    > found queue empty.


    Do not use "su", use "su -". Always.

    > Any further suggestions?


    Do you have still those messages in the log?

    There are entries in google about this problem, and they point at what I
    said about that directory (not file).

    Please post the output of "/var/spool/postfix/", inside code tags.


    How is that disk mounted?

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  5. #5

    Default Re: Problems with Email from Cron job

    Hi Robin,
    No sign of apparmor running in system monitor and neither of the directories you indicated were present.

    Yes I did configure mail using yast and after that tried to send mail as a test using:-

    Code:
    echo Test | mail -s Test postmaster@errichel.co.uk


    This message was not sent.

    I used Dolphin in super user mode but what is the reason for your advice re "SU" vs "SU -"

    The messages in /var/log/mail are still there but are added to every few seconds as the system keeps trying to send. Here are the most recent 4 lines:

    Code:
    Apr 11 17:25:52 X3400server postfix/postdrop[9557]: warning: mail_queue_enter: create file maildrop/162683.9557: Permission denied
    Apr 11 17:26:02 X3400server postfix/postdrop[9557]: warning: mail_queue_enter: create file maildrop/162813.9557: Permission denied
    Apr 11 17:26:12 X3400server postfix/postdrop[9557]: warning: mail_queue_enter: create file maildrop/162960.9557: Permission denied
    Apr 11 17:26:22 X3400server postfix/postdrop[9557]: warning: mail_queue_enter: create file maildrop/163105.9557: Permission denied
    /var/spool/postfix gives me a problem because it is a directory with quite a few sub directories in it. Do not know how to cut & paste.

    As for disk mounting root is on sda2 and home on sda5 all on same disk which is RAID 1 array.

    Hope this helps and thanks again for your replies.
    Regards,
    Budgie2

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with Email from Cron job

    On 2012-04-11 18:46, Budgie2 wrote:
    >
    > Hi Robin,
    > No sign of apparmor running in system monitor and neither of the
    > directories you indicated were present.


    Good.

    > Yes I did configure mail using yast and after that tried to send mail
    > as a test using:-
    >
    >
    > Code:
    > --------------------
    > echo Test | mail -s Test postmaster@errichel.co.uk
    > --------------------
    > (postmaster@errichel.co.uk)
    >
    > This message was not sent.


    That is as it should be, you don't have a registered domain. Test it
    sending from a local user to another local user.


    > I used Dolphin in super user mode but what is the reason for your
    > advice re "SU" vs "SU -"


    Plain "su" inherits the user environment, whereas with the dash you get
    root's environment. Documented many places. Or in man su.

    > The messages in /var/log/mail are still there but are added to every
    > few seconds as the system keeps trying to send. Here are the most
    > recent 4 lines:


    Kill the process. If you google "mail_queue_enter: create file
    maildrop/xxxx.xxxx: Permission denied" you will see how.


    for example here


    > /var/spool/postfix gives me a problem because it is a directory with
    > quite a few sub directories in it. Do not know how to cut & paste.


    I gooffed the command. Simply run "ls -l /var/spool/postfix/" in a terminal
    and copy paste that with the mouse.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  7. #7

    Default Re: Problems with Email from Cron job

    Hi Robin,
    Here is the listing you asked for:-

    Code:
     drwx------ 2 postfix root     4096 Mar 15 13:45 active
    drwx------ 2 postfix root     4096 Mar 15 13:45 bounce
    drwx------ 2 postfix root     4096 Mar 15 13:45 corrupt
    drwx------ 2 postfix root     4096 Mar 15 13:45 defer
    drwx------ 2 postfix root     4096 Mar 15 13:45 deferred
    drwx------ 2 postfix root     4096 Mar 15 13:45 flush
    drwx------ 2 postfix root     4096 Mar 15 13:45 hold
    drwx------ 2 postfix root     4096 Mar 15 13:45 incoming
    drwx-wx--- 2 postfix maildrop 4096 Mar 15 13:45 maildrop
    drwxr-xr-x 2 root    root     4096 Apr 11 08:40 pid
    drwx------ 2 postfix root     4096 Apr 11 17:47 private
    drwx--x--- 2 postfix maildrop 4096 Apr 11 17:47 public
    drwx------ 2 postfix root     4096 Mar 15 13:45 saved
    drwx------ 2 postfix root     4096 Mar 15 13:45 trace
    alastair@X3400server:~>
    Thanks for the reminder on su. Wiser now.

    I shall now go and kill the process and await your further advice.
    Many thanks once more.
    Budgie2

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with Email from Cron job

    On 2012-04-12 23:16, Budgie2 wrote:
    >
    > Hi Robin,
    > Here is the listing you asked for:-


    It appears ok to me.

    >
    > Thanks for the reminder on su. Wiser now.
    >
    > I shall now go and kill the process and await your further advice.
    > Many thanks once more.


    Welcome. Restart postfix, and on another terminal keep "tailf
    /var/log/mail" running so that you can see anything that pops in the log.
    If there is no error, try sending an email from a local user to another,
    using "mail".


    If you have that same permission denied error, then on another terminal do:

    Code:
    su -
    su - postfix
    cd /var/spool/postfix/maildrop/
    touch dummy
    ls - dummy
    rm dummy
    exit
    To see if user "postfix" can really write there.

    Also, examine the log to see if there is some other error besides that
    permission denied.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  9. #9

    Default Re: Problems with Email from Cron job

    Hi robin,
    Demonstrating my profound ignorance further I need a bit of guidance on mail basic concepts. First I understand "local" mail to be between two users on same lan. Is that correct? So to test do I have to set up two machines or can I do it between two accounts on same machine and log in as different users? Where do I look for mail to see if it works?
    Budgie2

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with Email from Cron job

    On 2012-04-13 01:18, Budgie2 wrote:
    >
    > Hi robin,
    > Demonstrating my profound ignorance further I need a bit of guidance on
    > mail basic concepts. First I understand "local" mail to be between two
    > users on same lan. Is that correct?


    No. Two users on the same machine. Keep things as simple as possible.

    > So to test do I have to set up two
    > machines or can I do it between two accounts on same machine and log in
    > as different users? Where do I look for mail to see if it works?


    You can use the very simple "mail" command to read those test emails. Or
    use Pine if you wish something more complex. No configuration is necessary,
    they work out of the box.

    I may be out of reach for a week (my laptop connection device has not
    arrived), somebody else will have to continue this, or you will have to
    wait. Sorry.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •