Forcing Queue as Apache

Max Kipness max at KIPNESS.COM
Tue Jun 14 20:28:43 IST 2005


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

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

------------------------ 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