Discussion:
[Dovecot] getmail and Dovecot LDA deliver
spacejam
2009-08-10 08:50:11 UTC
Permalink
Hello,

my first post in this list. Hope it's the right place.:-)

I'm having a problem running getmail together with Dovecot LDA for virtual
users. To achive this I let getmail run under the user that owns the virtual
email accounts-root. The problem is that getmail is running under the user
vmail and therefore the emails received will be put into vmail's mailbox.
But the emails getmail collected are actually for a virtual Dovecot user
which has its maildir in a subdirectory of vmails home.
The settings for the virtual users seem to be okay: I can login on Dovecot
with virtual user account and I can send emails to Postfix for the virtual
user. Postfix correctly uses devlier with the name of the virtual user and
so the emails are going to the correct directory.
For me it seems that getmail always uses the username under which getmail is
currently running. As this must be a local user, getmails always announces
this local user to deliver and deliver therefore puts the emails into the
wrong account.
My question is: How do I let deliver know that it should use a virtual user?
I tried with the -d agrument in my getmail rc File, but deliver never
accepts the parameter -d (always says unknown parameter -d). I tried as well
to let getmail or deliver to be run as root, but then the emails will be
delivered to roots home, which is not the goal too...
Does anyone know a way how I can set getmail to handle emails for a virtual
account properly?

Any hint is appreciated as it already costed me hours of try-and-error

Regards

tobi
--
View this message in context: http://www.nabble.com/getmail-and-Dovecot-LDA-deliver-tp24896318p24896318.html
Sent from the Dovecot mailing list archive at Nabble.com.
Timo Sirainen
2009-08-10 08:59:19 UTC
Permalink
Post by spacejam
My question is: How do I let deliver know that it should use a
virtual user?
I tried with the -d agrument in my getmail rc File, but deliver never
accepts the parameter -d (always says unknown parameter -d).
Either you're using some really ancient deliver version or the error
message comes from getmail or something else besides deliver. So, what
Dovecot version do you use? And also copy&paste the exact error
message (and maybe other messages too) that you get. And the getmailrc
could help too.
spacejam
2009-08-10 09:22:55 UTC
Permalink
Post by Timo Sirainen
Post by spacejam
My question is: How do I let deliver know that it should use a virtual user?
I tried with the -d agrument in my getmail rc File, but deliver never
accepts the parameter -d (always says unknown parameter -d).
Either you're using some really ancient deliver version or the error
message comes from getmail or something else besides deliver. So, what
Dovecot version do you use? And also copy&paste the exact error
message (and maybe other messages too) that you get. And the getmailrc
could help too.
I compiled deliver from Dovecot-1.0.15 The -d parameter is accepted by
deliver if Postfix invokes the mailbox_command to "deliver" emails to
virtual accounts. The error message from deliver is something like "deliver
unknown argument -d username" (I will check the exact message this evening
after work). As well I will post the content of the destination section from
my rc file which tries so invoke deliver for mail delivery to virtual
account.
I'm pretty sure that the error message comes from deliver as the program
name (deliver) is mentioned in the logfiles with the error message
--
View this message in context: http://www.nabble.com/getmail-and-Dovecot-LDA-deliver-tp24896318p24896701.html
Sent from the Dovecot mailing list archive at Nabble.com.
Robert Schetterer
2009-08-10 09:34:34 UTC
Permalink
Post by spacejam
Post by Timo Sirainen
Post by spacejam
My question is: How do I let deliver know that it should use a virtual user?
I tried with the -d agrument in my getmail rc File, but deliver never
accepts the parameter -d (always says unknown parameter -d).
Either you're using some really ancient deliver version or the error
message comes from getmail or something else besides deliver. So, what
Dovecot version do you use? And also copy&paste the exact error
message (and maybe other messages too) that you get. And the getmailrc
could help too.
I compiled deliver from Dovecot-1.0.15 The -d parameter is accepted by
deliver if Postfix invokes the mailbox_command to "deliver" emails to
virtual accounts. The error message from deliver is something like "deliver
unknown argument -d username" (I will check the exact message this evening
after work). As well I will post the content of the destination section from
my rc file which tries so invoke deliver for mail delivery to virtual
account.
I'm pretty sure that the error message comes from deliver as the program
name (deliver) is mentioned in the logfiles with the error message
just as an idea
it may work using postfix sendmail

[destination]

type = MDA_external

path = /path/to/sendmail ( parameters )

then postfix may start deliver
--
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria
spacejam
2009-08-10 09:43:47 UTC
Permalink
Post by Robert Schetterer
just as an idea
it may work using postfix sendmail
[destination]
type = MDA_external
path = /path/to/sendmail ( parameters )
then postfix may start deliver
Didn't thought about this way. Sounds like it could work as deliver works
properly with Postfix. I will try this today after working.
Thanks for the idea

tobi
--
View this message in context: http://www.nabble.com/getmail-and-Dovecot-LDA-deliver-tp24896318p24896930.html
Sent from the Dovecot mailing list archive at Nabble.com.
Robert Schetterer
2009-08-10 10:02:12 UTC
Permalink
Post by spacejam
Post by Robert Schetterer
just as an idea
it may work using postfix sendmail
[destination]
type = MDA_external
path = /path/to/sendmail ( parameters )
then postfix may start deliver
Didn't thought about this way. Sounds like it could work as deliver works
properly with Postfix. I will try this today after working.
Thanks for the idea
tobi
no problem, but i think
getmail should place emails without running
external mta to in virtual users maildirs
there may be problems with permissions and home paths for virtuals users
but getmail setup should be enough flexi to manage this

perhaps you read again
http://pyropus.ca/software/getmail/configuration.html#destination-maildir
http://pyropus.ca/software/getmail/getmailrc-examples
and ask on their list
--
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria
spacejam
2009-08-10 10:09:47 UTC
Permalink
Post by Robert Schetterer
Post by spacejam
Post by Robert Schetterer
just as an idea
it may work using postfix sendmail
[destination]
type = MDA_external
path = /path/to/sendmail ( parameters )
then postfix may start deliver
Didn't thought about this way. Sounds like it could work as deliver works
properly with Postfix. I will try this today after working.
Thanks for the idea
tobi
no problem, but i think
getmail should place emails without running
external mta to in virtual users maildirs
there may be problems with permissions and home paths for virtuals users
but getmail setup should be enough flexi to manage this
perhaps you read again
http://pyropus.ca/software/getmail/configuration.html#destination-maildir
http://pyropus.ca/software/getmail/getmailrc-examples
and ask on their list
--
Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
Yes as a workaround I let getmail sent the emails directly to the virtual
mailbox (with destination type Maildir). The negative thing about this
solution is that I want to use dovecot-sieve which is not working on emails
directly sent to mailbox. As far as I understood doevecot-sieve, dovecot
deliver has to be invoked in order to work with the sieve

Regards

tobi
--
View this message in context: http://www.nabble.com/getmail-and-Dovecot-LDA-deliver-tp24896318p24897269.html
Sent from the Dovecot mailing list archive at Nabble.com.
Charles Marcus
2009-08-10 10:32:35 UTC
Permalink
Post by spacejam
Yes as a workaround I let getmail sent the emails directly to the virtual
mailbox (with destination type Maildir). The negative thing about this
solution is that I want to use dovecot-sieve which is not working on emails
directly sent to mailbox. As far as I understood doevecot-sieve, dovecot
deliver has to be invoked in order to work with the sieve
If you want to use sieve, you really need to upgrade... 1.0.15 is old,
so even if you weren't gonna use sieve, you should upgrade anyway.

1.2.3 is current stable...
--
Best regards,

Charles
spacejam
2009-09-29 16:08:24 UTC
Permalink
Post by Robert Schetterer
no problem, but i think
getmail should place emails without running
external mta to in virtual users maildirs
there may be problems with permissions and home paths for virtuals users
but getmail setup should be enough flexi to manage this
perhaps you read again
http://pyropus.ca/software/getmail/configuration.html#destination-maildir
http://pyropus.ca/software/getmail/getmailrc-examples
and ask on their list
--
Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
After a long time running (fine) with sendmail I finally found out the
problem. 30cm in front of the computer
If I give the argument like that

type = MDA_external
path = /usr/syno/mailstation/libexec/dovecot/deliver
arguments = ("-d","virtualuser at domain.net",)

then it works like charm :-)
Thanks for the links (the 2nd one had the solution)

tobi
--
View this message in context: http://www.nabble.com/getmail-and-Dovecot-LDA-deliver-tp24896318p25665899.html
Sent from the Dovecot mailing list archive at Nabble.com.
spacejam
2009-08-10 16:55:57 UTC
Permalink
Post by Robert Schetterer
just as an idea
it may work using postfix sendmail
[destination]
type = MDA_external
path = /path/to/sendmail ( parameters )
That was the idea. First I tried to use getmail_fetch which allows to
specify a virtual username on the command line. It received the emails and
put them into the virtual users Maildir. But with getmail_fetch I could not
see to integrate the email received into Spamassassins scannig process.
So the idea with sendmail was just the one which works as wished. So my rc
File (dest part) looks like that
<<
[destination]
type = MDA_external
path = /usr/syno/mailstation/sbin/sendmail
arguments = ("vuser at virtual-domain.tld",)
I know that I should update the dovecot as well but my system is a NAS
system. And as I use this system for my email accounts I don't want to risk
to update the dovecot. But next week I will receive a second NAS server
which I will use for backups. But before I will try to install an up-to-date
Dovecot-Version and see if everything works fine with the firmware from the
manufactor.

Best regards

tobi
--
View this message in context: http://www.nabble.com/getmail-and-Dovecot-LDA-deliver-tp24896318p24903371.html
Sent from the Dovecot mailing list archive at Nabble.com.
Loading...