Hi, I reread documentation, posts in google related with “get fetchmail to work”. After several days I have completed own instruction for CentOS:
[b]yum[/b] install fetchmail
[b]rpm[/b] -qa | grep fetchmail
2.install next perl modules:
3.create a directory, lockfile for fetchmail:
chown vmail:vmail –R /var/run/fetchmail
(vmail – user from dovecot.conf-socket listen master-user and owner of /var/vmail (“/var/vmail” is from conf postfix(main.cf) - virtual_mailbox_base = /var/vmail) )
4.put your settings to /etc/mail/postfixadmin/fetchmail.conf
# database backend
$db_type = 'mysql';
# host name
# database name
# database username
# database password
5.chown vmail:vmail /etc/mail/postfixadmin/fetchmail.conf
6. add in crontab:
*/10 * * * * /usr/bin/sudo -H -u vmail perl /opt/postfixadmin/ADDITIONS/fetchmail.pl
7. add vmail user to sudouser
in /etc/sudoers (if you don’t do it, you will receive in log file: sudo: sorry, you must have a tty to run sudo)
After all this fetchmail.pl should start work, but I have next error in log:
Sep 7 12:40:02 server fetchmail-all: fetch firstname.lastname@example.org for email@example.com
Sep 7 12:40:02 server fetchmail: Unknown login or authentication error on firstname.lastname@example.org@mail.real-domain.com
Sep 7 12:40:02 server fetchmail: socket error while fetching from email@example.com@mail.real-domain.com
Sep 7 12:40:02 server fetchmail: Query status=2 (SOCKET)
Can you help me?
I changed in postfixadmin remote user to user (was firstname.lastname@example.org) and remote server to real-domain.com (was_ mail.real-domain.com_), but again have error in log:
Sep 7 13:30:01 server fetchmail-all: fetch user for email@example.com
Sep 7 13:30:22 server fetchmail: connection to real-domain.com:pop3 ["real-ip of real-domain.com"/110] failed: Connection timed out.
Sep 7 13:30:22 server fetchmail: POP3 connection to real-domain.com failed: Connection timed out
Sep 7 13:30:22 server fetchmail: Query status=2 (SOCKET)
I have new errors after previous changes
Sep 7 14:00:01 server fetchmail-all: fetch user for firstname.lastname@example.org
Sep 7 14:00:02 server fetchmail: Unknown login or authentication error on email@example.com
Sep 7 14:00:02 server fetchmail: socket error while fetching from firstname.lastname@example.org
Sep 7 14:00:02 server fetchmail: Query status=2 (SOCKET)
I think error is in, when script concat remote user name and remote server name -> email@example.com, in this case script should trims "mail" part from remote server name and after this concat remote user name and remote server name -> firstname.lastname@example.org, at result remote user name will be - email@example.com, remote server name will be - mail.real-domain.com
Random thoughts - I know little about fetchmail.pl stuff, but :
1. Check the configuration file the script creates (presumably /tmp/fetchmail-all-XXXX) (where X will be a random character).
2. the src_user field should be the pop3 username (which is often a full emailaddress). Seeing firstname.lastname@example.org@something.yy is just how it is being logged).
3. I'd be more interested why you were seeing the pop3 server connection timeout/fail to connect -
Sep 7 13:30:22 server fetchmail: connection to real-domain.com:pop3 failed: Connection timed out.
Could the remote server have blocked you because you failed to login too many times? Do you need to connect with pop3+ssl instead?
Thanks,David, for answer. Realy, I should was disable of using ssl/tls. ssl option wasn't checked in web form of my mail account(in postfixadmin), I am thinking, that this option doesn't work. I solved the problem by adding manually option in postfix.db
field "extra_options" -> sslproto ssl23
. It would be nice to add the ability to add any extra options on web form of mail account in postfixadmin.
Log in to post a comment.