Link to home
Start Free TrialLog in
Avatar of psimation
psimationFlag for South Africa

asked on

auto reply with sendmail/cyrus & header problem

Hi, I have a 2 fold question. I need to be albe to generate auto reply/responce for certain clients that will simply mail the person back and say "sorry I am on a 2 week leave and will return your mail as soon as I'm back at the office". The server must obviously keep all these mails sent during that time.

Then, I seem to experience some problems with headers. Specifically the Return-Path header. I generate some e-mails with PHP and as such, sendmail mails it as user nobody and includes a Return-Path header of [nobody@mydomain.com]. It does so even though I specifically placed a Return-Path header in the mail I sent with PHP, sendmail won't allow this header to be replaced. I got the Sendmail book, and I saw you need to put some kind of _H flag in the config.c file. But, I don't exactly understand what this mean. I gather it is a source file, and after I have placed that flag there I must re-build sendmail, right? Is this a good idea to do something like this, isn't there an easier way to override the header?
Avatar of toneus
toneus

for your "out of office reply" you can use procmail.
In each user you must place a .procmailrc file (check the procmail docs for exact filename I'm not a 100% sure if 'rc' is part of the name).
In this file you can place the rule for each user.
Of course you can make a generic rule  which can be used by everyone as an out of office reply.

'man procmail' should give enough info for simple rules.

success!

Ton
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of psimation

ASKER

toneus
Thanks for the suggestion, however, Jim has a slight advantage when it comes to making suggestions about my server for he basically installed all the software on it for me via the internet. I'm not saying procmail will not work or anything, but I would definately be more interested to see how sieve works seeing that, after reading up on it a bit, it seems like sieve and cyrus works together, and I cannot say the same for procmail...

Jim
As always, thanks for the input. I tired to read up on sieve, but the material I got only gave a very minimalistic view of sieve and none of them was definitive enough for me to feel adequate to attempt a configure. They mention placing scripts on the server ( which is a very broad description; where exactly ?) they also say things like placing scripts in the home folder of the users, but as you know, most of my cyrus users don't have home folders, so how now brown cow?
The only mention I found on Sieve on my server were the files in the original source of cyrus in your home folder, and nothing in the "working" folders of my server, suggesting to me that cyrus might NOT have been compiled with sieve support?? Can you plz give me a little more detail on installing, running and implementing sieve per user, as I will obviously have different messages for different users.

Thanks.
PS, If the second part of my question is a bit too elaborate for 50points shared with sieve, pls let me know and I'll post a question on that alone (but only if you feel you have an answer..I don't want to open too many questions, one tend to lose track of them, and I've had points disappear into the ether when deleting unresolved questions...)
Tell you what. Give me a day or two to finish up the Cyrus+Sieve+WebSieve server I'm working on right now and I'll post a set of notes as to how I made it work and how to do the 'vacation auto-reply'.

As to the second part of the question... Can I see a snippet of your PHP code where you send the email?
That's easy

<?php
$address = "mail@mailserver.dom";
$subject = "Mail subject";
$message = "First line of message.\n";
$message .= "Second line of message...\n";
$headers = "From: myaddy@myserver.dom\n";
$headers .= "Reply-To: myreply@myserver.dom\n";
$headers .= "Return-Path: myrealaddress@myserver.dom\n";
$headers .= "Errors-To: errors@myserver.dom\n";

mail($address,$subject,$message,$headers);

echo "Mail sent OK!";
?>

This snippet works 100%, when I send the mail to one of my adresses (even to one that is not residing on my server), I get the mail and all the headers are correctly added and displayed in the message EXCEPT for the Return-Path, which is ignored and instead the message has a header right at the top of the message (when viewing the code of the message) with a Return-Path: header reading [nobody@mydomain.dom]

I have a last hope of fixing this, but it's not a clean fix; In the php.ini file, there is a section where you can say what the default php user is, default = nobody, and this is where I think the header nobody@mydomain.dom comes from, so if I give a valid system user here with a mailbox for that user, all returned mail for php mail(); functions will end up there and not in my root box, only problem with this is that I will (like I have now) have no way to see from which of the 100's of php mail(); on the various domains on my servers these errors are originating from, so I will still not be able to route errors to the various admins for the domains...
At least it will keep my root mailbox open to catch the non-php related mail problems, for what that is worth...
The more I read the section about the H_ flag in the conf.c file in the Senmail handbook, the more it looks to be the solution, but as I already explained, I don't seem to have this file on my system ( i did install the sendmail source via rpm, but can still not find it...) and I really wouldn't want to re-build sendmail now (don't like fixing things if they're not broken).
PLEASE UPDATE AND FINALIZE THIS AND ALL YOUR OPEN QUESTIONS.

Moondancer
Community Support Moderator @ Experts Exchange
What would you like done with this question, since you logged in after my update request but didn't confirm your desires.  Experts have not added anything further.

Moondancer
Community Support Moderator @ Experts Exchange
I came here more than a week ago to accept this question, but for some reason the system did not register that.

jlevie should get an "A" for his last comment.

I really can't understand what is going on with EE. I have NEVER received any free question points since joining the Knowledge Pro , have questions "pending delete" for months, don't get e-mail notifications when comments are made to my questions ( sometimes; but seems to be most of the times nowadays), am still waiting for my last 2 T shirts, and get the "sorry we're down" page more than I get the login page???
Hi, psimation.  I will force accept and close this as you noted above, sorry for the problems you've experienced.  Also please check your profile where I have added the EE Pro points which did not flow to you.

Pending deletions--->  Please post a zero point question in Community Support with the QID/Link information of the pending deletions.  These will be manually handled by a Moderator.  Also please check your Profile and validate everything in it, Email address, address, etc.  To ensure that everything there is correct.  We had an Email problem the past couple of days, are changing to a new Server which accounts for these days.  Power Search has been fixed, new Edit Tabs, tons of new TAs, many fixes and enhancements implemented.  This site has changed ownership, as noted in the What's New link below, and they are working diligently to fix the remaining roadblocks.

https://www.experts-exchange.com/jsp/infoWhatsNew.jsp

As regards T-Shirts, they were an offer from prior owners now gone.  New owners are assessing what will be and will post such decisions in What's New as well.

Hopefully this answers your questions, but should you have more, please add them to the Community Support along with your pending deletion links.

CS Moderator