Forcing Queue as Apache

Denis Beauchemin Denis.Beauchemin at USHERBROOKE.CA
Tue Jun 14 21:44:15 IST 2005


    [ The following text is in the "windows-1252" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

Max Kipness wrote:

>>Max Kipness said the following on 6/14/2005 12:28 PM:
>>    
>>
>>>I^Òve been unable to figure out the best method to force email through
>>>the
>>>queue as user apache.
>>>
>>>I^Òve created a web page that lists emails from the
>>>/var/spool/Mailscanner/^Å/^Å/spam dir. To release an email, I simply have
>>>some PHP code that copies the email to the /var/spool/mqueue dir. After
>>>altering permissions in MailScanner.conf, this is not a problem. If I
>>>just
>>>wait for the next queue interval (default 30 min), everything is fine.
>>>However, I^Òd like the email to deliver immediately, so I have the PHP
>>>script executing the following command:
>>>
>>>$send = `/usr/sbin/sendmail ^ÖqI$messageid`;
>>>
>>>This causes permissions problems.
>>>
>>>The problems are different if the recipient is local or being relayed to
>>>another server.
>>>
>>>If the recipient is on a mail server that is being relayed to after the
>>>spam/virus checks, I get this error:
>>>
>>>Jun 14 14:13:13 mailserver sendmail[6860]: j5E7hvlJ022952:
>>>SYSERR(apache):
>>>mail.xxxxxx.com. config error: mail loops back to me (MX problem?)
>>>
>>>If the recipient is local to the server (this mailscanner server also
>>>hosts actual Sendmail user accounts), then I get these errors:
>>>
>>>Jun 14 11:49:18 mailserver sendmail[3052]: j5E2sZ61017899:
>>>SYSERR(apache):
>>>hash map "Alias0": unsafe map file /etc/aliases.db: Permission denied
>>>
>>>Jun 14 11:49:18 mailserver sendmail[3053]: j5E2sZ61017899:
>>>SYSERR(apache):
>>>openmailer: insufficient privileges to change gid, RunAsUid=48,
>>>new_gid=0,
>>>gid=48, egid=51
>>>
>>>Jun 14 11:49:18 mailserver sendmail[3052]: j5E2sZ61017899: to=blisle,
>>>delay=13:54:43, xdelay=00:00:00, mailer=local, pri=352836, dsn=4.0.0,
>>>stat=Deferred: local mailer (/usr/bin/procmail) exited with EX_TEMPFAIL
>>>
>>>Jun 14 11:49:18 mailserver sendmail[3052]: j5E2sZ61017899:
>>>j5EGnIRN003052:
>>>sender notify: Warning: could not send message for past 4 hours
>>>
>>>I was able to get rid of the Alias0 error by changing perms to the
>>>/etc/aliases.db to 0644 (from 0640). But I can^Òt figure out the other
>>>errors.
>>>
>>>I was thinking of copying the messages to another folder instead of
>>>mqueue
>>>and then having cronjob running as root look into that folder every 5
>>>minutes and then copy to mqueue, but I^Òd rather having it
>>>instantaneously.
>>>
>>>Any suggestions? And how safe is it?
>>>
>>>Thanks,
>>>Max
>>>
>>>      
>>>
>>Couldn't you just flush the sendmail queue after the copy.
>>/usr/lib/sendmail -v -q -C/etc/mail/sendmail.cf, if I remember
>>correctly, should do. Shouldn't be too much unless you release a lot of
>>messages fairly often.
>>But it will send everything in the queue, and not just the released
>>message.
>>    
>>
>
>Right, this will try to send everything instead of the one message. But
>this doesn't get around the permissions issue, because apache is still
>executing sendmail.
>
>  
>

What if you used sudo to give apache some more access?

Denis

-- 
   _
  °v°   Denis Beauchemin, analyste
 /(_)\  Université de Sherbrooke, S.T.I.
  ^ ^   T: 819.821.8000x2252 F: 819.821.8045

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!




More information about the MailScanner mailing list