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

Postfix Vacation Autoresponder

Reply to Post Add a New Topic
UserPost

8:30 am
December 11, 2009


terry

Guest

after complete the setup by using the instruction in "Postfix Vacation Autoresponder". i came into a problem seems difficult. i would like to ask some opinions.

my setup is postfix virtual user, openldap, mailscanner, , dovecot.

before vacation setup, i used ldap-alias.cf to rewrite to email to a local user ->

user1@example.com -> user1@example.local

in my main.cf

virtual_alias_maps = ldap:/etc/postfix/ldap-alias.cf

after vacation setup i tried

virtual_alias_maps = ldap:/etc/postfix/ldap-alias.cf,mysql:/etc/postfix/mysql-alias.cf

no working, as turning on vacation will rewrite (in mysql alias table)

user1@example.com -> user1@example.com,user1#example.com@vacation.invalid

but ldap-alias.cf already rewrite the address to user1@example.local

swapping the order also no go,

after user1@example.com -> user1@example.com,user1#example.com@vacation.invalid

it will not go thru ldap-alias.cf rewrite after mysql-alias.cf, resulted looping (i use fetchmail to fetch email from the hosting server and deliver to local mailbox), from what i read from maillog. the "Out of office" email delivered but also trying to deliver the email back to my hosting server.

10:46 pm
December 11, 2009


consultant

Admin

posts 341

Hi terry,

Please post the result of

postconf – n

11:41 pm
December 11, 2009


terry

Guest

here you go,

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
header_checks = regexp:/etc/postfix/header_checks
home_mailbox = Maildir/
html_directory = /usr/share/doc/postfix-2.6.5-documentation/html
mail_owner = postfix
mailbox_command =
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 31457280
mynetworks = 192.168.10.0/24, 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.5-documentation/readme
relayhost = jbserver.lybase.local
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = Welcome to My Mail Server
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = no
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = ldap:/etc/postfix/ldap-alias.cf,mysql:/etc/postfix/mysql-alias.cf
virtual_gid_maps = static:901
virtual_mailbox_base = /mnt/maildisk/vmail/
virtual_mailbox_domains = $mydomain
virtual_mailbox_limit = 10737418240
virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
virtual_uid_maps = static:901

ldap-alias.cf

server_host = 192.168.10.3
search_base = dc=example,dc=local
version = 3
query_filter =(&(objectclass=inetOrgPerson)(mail=%s))
result_attribute = maildrop
result_format = %s
bind = yes
bind_dn = cn=Manager,dc=example,dc=local
bind_pw = password

mysql-alias.cf

host = localhost
user = postfix
password = password
dbname = postfix
table = alias
select_field = goto
where_field = address
additional_conditions = and active = '1'

11:15 pm
December 12, 2009


consultant

Admin

posts 341

Ok, I've updated the Postfix Vacation Autoresponder article. But basically, you just need to change mysql-alias.cf with the lines below so it won't deliver to example.com.

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

4:40 am
December 13, 2009


terry

Guest

i modified mysql-alias.cf,

if

virtual_alias_maps = ldap:/etc/postfix/ldap-alias.cf,mysql:/etc/postfix/mysql-alias.cf

email will only send to user1@example.com (maildrop user1@example.local), mysql-alias.cf is not processed.

if

virtual_alias_maps = mysql:/etc/postfix/mysql-alias.cf,ldap:/etc/postfix/ldap-alias.cf

email is rewrite to user1@vacation.invalid, ldap-alias.cf is not processed .. sigh. so vacation mail is functioned but original mail is not delivered to the local mailbox.

my setup is postfix 2.6, dovecot 1.2.

10:12 am
December 13, 2009


consultant

Admin

posts 341

Please try this one

mysql-alias.cf

result_format = %u#%d@vacation.invalid

The result_format above is the correct one, I forgot to add the domain part.

main.cf

recipient_bcc_maps = mysql:/etc/postfix/mysql-alias.cf

Instead of using the virtual_alias_maps, we'll use the recipient_bcc_maps.

12:16 am
December 15, 2009


terry

Guest

great, it works!

as for postfix config, i would like to check if multiple entry in various config, is it the standard behaviour it would not process the remaining part of the entry if the earlier entry has already provided output (result), only empty output will make the config to continue try the next entry? like my config above.

virtual_alias_maps = ldap:/etc/postfix/ldap-alias.cf,mysql:/etc/postfix/mysql-alias.cf

because now you advise me to use bcc map, however i have plan to use bcc map for incoming and outgoing email journaling purpose, so i will have another multiple entry for recipient bcc map …

7:21 am
December 15, 2009


consultant

Admin

posts 341

virtual_alias_maps looks like it stops looking as soon as it finds a result.

recipient_bcc_maps unfortunately should output only one address unlike virtual_alias_maps which can give multiple address result.

Check out my Backup Incoming Email article, you might find it useful.

Reply to Post

Reply to Topic:
Postfix Vacation Autoresponder

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:
10 + 2
   


About the Linux Mail Server Setup and Howto Guide Forum

Forum Timezone: America/New_York

Most Users Ever Online: 60

Currently Online:
14 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)