Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Postfix, Autoreply

501 views
Skip to first unread message

motty cruz

unread,
May 20, 2013, 1:32:33 PM5/20/13
to
Hello, I'm having problems geting auto reply to work 

here is my autoreply text:
To: $1
Subject: Vacation
Content-Type: text/plain; charset=utf-8

This is an autoreponder email.
EOF

here is the error i'm getting: 
relay=autoreply, delay=0.06, delays=0.02/0.02/0/0.03, dsn=5.3.0, status=bounced (Command died with status 127: "/usr/local/auto/autoreply". Command output: /usr/local/auto/autoreply: From:: not found /usr/local/auto/autoreply: To:: not found /usr/local/auto/autoreply: Subject:: not found /usr/local/auto/autoreply: Content-Type:: not found /usr/local/auto/autoreply: This: not found /usr/local/auto/autoreply: EOF: not found )

can you help? 

Thanks, 
motty

Wietse Venema

unread,
May 20, 2013, 2:08:33 PM5/20/13
to
motty cruz:
Instead of adding missing lines with #!/bin/sh and cat <<EOF, perhaps
it is safer to install the vacation program that is provided with
sendmail, or the like.

Wietse

motty cruz

unread,
May 20, 2013, 2:19:36 PM5/20/13
to
Thank you Sir, I will take your suggestion. 


motty cruz

unread,
May 20, 2013, 2:36:32 PM5/20/13
to

Wietse Venema

unread,
May 20, 2013, 3:54:13 PM5/20/13
to
motty cruz:
> I was following this HowtO unsuccessful;
>
> http://www.postfix.org/VIRTUAL_README.html
>
> Autoreplies
> can i use this instaed of installing a new utility?

If you search for ``postfix postfix virtual auto reply''
then one of the solutions should work for you.

Wietse

motty cruz

unread,
May 20, 2013, 5:34:55 PM5/20/13
to
Thank you again for replying, 

I'm not making any progress, I have google this postfix virtual reply but have not worked for me

This is what i have in main.cf
# autoreply
virtual_maps = hash:/usr/local/etc/postfix-out/virtual
transport_maps = hash:/usr/local/etc/transport

less virtual

less transport
autoreply.mydomain.com      autoreply:

autoreply unix  -       n       n       -       -       pipe
        flags=f  user=nobody argv=/usr/local/auto/autoreply.pl $sender $recipient


less /usr/local/auto/autoreply

#!/bin/sh
To:$1
Subject:Vacation
Content-Type:text/plain; charset=utf-8

This is an autoreponder email.
<<EOF


am I missing anything else? please help


Wietse Venema

unread,
May 20, 2013, 5:45:59 PM5/20/13
to
motty cruz:
...
> less master.cf
> autoreply unix - n n - - pipe
> flags=f user=nobody argv=/usr/local/auto/autoreply.pl $sender
> $recipient
>
>
> less /usr/local/auto/autoreply
>
> #!/bin/sh
> From:mo...@mydomain.com
> To:$1
> Subject:Vacation
> Content-Type:text/plain; charset=utf-8
>
> This is an autoreponder email.
> <<EOF
>
> am I missing anything else? please help

Yes. Don't do it.

The best help I can give you is use someone elses autoreply program.

Wietse

Timo Röhling

unread,
May 20, 2013, 5:51:16 PM5/20/13
to
Am 20.05.2013 23:34, schrieb motty cruz:
> less /usr/local/auto/autoreply
>
> #!/bin/sh
> From:mo...@mydomain.com <mailto:From%3Am...@mydomain.com>
> To:$1
> Subject:Vacation
> Content-Type:text/plain; charset=utf-8
>
> This is an autoreponder email.
> <<EOF
This is not a valid shell script. And even if it were, it would be
susceptible to mail loops and other nastiness. Have a look at
http://www.postfix.org/addon.html#autoreply and pick the solution that
is the easiest for you to setup.

motty cruz

unread,
May 20, 2013, 8:04:11 PM5/20/13
to
Thanks Timo,

I was not able to get MSH Free Autoresponder  to work with postfix on FreeBSD machine, 

Does anybody have a script that work for autoresponders? 

Thanks, 
Motty

Peter

unread,
May 21, 2013, 12:09:12 AM5/21/13
to
On 05/21/2013 09:51 AM, Timo Röhling wrote:
> Have a look at
> http://www.postfix.org/addon.html#autoreply and pick the solution that
> is the easiest for you to setup.

I have two to add to that list:

1. Virtual Vacation which comes packaged with PostfixAdmin (but does
not require PostfixAdmin to use).

2. dovecot sieve and managesieve plugins (probably with other sieve
implementations as well).

There are addons in both Roundcube and Squirrlmail for both of the above
so that users can set their own autoreply messages.


Peter

motty cruz

unread,
May 21, 2013, 4:50:58 PM5/21/13
to
after a lot of research, I have this script


I get the copy and sender gets a copy, but how do I get Postfix to use this script
here is the script: 
#!/usr/bin/bash
/usr/sbin/sendmail -oi -t <<EOF
To: $1
Subject: On vacation
Content-Type: text/plain; charset=utf-8

This is a test email.
EOF

here is my master.cf
#
reply unix  -       n       n       -       -       pipe
        flags=Fq  user=nobody argv=/usr/local/sbin/reply $sender $recipient

here is my transport

any suggestions? 
Thanks,


Benny Pedersen

unread,
May 21, 2013, 8:23:57 PM5/21/13
to
motty cruz skrev den 2013-05-21 02:04:

> Does anybody have a script that work for autoresponders? 

try the one in postfixadmin, note it does not reply to maillists
blindly

--
senders that put my email into body content will deliver it to my own
trashcan, so if you like to get reply, dont do it

Robert L Mathews

unread,
May 22, 2013, 1:59:07 AM5/22/13
to
On 5/21/13 1:50 PM, motty cruz wrote:

> any suggestions?

Before you go any further, you should read RFC 3834, "Recommendations
for Automatic Responses to Electronic Mail":

http://tools.ietf.org/html/rfc3834

... particularly section 2, which begins (with admirable directness) "An
automatic responder MUST NOT blindly send a response for every message
received."

If you don't consider those recommendations, your script -- if you get
it working -- will do things you won't like.

As an example: what would your script do if it ever received a message
claiming to be from its own "From" address (because you sent yourself a
message, or because a spammer forged your own address)? It appears that
it would send itself an infinite loop of "On vacation" messages.

There are other subtle problems that are difficult to explain here, some
of which will cause you to annoy other people on the Internet, not just
yourself.

This is why people with experience are telling you to use existing
software that already takes all of this into account, instead of helping
you do something that's universally recognized as unwise.

--
Robert L Mathews, Tiger Technologies, http://www.tigertech.net/

Charles Marcus

unread,
May 22, 2013, 7:11:25 AM5/22/13
to
On 2013-05-21 8:23 PM, Benny Pedersen wrote:
> motty cruz skrev den 2013-05-21 02:04:
>
>> Does anybody have a script that work for autoresponders?
>
> try the one in postfixadmin, note it does not reply to maillists blindly

Well... I had a lot of trouble with it responding to a lot of things
that it shouldn't (facebook junk, etc).

The latest trunk version of the vacation script has a new variable and
test function that lets the admin easily add new strings to test for in
the From/MailFrom (envelope and headers) that will result in not sending
the vacation message.

I highly recommend using the new version if you decide to use it. It is
very effective now for my purposes.

--

Best regards,

Charles

motty cruz

unread,
May 22, 2013, 10:25:56 AM5/22/13
to
Thank your suggestions, do you mind pointing to a source for vacation script? I'm using FreeBSD

I tried to use Autoreply Software from here: http://www.postfix.org/addon.html#autoreply

but one requires Java and the other works with LDAP, I don't have LDAP and I'm not willing to use Java. 

Thank you for your help!

Charles Marcus

unread,
May 22, 2013, 11:30:30 AM5/22/13
to
Please don't top-post - response inline below...


On 2013-05-22 10:25 AM, motty cruz <motty...@gmail.com> wrote:
On Wed, May 22, 2013 at 4:11 AM, Charles Marcus <CMa...@media-brokers.com> wrote:
On 2013-05-21 8:23 PM, Benny Pedersen wrote:
motty cruz skrev den 2013-05-21 02:04:

Does anybody have a script that work for autoresponders?

try the one in postfixadmin, note it does not reply to maillists blindly

Well... I had a lot of trouble with it responding to a lot of things that it shouldn't (facebook junk, etc).

The latest trunk version of the vacation script has a new variable and test function that lets the admin easily add new strings to test for in the From/MailFrom (envelope and headers) that will result in not sending the vacation message.

I highly recommend using the new version if you decide to use it. It is very effective now for my purposes.

Thank your suggestions, do you mind pointing to a source for vacation script? I'm using FreeBSD

Thank you for your help!

My apologies... I see that Rudi still hasn't merged the last version of these changes to the trunk version. I just pinged him to see if he will do so, but until then, here is his latest version:

https://github.com/valkum/postfixadmin/blob/cdcccddbe2e1d6758cd63899e7b8973156f1412a/VIRTUAL_VACATION/vacation.pl

It has been running on my system for months now, and works great. Reduced the number of bogus responses from many per day per user, to virtually none, with my expanded custom no_reply string:

$noreply_pattern = 'alert|autoreply|auto-reply|bounce|constantcontact|do-not-reply|facebook|linkedin|list-|listserv|mailer|majordomo|myspace|newsletter|noreply|no-reply|owner\-|\-(owner|request|bounces)|postmaster|request\-|twitter';

-- 

Best regards,

Charles


motty cruz

unread,
May 22, 2013, 12:42:01 PM5/22/13
to
thank you soo much Charles, 
I was able to download that script you pointed in the last email, 

now this maybe dumb questions but I would like to deploy this script on the spam filter level before reaching our imap/pop server. At the spam filter level I don't have a database for users, 

I was  hoping to find something simple that can be implemented at the spam filter level when email bound to user on vacation can be reply automatically. maybe i dream about having this feature or i have seen it before? 

I really appreciated your help! 
Thanks Again, 

Charles Marcus

unread,
May 22, 2013, 1:43:22 PM5/22/13
to
Again - please do not top-post. If you don't know what that means,
google is your friend.

On 2013-05-22 12:42 PM, motty cruz <motty...@gmail.com> wrote:
> thank you soo much Charles,
> I was able to download that script you pointed in the last email,

You're welcome.

> now this maybe dumb questions but I would like to deploy this script
> on the spam filter level before reaching our imap/pop server. At the
> spam filter level I don't have a database for users,

?? Think about what you just said. How are you going to control sending
Vacation messages for only specific users (some will have it enabled,
some won't), if you don't have access to the user database?

Also, you need to clarify what you mean by 'spam filter'. There are
certain spam checks that are very cheap and can be applied early in the
smtp transaction (before recipient verification).

But more expensive *content* filters should never be wasted on invalid
users, so should only be applied *after* recipient verification.

Determining whether or not to send a Vacation message is one of the (if
not *the*) *last* stages in email delivery, *long* after any
spam/content filters.

> I was hoping to find something simple that can be implemented at the
> spam filter level when email bound to user on vacation can be reply
> automatically. maybe i dream about having this feature or i have seen
> it before?

No, you're not dreaming, you're just not thinking through how it must work.

--

Best regards,

Charles

0 new messages