Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Auto reply feature

Reply to Post Add a New Topic
UserPost

6:50 pm
November 21, 2009


Simiyu

Guest

Hii guys,

Firstly thanks for the great work on http://www.linuxmail.info, its been a real life saver when i was setting up a mail server from scratch.

I now have a functioning mail server but i am having problems with the vacation.pl, i have also tried using usermin as well as autoresponder but for some reason they all do not seem to work.

My mail server has no virtual users, they are all local.

Any ideas will be appreciated.

regards,

Simiyu

7:43 am
November 29, 2009


consultant

Admin

posts 341

Hi simiyu,

The Postfix vacation autoresponder is really my toughest article. There is no perfect solution available out of the box. To make it work, I had to customize almost every component related to it. Anyway, I've now completely overhauled the Postfix Autoresponder article, please try it again.

9:17 am
December 3, 2009


mariogomide

Guest

Hello Mr. Consultant and everybody

I´m also having some trouble to set up my vacation/auto-reply feature on my webmail. I´ve tried lots of different solutions and still not achieving success.

My environment is set:  postfix + dovecot + squirreloutlook (it´s a "fork" of squirrelmail) +Win2k3 AD authentication.

That means I have only virtual users in the AD and one local user vmail. The users´ homes are in /home/vmail/USER and the permissions to everything is set to owner vmail:vmail and access permission is 700.

The architecture is somewhat complex, since I got kerberos configured, Samba/Winbind, dovecot-ldap.cf

I´ve tried the Postifx Autoresponder article, but no success…

Any ideas?

Thanks a lot and congrats on the good job!

Mario

6:48 pm
December 3, 2009


consultant

Admin

posts 341

Hi Mario,

Can you describe which part of the Postfix Autoresponder you're having trouble with?

1:20 pm
December 30, 2009


mariogomide

Guest

Hi Consultant,

As you may have read on other posts, I reconfigured my mail server to use only virtual users with kerberos authentication against AD.

First I tried to use the Autoresponder plugin for Squirrelmail, but apparently it only works with real users.

Now I focused on the vacation part using the perl plugin (Postfix Vacation Autoresponder).

Now the problem is:

My postfix 2.3 (provided by RedHat) gives this error: "fatal: unsupported dictionary type: mysql"

RHEL 5.4 doesn't have the package postfix-mysql… Now what? I don't want to recompile postfix to work with mysql, because of the support contract.

I thought about instead of using a mysql database, I could use something that postfix can work with, like a hashed text database, then I would have to change the vacation.pl script to work with that.

Is there any other option? I thought about LDAP, but I don't know if thats a good idea, since I used to use ldap for authenticating and for mailbox lookups and I had problems. And since I alrealdy have an AD user base, why would I want to have another user base? In the case of using LDAP, what would the configuration file contain?

Thanks a lot!

Mario

5:28 pm
December 30, 2009


consultant

Admin

posts 341

Hi Mario,

In that case use LDAP. Active Directory also has an LDAP feature so you so can use your existing user base. Check out the Active Directory/LDAP Postfix Virtual Users article read the comments posted by CJ at the bottom of the page. He used Gnarwl for the vacation script and Active Directory UserMod Assistant for end user updating of the vacation fields.

8:49 am
January 15, 2010


mariogomide

Guest

Hey Consultant!

Now i'm concentrated on autoreply. I decided to recompile postfix on a lab environment to work with mysql.

I followed everything at the article Postfix Vacation Autoresponder and it looks like it is all ok. BUT it doesn't seem to be working… I send the e-mail, I see that mesage in maillog being relayed to the vacation "method" but I get no auto-reply message.

This is what's in the maillog:

postfix/virtual[16265]: 675CDF8075: to=<emailaddress@mydomain>, relay=virtual, delay=0.05, delays=0.03/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)

postfix/pipe[16266]: 675CDF8075: to=<emailaddress@vacation.invalid>, relay=vacation, delay=0.15, delays=0.03/0.01/0/0.11, dsn=2.0.0, status=sent (delivered via vacation service)

I tried both configurations in mysql-aliases.cf but none seem to work… what's wrong?

BTW, I tried to activate the logging from the vacation.pl scripts to try to find out the problems, but its not logging either..

11:28 am
January 15, 2010


consultant

Admin

posts 341

Set test_mode to 1 in the file /home/vacation/vacation.conf, then try sending a mail. Test mode does not check the if the recipient has a vacation message.

2:56 pm
January 15, 2010


mariogomide

Guest

So, I activated the test mode, and this is what is logged:

vacation.debug:

====== 2010/01/15 17:20:56 ======
Mail::Sendmail said :Mail::Sendmail v. 0.79 – Fri Jan 15 17:20:56 2010

vacation.log:

2010/01/15 17:20:56: To:  From:  Subject:  MessageID: Bad or missing From address: 'myusername'

I also get this in my maillog:

Jan 15 17:20:56 myhost Vacation: Orig-To:  From:  MessageID: Bad or missing From address: 'myusername'
Jan 15 17:20:56 myhost Vacation:  Subject:

5:31 pm
January 15, 2010


consultant

Admin

posts 341

You need to specify the full email address, myusername@domain.com

7:20 am
January 18, 2010


mariogomide

Guest

Hi there!

Consultant, I was specifying the full email address. I even tried a combination of sender, recipient etc. But it didnt work.

I found out that it wasn't working because something was missing! I read the documentation form postfixadmin's vacation and found out I had to put some more stuff into master.cf:

vacation  unix  -       n       n       -       -       pipe
  flags=Rq user=vacation argv=/home/vacation/vacation.pl -f ${sender} — ${recipient}

And it started to work. BUT, there is a problem. Although it works, it will send the wrong reply!

Say user1@domain sent an email to user2@domain, whom has autoreply activated. user1 willl receive an autoreply from user2 but with the subject and body of user1. So the sender receives an his own autoreply message.

I don't know, but maybe this version of vacation.pl has different parameters etc.

12:49 pm
January 19, 2010


mariogomide

Guest

Hey there!

I finally found out the problem and fixed it!

Consultant, there is a problem in vacation.pl for a determined condition.

I use Postfix 2.3 and I already use a virtual_alias_maps in main.cf. So I did as described in the how_to:

If adding the vacation domain conflicts with your existing virtual_alias_maps, use recipient_bcc_maps instead and replace /etc/postfix/mysql-aliases.cf with the lines below.

host = localhost
user = postfix
password = your_password
dbname = postfix
table = vacation
select_field = email
where_field = email
additional_conditions = and active = '1'
result_format = %u@vacation.invalid

When the above is used, vacation.pl won't work correctly. Exactly here (lines 307 to 312):

my ($user, $domain) = split(/@/, $recipient);
$user =~ s/#/@/;
$delivery_to = $user;

$email = $ARGV[1];
if (!defined $email) { $email = $delivery_to; }

As you can see, the split function will only return what we want with the first mysql-aliases.cf. Since I'am using the second (alternate) mysql-aliases.cf, the content of "result_format" (from the vacation table from postfixadmin) will not apply to the split function. Therefore, $delivery_to is formed only with the username, without the domain part.

Right after, since I'm not using Postifx 2.5 with {original_recipient} in master.cf (only {recipient}) my ARGV[1] doesn exist, then $email will be the username without domain, causing the rest of the script not to work correctly.

So I changed vacation.pl from (lines 307 to 309):

my ($user, $domain) = split(/@/, $recipient);
$user =~ s/#/@/;
$delivery_to = $user

to:

if ($alternate_alias_maps == 1) {
        my ($user, $domain) = split(/@/, $recipient);
        $delivery_to = $user."@".$my_domain;
} else {
        my ($user, $domain) = split(/@/, $recipient);
        $user =~ s/#/@/;
        $delivery_to = $user;
}

Added two new variables (lines 112 and 113):

our $alternate_alias_maps = 0;
our $my_domain = '';

And set these parameters in vacation.conf:

$my_domain   = 'my.own.domain';
$alternate_alias_maps = 1;

So what I did actually was update vacation.pl. I added the functionality to work with the alternative mysql_aliases.cf, and the script still works fine in other conditions.

That's it! Vacation with virtual users is working just fine now!

Thanks for all the support!

Mario

Reply to Post

Reply to Topic:
Auto reply feature

Guest Name (Required):

Guest Email (Required):

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
4 + 3
   


About the Linux Mail Server Setup and Howto Guide Forum

Forum Timezone: America/New_York

Most Users Ever Online: 60

Currently Online:
7 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 5
Topics: 326
Posts: 1012

Membership:

There are 928 Members
There have been 84 Guests

There is 1 Admin

Top Posters:

shanmugasundaram s – 45
Kendermin – 15
Ginger – 14
bighorn – 14
iron_michael86 – 12
Raminda – 11

Recent New Members: RaHuL, bikesh, pappy_says, geos, boudi7, dara.hr

Administrators: consultant (341 Posts)