Solved

auto reply with sendmail/cyrus & header problem

Posted on 2001-08-08
9
550 Views
Last Modified: 2012-05-04
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?
0
Comment
Question by:psimation
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:toneus
Comment Utility
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
0
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
Comment Utility
On a Cyrus server you can use Sieve to do that. Sieve is on your server, as I recall, but it may not be completely configured. In addition to the normal Cyus directives, for sieve you need 'sendmail: /usr/sbin/sendmail' in the imapd.conf file. The man pages will tell you about the rules that sieve uses and there's a web interface for sieve that I haven't yet used (but will set up and use soon). I don't have a URL handy, but you should be able to find it with a websearch.
0
 
LVL 17

Author Comment

by:psimation
Comment Utility
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...)
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
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?
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 17

Author Comment

by:psimation
Comment Utility
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).
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
PLEASE UPDATE AND FINALIZE THIS AND ALL YOUR OPEN QUESTIONS.

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
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
0
 
LVL 17

Author Comment

by:psimation
Comment Utility
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???
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
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.

http://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
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now