[opensuse] Postfix - howto deliver mail for user to 2 machines?
Listmates, Sandy, Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope. -- David C. Rankin, J.D., P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 22/01/2008, David C. Rankin
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
I tend to use procmail in such case and setup a rule to forward the message to another address. This can easily be done by the user themselves in the local .procmailrc file. Alternatively the .forward file in the user account can be used. Another (and possibly the simplest option) is to define an alias in the /etc/aliases file adding a similar line user: user@machine2.com, \user Regards, -- Marcin Floryan http://marcin.floryan.pl/ Please consider the environment before printing this email. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Marcin Floryan wrote:
On 22/01/2008, David C. Rankin
wrote: Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
I tend to use procmail in such case and setup a rule to forward the message to another address. This can easily be done by the user themselves in the local .procmailrc file.
Alternatively the .forward file in the user account can be used.
Another (and possibly the simplest option) is to define an alias in the /etc/aliases file adding a similar line
user: user@machine2.com, \user
Regards,
Thanks Marcin, The tough part was I wanted a 'copy' forwarded to another box, not just a plain forward. Procmail was the answer. -- David C. Rankin, J.D., P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Marcin Floryan wrote:
On 22/01/2008, David C. Rankin
wrote: Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
I tend to use procmail in such case and setup a rule to forward the message to another address. This can easily be done by the user themselves in the local .procmailrc file.
Alternatively the .forward file in the user account can be used.
Another (and possibly the simplest option) is to define an alias in the /etc/aliases file adding a similar line
user: user@machine2.com, \user
Regards,
Thanks Marcin,
The tough part was I wanted a 'copy' forwarded to another box, not just a plain forward. Procmail was the answer.
Not necessarily. I would do this in virtual_alias_maps. /etc/postfix/virtual: user@example.com user@example.com, user@machine2.com -- Sandy List replies only please! Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Sandy Drobic wrote:
David C. Rankin wrote:
Marcin Floryan wrote:
On 22/01/2008, David C. Rankin
wrote: Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
I tend to use procmail in such case and setup a rule to forward the message to another address. This can easily be done by the user themselves in the local .procmailrc file.
Alternatively the .forward file in the user account can be used.
Another (and possibly the simplest option) is to define an alias in the /etc/aliases file adding a similar line
user: user@machine2.com, \user
Regards,
Thanks Marcin,
The tough part was I wanted a 'copy' forwarded to another box, not just a plain forward. Procmail was the answer.
Not necessarily. I would do this in virtual_alias_maps.
/etc/postfix/virtual: user@example.com user@example.com, user@machine2.com
Hmm. Sandy, I am trying to implement the /etc/postfix/virtual solution you suggested, but it doesn't seem to be working. Here is what I did. (1) edit /etc/postfix/virtual, and added me_at_rbpllc.com me_at_rbpllc.com, me_at_trinity.rbpllc.com (2) postmap hash:/etc/postfix/virtual (3) rcpostfix reload (4) disabled the .procmailrc solution (5) sent mail to me_at_rbpllc.com Mail arrives at rbpllc.com and is delivered to rbpllc.com by NOT to trinity.rbpllc.com? Can you offer any suggestions or point out where I screwed up? It just goes to show I can screw up the simple ones... -- David C. Rankin, J.D., P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Sandy Drobic wrote:
David C. Rankin wrote:
Marcin Floryan wrote:
On 22/01/2008, David C. Rankin
wrote: Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
I tend to use procmail in such case and setup a rule to forward the message to another address. This can easily be done by the user themselves in the local .procmailrc file.
Alternatively the .forward file in the user account can be used.
Another (and possibly the simplest option) is to define an alias in the /etc/aliases file adding a similar line
user: user@machine2.com, \user
Regards,
Thanks Marcin,
The tough part was I wanted a 'copy' forwarded to another box, not just a plain forward. Procmail was the answer.
Not necessarily. I would do this in virtual_alias_maps.
/etc/postfix/virtual: user@example.com user@example.com, user@machine2.com
Hmm. Sandy,
I am trying to implement the /etc/postfix/virtual solution you suggested, but it doesn't seem to be working. Here is what I did.
(1) edit /etc/postfix/virtual, and added
me_at_rbpllc.com me_at_rbpllc.com, me_at_trinity.rbpllc.com
(2) postmap hash:/etc/postfix/virtual (3) rcpostfix reload (4) disabled the .procmailrc solution (5) sent mail to me_at_rbpllc.com
Mail arrives at rbpllc.com and is delivered to rbpllc.com by NOT to trinity.rbpllc.com? Can you offer any suggestions or point out where I screwed up? It just goes to show I can screw up the simple ones...
Sandy,
For some reason there are strange greeting errors between the boxes
using the virtual solution:
Jan 25 21:29:43 bonza postfix/smtp[11264]: 5FF1026D838:
to=
David C. Rankin wrote:
David C. Rankin wrote:
Sandy Drobic wrote:
David C. Rankin wrote:
Marcin Floryan wrote:
On 22/01/2008, David C. Rankin
wrote: Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
I tend to use procmail in such case and setup a rule to forward the message to another address. This can easily be done by the user themselves in the local .procmailrc file.
Alternatively the .forward file in the user account can be used.
Another (and possibly the simplest option) is to define an alias in the /etc/aliases file adding a similar line
user: user@machine2.com, \user
Regards,
Thanks Marcin,
The tough part was I wanted a 'copy' forwarded to another box, not just a plain forward. Procmail was the answer.
Not necessarily. I would do this in virtual_alias_maps.
/etc/postfix/virtual: user@example.com user@example.com, user@machine2.com
Hmm. Sandy,
I am trying to implement the /etc/postfix/virtual solution you suggested, but it doesn't seem to be working. Here is what I did.
(1) edit /etc/postfix/virtual, and added
me_at_rbpllc.com me_at_rbpllc.com, me_at_trinity.rbpllc.com
(2) postmap hash:/etc/postfix/virtual (3) rcpostfix reload (4) disabled the .procmailrc solution (5) sent mail to me_at_rbpllc.com
Mail arrives at rbpllc.com and is delivered to rbpllc.com by NOT to trinity.rbpllc.com? Can you offer any suggestions or point out where I screwed up? It just goes to show I can screw up the simple ones...
Sandy,
For some reason there are strange greeting errors between the boxes using the virtual solution:
Jan 25 21:29:43 bonza postfix/smtp[11264]: 5FF1026D838: to=
, orig_to= , relay=trinity.rbpllc.com[192.168.7.17]:25, delay=1236, delays=935/0.02/300/0, dsn=4.4.2, status=deferred (conversation with trinity.rbpllc.com[192.168.7.17] timed out while receiving the initial server greeting) an 25 21:14:43 bonza postfix/error[11182]: 5FF1026D838: to=
, orig_to= relay=none, delay=335, delays=335/0.02/0/0.03, dsn=4.4.2, status=deferred (delivery temporarily suspended: conversation with trinity.rbpllc.com[192.168.7.17] timed out while receiving the initial server greeting) Huh?
I tried increasing smtp_connect_timeout = 60s, but that didn't help either. Any help?
I think I'm on the right track. I believe I've screwed up my virtual_alias_domain, I'm checking it out. -- David C. Rankin, J.D., P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
an 25 21:14:43 bonza postfix/error[11182]: 5FF1026D838: to=
, orig_to= relay=none, delay=335, delays=335/0.02/0/0.03, dsn=4.4.2, status=deferred (delivery temporarily suspended: conversation with trinity.rbpllc.com[192.168.7.17] timed out while receiving the initial server greeting) Huh?
I tried increasing smtp_connect_timeout = 60s, but that didn't help either. Any help?
I think I'm on the right track. I believe I've screwed up my virtual_alias_domain, I'm checking it out.
Addresses in virtual_alias_domains MUST be rewritten to another address class (virtual_mailbox_domains, mydestination, relay_domains). -- Sandy List replies only please! Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Jan 25 21:29:43 bonza postfix/smtp[11264]: 5FF1026D838: to=
, orig_to= , relay=trinity.rbpllc.com[192.168.7.17]:25, delay=1236, delays=935/0.02/300/0, dsn=4.4.2, status=deferred (conversation with trinity.rbpllc.com[192.168.7.17] timed out while receiving the initial server greeting)
Have you tried a simple "telnet 192.168.7.17 25" to see if the smtp banner of the site appears? Is this really the correct address, it is a private ip, after all. -- Sandy List replies only please! Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
* David C. Rankin
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
procmail :0: c ## for local delivery * ^To_.*"USER@hostname.com" $/location/maildir or :0: c ## for remote delivery * ^TO_.*"USER@hostname.com" !user@host.com note: the second recipe will work for both instances - -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFHlgRuClSjbQz1U5oRAkeQAJ9wiplhQkLyISmdPSb7PP4ySb2pLQCeOsDF /Bk0Mnxaxj2c3WMYd/DS+ew= =mrBq -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
* Patrick Shanahan
* David C. Rankin
[01-22-08 09:30]: Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
procmail
:0: c ## for local delivery * ^To_.*"USER@hostname.com" ^^^^^^^^^^^^^^^^^^^^
s/b * ^TO_........
$/location/maildir
or
:0: c ## for remote delivery * ^TO_.*"USER@hostname.com" !user@host.com
note: the second recipe will work for both instances -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
- -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFHlgiAClSjbQz1U5oRAlEvAKCP0OKY0oUr0cnZw0fxUrXkmQS/5wCggGuq UovA2SdDGmUXWnhBjb98SfY= =BMAk -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Patrick Shanahan wrote:
* David C. Rankin
[01-22-08 09:30]: Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
procmail
:0: c ## for local delivery * ^To_.*"USER@hostname.com" $/location/maildir
or
:0: c ## for remote delivery * ^TO_.*"USER@hostname.com" !user@host.com
note: the second recipe will work for both instances
Patrick, I used: :0 * ^TO_username@domain.com { :0c $DEFAULT :0 ! username@otherhost.domain.com } From your post, it looks like the :0c $DEFAULT was unnecessary and I could accomplish the same thing with a simple: :0c * ^TO_username@domain.com ! username@otherhost.domain.com Also, I see recipes that use just ':0' and others that use ':0:', is there a difference? Is one more correct? -- David C. Rankin, J.D., P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
* David C. Rankin
Also, I see recipes that use just ':0' and others that use ':0:', is there a difference? Is one more correct?
the trailing ":" is a lock. I use mbox which requires file lock. Not required for maildir. - -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFHlg4jClSjbQz1U5oRAlMKAJwMI1+L22jQs9tsH7RuCpbNWr1ocgCgjZgn HRg796Yanh8v8ysHScAHkI8= =5/jb -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
I got it! It's not postfix, it's procmail. Edit .procmailrc and set: :0 * ^TO_username@domain.com { :0c $DEFAULT :0 ! username@otherhost.domain.com } If this isn't right or there is a better way, please let me know. -- David C. Rankin, J.D., P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
Use the alias or virtual_alias table: user user@machine2.com, \user /Per Jessen, Zürich -- http://www.spamchek.com/ - your spam is our business. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
Deliver it locally, and then use NFS so that both machines can read the incoming mail spool. And then set up a POP (Post Office Protocol) server, which will coerce them into removing their messages from the mail machine (advise them to set up their mail agent to use the "remove mail from server" option). -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Aaron Kulkis wrote:
David C. Rankin wrote:
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
Deliver it locally, and then use NFS so that both machines can read the incoming mail spool. And then set up a POP (Post Office Protocol) server, which will coerce them into removing their messages from the mail machine (advise them to set up their mail agent to use the "remove mail from server" option).
Why not just imap? -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Aaron Kulkis wrote:
David C. Rankin wrote:
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
Deliver it locally, and then use NFS so that both machines can read the incoming mail spool. And then set up a POP (Post Office Protocol) server, which will coerce them into removing their messages from the mail machine (advise them to set up their mail agent to use the "remove mail from server" option).
Why not just imap?
Guys? Please have a look at the first quoted line. It was supposed to be "simple". Installing and maintaining additional unnecessary services, wenn one config line in an already running service is sufficient, seems horribly inefficient. -- Sandy List replies only please! Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wednesday 23 January 2008 08:50:04 Sandy Drobic wrote: [...]
Listmates,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope. [...]
Guys? Please have a look at the first quoted line. It was supposed to be "simple". Installing and maintaining additional unnecessary services, wenn one config line in an already running service is sufficient, seems horribly inefficient.
Sandy, Check out /etc/aliases. I have a server with a pseudo-user account called "articles" and a number of real users who want to receive mail addressed to articles@my.server.address. The following line in /etc/aliases makes postfix deliver a copy of any message to articles@my.server.address to the addresses user and all users in the include file: articles: :include:/etc/articles.users,\articles It isn't necessary to use the :include method. For example, joe: sam@another.host.org,joe@home.system.com,\joe would deliver one arriving message to two external addresses plus the local mailbox for joe. Jim Cunning -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Jim Cunning wrote:
On Wednesday 23 January 2008 08:50:04 Sandy Drobic wrote: [...]
Listmates,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope. [...] Guys? Please have a look at the first quoted line. It was supposed to be "simple". Installing and maintaining additional unnecessary services, wenn one config line in an already running service is sufficient, seems horribly inefficient.
Sandy, Check out /etc/aliases. I have a server with a pseudo-user account called "articles" and a number of real users who want to receive mail addressed to articles@my.server.address. The following line in /etc/aliases makes postfix deliver a copy of any message to articles@my.server.address to the addresses user and all users in the include file:
Hello Jim, the original Problem has already been solved (in this case David used Procmail. Though there's one requirement for your solution (and also the procmail solution: /etc/aliases will only be used by domains in $mydestination, all other domain address classes like virtual_mailbox_domains or relay_domains don't use /etc/aliases at all. In this case you have to use virtual_alias_maps. -- Sandy List replies only please! Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Sandy Drobic wrote:
James Knott wrote:
Aaron Kulkis wrote:
David C. Rankin wrote:
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
Deliver it locally, and then use NFS so that both machines can read the incoming mail spool. And then set up a POP (Post Office Protocol) server, which will coerce them into removing their messages from the mail machine (advise them to set up their mail agent to use the "remove mail from server" option).
Why not just imap?
Guys? Please have a look at the first quoted line. It was supposed to be "simple". Installing and maintaining additional unnecessary services, wenn one config line in an already running service is sufficient, seems horribly inefficient.
There's not a heck of a lot more to setting up an imap server than pop. -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Sandy Drobic wrote:
James Knott wrote:
Aaron Kulkis wrote:
David C. Rankin wrote:
Listmates, Sandy,
Where do I tell postfix to deliver mail for a user to localhost and deliver a copy to user@machine2.com? It has to be easy, -- I hope.
Deliver it locally, and then use NFS so that both machines can read the incoming mail spool. And then set up a POP (Post Office Protocol) server, which will coerce them into removing their messages from the mail machine (advise them to set up their mail agent to use the "remove mail from server" option).
Why not just imap?
Guys? Please have a look at the first quoted line. It was supposed to be "simple". Installing and maintaining additional unnecessary services, wenn one config line in an already running service is sufficient, seems horribly inefficient.
There's not a heck of a lot more to setting up an imap server than pop.
I agree, most of the time you will use an imap server anyway when you want to provide pop3, since most imap servers are able to do both. But why the heck would I install another service just to forward a second copy of a mail. This is like installing vmware in order to kick up a windows guest host so that you can open notepad.exe to write "Hello World!". (^-^) It would work, but it's just not efficient to do. You already have a mailserver running, so just tell him to do the job. -- Sandy List replies only please! Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (8)
-
Aaron Kulkis
-
David C. Rankin
-
James Knott
-
Jim Cunning
-
Marcin Floryan
-
Patrick Shanahan
-
Per Jessen
-
Sandy Drobic